How to get the dimensions of objects after image processing?

1 view (last 30 days)
Hi everyone, I'm a newbie to MatLab and i need to get the dimensions(width & hight) of colored labeled objects. How to do so? attached an image of detected objects in my project. another question, do i need to fill holes to have a perfect rectangles to have exact dimentions?
thanks in advance.

Accepted Answer

Walter Roberson
Walter Roberson on 14 Nov 2015
See regionprops(), in particular BoundingBox and Area .
Notice, though, that your blobs are not aligned vertically or horizontally. You might want to ask regionprops for the Orientation and then imrotate() the blob by the negative of that in order to align it and then regionprops() the result to get the height and width.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!