Shape feature extraction in Matlab

I would like to know how to extract shape features like area,perimeter ,eccentricity,symmetry distance in Matlab.Do i need to convert the colour image into grayscale for doing this calculation.Or is the calculation done in the pre-processed segmented image.

 Accepted Answer

Image Analyst
Image Analyst on 21 Nov 2015
You need to first segment the image to get a binary image then you can call regionprops(). Whether you call rgb2gray() or just extract one of the RGB color channels, or use rgb2hsv() or rgb2lab(), or PCA or something else really depends on your image and what you need to find in it. Post your image(s) if you want more advice.

6 Comments

Aswathy Gopan
Aswathy Gopan on 25 Nov 2015
Edited: Aswathy Gopan on 25 Nov 2015
Thank you for your answer.I have attached the image of which i want to extract the shape features like area, compactness,perimeter .The image is acually segmented one.I have few doubts like when i convert a segmented image from rgb2hsv or rgb2lab,and calculate its area,perimeter etc does it have same value or will the values change for the different colour spaces
Yes, you can try to use a different color space. Then pick the channel which provides the best contrast. Then threshold it and use the techniques I show you how to measure what you need to measure in your images. Do you want to learn how to do it yourself? Or do you want me to do it for you (sorry, I can't)?
Thank you for your comment,i want to do it by my self ,otherwise how come i learn the process.I just need a guidance whenever i am stuck in between.Ok let me try it and i will seek your help if i got any doubt.
I have some color segmentation demos in different color spaces in my File Exchange. You can try one of those and tweak it for your specific color images.
can someone attach the code for shape feature extraction?

Sign in to comment.

More Answers (1)

junnie vix
junnie vix on 21 Mar 2017
I am using SURF to extract shape in matlab. I don't have any idea how to start it. Any helpful guidance or reference?

Community Treasure Hunt

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

Start Hunting!