How to segment out r,g,b values of different objects of an single image

I have an rgb image with multiple objects in the image. I want to classify the objects based on color properties. So I need the rgb color values of the objects differently for different objects. please tell me how to segment out the rgb values of the objects and store them with different label under a structure.

Answers (2)

Convert to grayscale, figure out where the object boundaries are, regionprops() asking for the pixel list for each object, index the RGB image at the pixel list.
You can use color classification, like my demos show: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Of you could try to convert to grayscale with rgb2gray() or rgb2ind() and then use imquantize() and then call regionprops().
Or you could try to classify with the color frequency image: http://www.mathworks.com/matlabcentral/fileexchange/28164-color-frequency-image

Asked:

on 6 Apr 2013

Community Treasure Hunt

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

Start Hunting!