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.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 21 Nov. 2015

0 Stimmen

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 Kommentare

Aswathy Gopan
Aswathy Gopan am 25 Nov. 2015
Bearbeitet: Aswathy Gopan am 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
Image Analyst
Image Analyst am 25 Nov. 2015
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)?
Aswathy Gopan
Aswathy Gopan am 25 Nov. 2015
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.
Image Analyst
Image Analyst am 25 Nov. 2015
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.
Dileep Kumar Kothamasu
Dileep Kumar Kothamasu am 17 Mär. 2018
can someone attach the code for shape feature extraction?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

junnie vix
junnie vix am 21 Mär. 2017

0 Stimmen

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!

Translated by