Categorizing all the color shades into specific colors

1 回表示 (過去 30 日間)
Ek Ehsaas
Ek Ehsaas 2017 年 8 月 16 日
コメント済み: Ek Ehsaas 2017 年 8 月 16 日
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?

回答 (2 件)

Walter Roberson
Walter Roberson 2017 年 8 月 16 日
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 件のコメント
Ek Ehsaas
Ek Ehsaas 2017 年 8 月 16 日
Thanks. That's an interesting post that you linked. I'll try to use the dataset that is available there

サインインしてコメントする。


Image Analyst
Image Analyst 2017 年 8 月 16 日
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.
  1 件のコメント
Ek Ehsaas
Ek Ehsaas 2017 年 8 月 16 日
Thanks. I'll try your suggestions

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOrange についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by