modify this code to detect yellow colour

89 views (last 30 days)
Faizal
Faizal on 1 Apr 2011
Answered: Image Analyst on 17 Mar 2017
where should I modify to get the result of yellow colour
http://www.codeproject.com/Questions/83784/Matlab-colour-detection.aspx
please anyone show to me

Answers (3)

Jan
Jan on 1 Apr 2011
What is "yellow"? A color with high red and green components:
yellow_redThreshold = 200;
yellow_greenThreshold = 200;
yellowMask = (redBand > yellow_redThreshold) & ...
(greenBand > yellow_greenThreshold);
Perhaps you want a low blue component also?
...
yellow_blueTreshold = 100;
yellowMask = (blueBand < yellow_blueTreshold) & ...
(redBand > yellow_redThreshold) & ...
(greenBand > yellow_greenThreshold);
I'd prefer the HSV color space to determine a color.
  2 Comments
Jan
Jan on 6 Apr 2011
@paf CEO: Your message is actually not a commant to my answer. Please open a new thread for a new question.

Sign in to comment.


manasi bharambe
manasi bharambe on 26 Mar 2016
In the similar manner, how can I modify the above given code to detect orange colour in the image. please help
  2 Comments
Abdou dgm
Abdou dgm on 17 Mar 2017
please can you change the code to get the yellow color or tell us how to use hsv methode to get the yellow.

Sign in to comment.


Image Analyst
Image Analyst on 17 Mar 2017

Community Treasure Hunt

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

Start Hunting!