Group object by color

Hi everybody, I want to label together the candy with the same color. The user with ginput select a point in the image, if it correspond to one of the candies I need to show all the candy with the same color.
I was able to find the point that I will call x,y .
I was also able to label the entire image but not to label by color.
The only problem is to identify the object with the same color, I can do the rest. Can you help me? This is the image.

回答(1 个)

Image Analyst
Image Analyst 2018-10-11

0 个投票

Try rgb2ind() to do a rough labeling of the different colors.
Or try kmeans (demo attached.)

类别

帮助中心File Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

提问:

2018-10-11

编辑:

2018-10-21

Community Treasure Hunt

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

Start Hunting!

Translated by