Categorizing all the color shades into specific colors
6 views (last 30 days)
Show older comments
I want to separate the regions of a specific color in an image (e.g. 'peppers.png') to separate matrices and draw a bounding box around those regions. The colors are red, green, blue, orange, yellow, purple/pink, silver/gray, white, black.
Now the problem I am having is that, for example, what I mean by red is not a single RGB value. Rather I want to select all possible colors that a human could think of as red. Same goes for all the other mentioned colors. I am unable to determine that range.
Separating those regions into separate matrices and draw the bounded boxes are the next steps. Currently I am stuck at determining the ranges of colors. How to select all those color shades for a specific color? What are the ranges that should be selected?
0 Comments
Answers (2)
Walter Roberson
on 16 Aug 2017
The way to select those color shades for a specific color is to have a really rather big lookup table, with well over 1 million entries.
Image Analyst
on 16 Aug 2017
First define/select your colors. Maybe paint something in Photoshop with the colors you want. So now you have 9 RGB triplets. Convert those into lab with rgb2lab. Also convert the images. Then get the Delta E image with sqrt(). So now you'll have 9 delta E images representing the color difference from each of the 9 colors for every pixel in the image. Then assign the color class to the color that is closest.
Or you can let rgb2ind() do it if you pass in the colormap.
See Also
Categories
Find more on Orange in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!