필터 지우기
필터 지우기

How can I detect green colors in an image?

조회 수: 10 (최근 30일)
Raphael Ferreira
Raphael Ferreira 2018년 11월 27일
답변: SC P 2018년 11월 29일
I'm developing a code to detect objects in an image through the algorithm of Viola and Jones, but it did not work out perfectly because the image has many details. So I decided to start by first detecting the color and then defining the objects through recognition. How can I detect green colors in an image? Since I'm grateful!

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 11월 27일
편집: KALYAN ACHARJYA 2018년 11월 27일
See color detection is very vast topic, any color generation based on three components R, G,B.
Green color also varies from lower to maximum.
Are you looking for those pixels which having R=0,G=Maximum Level, and B=0? In 8 bit image it would be (0,255,0)
green_component=imageRGB(:,:,2)
  댓글 수: 4
Raphael Ferreira
Raphael Ferreira 2018년 11월 27일
Okay! I'll look!
Raphael Ferreira
Raphael Ferreira 2018년 11월 27일
편집: Raphael Ferreira 2018년 11월 27일
I can detect it with your code KALYAN ACHARJYA . However the lighting of the image influences a lot. Is there any function or code that leaves the illumination in the uniform image?

댓글을 달려면 로그인하십시오.


SC P
SC P 2018년 11월 29일
How to detect green color variation?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by