Categorizing all the color shades into specific colors

6 Ansichten (letzte 30 Tage)
Ek Ehsaas
Ek Ehsaas am 16 Aug. 2017
Kommentiert: Ek Ehsaas am 16 Aug. 2017
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?

Antworten (2)

Walter Roberson
Walter Roberson am 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.
  1 Kommentar
Ek Ehsaas
Ek Ehsaas am 16 Aug. 2017
Thanks. That's an interesting post that you linked. I'll try to use the dataset that is available there

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 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.

Community Treasure Hunt

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

Start Hunting!

Translated by