MATLAB: How to extract the area, perimeter for the object present in the image

feature extractionImage Processing Toolbox

i m in need to measure the features like area, perimetr , length, width of the segmented image…. when i used bwarea to find area, it calculates the total area of the image but it wont gives the area of the object in the image….my segmented image is attached below….i want area bounded inside the green boundary and red region the image that image i attached.

Best Answer

You should change your image from gray scale image to a binary image (1, 0) before finding the properties that you want. It is clear that your gray scale image has two main levels of intensities (dark gray and bright gray).
Find the threshold of each gray level and then remove the other parts using morphological filters. Once you got your object in binary then find the properties.
Please refer to the following examples from Matlab:
Hope that helps you.