Categorizing all the color shades into specific colors
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (2개)
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.
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!