Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

image segmentation and extraction

Asked by pradeep on 21 Jan 2013

Hello! I am working on a project that involves classification of objects based on color. Assuming there are 5 objects in the captured image, please give me an idea as to how I can do the following: 1) How can I extract just the objects alone individually? (That is, without any image background) 2) How can I extract the RGB values of each of these objects in the image?

Thanks a lot!

1 Comment

Image Analyst on 21 Jan 2013

You forgot to tell us where you uploaded your image to.

pradeep

Products

No products are associated with this question.

2 Answers

Answer by Image Analyst on 21 Jan 2013
Accepted answer

You may not need to do color segmentation to do that. It may be possible to just convert to grayscale and do the standard things (like in Walter's answer). If you want to do color segmentation, you can see the demos I've uploaded to my File Exchange http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862, but like I said, you may not need to get that sophisticated, depending on what your image looks like. If it's really simple with well separated high contrast colors then you can use Walter's method. You might also call rgb2ind() and see what kind of classification that provides to you. I can't really say much more without seeing the range of images you expect to encounter, so upload some if you want more advice.

2 Comments

pradeep on 13 Feb 2013

sorry Mr.Image Analyst, i dint find the way to upload those images please guide me how can i proceed...

Image Analyst
Answer by Walter Roberson on 21 Jan 2013

Threshold. bwlabel. regionprops. Index into the original image.

0 Comments

Walter Roberson

Contact us