How does the regionprops calculate the area or the eccentricity of an object?

9 次查看(过去 30 天)
Hi,
I have been reading a lot about image segmentation lately and know that some algorithms are based on the region and some are based on the boundary of a pixel.
I am wondering now how the regionprops function in MATLAB calculates the properties of an object and if there is any proper reference paper on the function to learn how the alogrithm of the regionprops work?
With regionprops () circles can be found by calculating the eccentricity or the roundness of an object. Another method is the Hough Transform to detect lines and circles.
What are the advantages for regionprops in comparison to the Hough Transform?

回答(2 个)

DGM
DGM 2024-8-26
If you want to know how regionprops() works, open it up and look.
Unlike bwarea(), regionprops() calculates the simple unweighted area, which is simply the total number of pixels in the connected group.
Eccentricity is derived from the major and minor radii of the blob:
eccentricity = 2*sqrt((Rmaj)^2 - (Rmin)^2)/Rmaj;

Image Analyst
Image Analyst 2024-8-26
Not sure how I missed your question 5 years ago, but anyway I don't think you'd use hough() anymore. You'd use imfindcircles, though in my experience it's not so robust. It seems to miss a lot of circles. But it seems to be for people who are mainly interested in finding circles. You can then visualize the circles by showing them in the overlay above your image with viscircles. imfindcircles() doesn't measure a bunch of stuff like regionprops, it just measures radii and center locations of the circles it found.
On the other hand, regionprops is if you already have a segmented image (a binary image mask gotten though thresholding or some other means) and you want to make measurements of what's there. It can find the equivalent circular diameter of the blobs, as well as the area, perimeter, intensity, Feret diameters, centroid locations, and lots of other things all in one single function call.
Like @DGM said, regionprops()'s area is a simple pixel count while bwarea measures the areas of blobs by taking into account the shape of the boundary, so a diagonal edge might take up a half pixel instead of a full pixel area. This is possibly what you meant when you said (somewhat unclearly) "that some algorithms are based on the region and some are based on the boundary of a pixel".

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by