mark the region from point set

2 views (last 30 days)
Hung Tran
Hung Tran on 13 Apr 2014
Answered: Image Analyst on 13 Apr 2014
I have a binary image and I want to compute the object in it, so I mark the boundary by using contour in matlab, but the contour matrix when I plot again isn match. can u explain why? Is there a way to extract an object from the image ( I mean coordinate) so I can compute it?

Answers (1)

Image Analyst
Image Analyst on 13 Apr 2014
I don't know what you mean. Using contour() could possibly give several nested objects. Do you want characteristics of each level of nesting? If you just want areas, you can do that simply using histograms. If you want other things like shape you'll have to get the contours and use poly2mask(). Certainly not the normal type of thing to do.
And exactly what coordinates do you want? Just the perimeter like you'd get with bwboundaries() or find(bwperim())? Or the coordinates of all the interior points as well?
And what do you mean that you want to "compute it" (meaning the object or coordinates - it's not clear)??? Compute what exactly? If you've extracted the coordinates you already have them - there's nothing left to compute. You can computer other things like circularity but you haven't specified what.
Perhaps you'd better just step through my Image Segmentation tutorial first http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 to get an understanding of how segmentation and measurement of blobs work. It's just a normal, basic kind of image segmentation that you do 99% of the time. Then come back with any questions you may have, and be sure to attach your image and m-file.

Community Treasure Hunt

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

Start Hunting!