calculating circumference of an open ended object in a skeletonized binary image

2 views (last 30 days)
I have a question regarding the regionprops function. Can it be used to accurately measure the circumference of an open ended object? As an example to illustrate the problem I am facing , let us say I want to compare the length of an object of the shape 'C' and another object of the shape 'O' (similar diameters, thickness is negligible). when I do regionprops and get perimeters, I find that the perimeter of C is more than perimeter of O. I am interested in extracting only the outer circumference/perimeter of the objects .. in which case, the perimeter of 'C' should be half of the perimeter of 'O'. If regionprops does do the trick, I need advice on how to approach this problem. Thank you very much!

Accepted Answer

Image Analyst
Image Analyst on 23 Jun 2018
Simply sum the pixels, if your image consists of only that object:
cPerimLength = sum(cImage(:));
oPerimLength = sum(oImage(:));
That may be good enough. If it's not, explain why.
  3 Comments
Image Analyst
Image Analyst on 23 Jun 2018
Well you could just get the areas of each blob
props = regionprops(binaryImage, 'Area');
allAreas = [props.Area];
Indexing is from top to bottom then left to right as you encounter blobs across the image.
Image Analyst
Image Analyst on 23 Jun 2018
Use bwconvhull() to get the convex hull of each blob. Then pass that image in to regionprops() and ask for perimeter or area.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!