Clear Filters
Clear Filters

Which one is best for calculating circularity ?

83 views (last 30 days)
Hi all, I need to calculate objects roundness.I am not sure about which of the below ones is the best choice for this purpose.
- R= 4*pi*A/P^2; where A is area in pixels, P is Perimeter.
Thank you for your opinions.particles I need to measure are like this :
RAKESH KUCHANA on 15 Jun 2021
Can you explain code for how to remove small white dot areas (in the red colour bounded areas) in the given image?
Image Analyst
Image Analyst on 15 Jun 2021
@RAKESH KUCHANA, no, not here in Muhammet's 8 year old question (he's probably not interested in your problem), but we will in your new question if you post it.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 22 Aug 2013
Edited: Image Analyst on 15 Jun 2021
I use circularity quite a bit. The formula I use is the inverse of the one you use:
props = regionprops(mask, 'Area', 'Perimeter');
allAreas = [props.Area];
allPerimeters = [props.Perimeter];
circularity = (allPerimeters .^ 2) ./ (4 * pi * allAreas);
so for me the circularity of a circle is 1 and the higher it goes, the less circular it it. For you the lower it goes (closer to zero) the less circular the blob is. You can do it either way.
I don't often use eccentricity because you can get the same eccentricity for a perfectly smooth ellipse as for some tortuous-shaped blob because it fits the perimeter shape to an ellipse. For example an asterisk and a disc might both have the same eccentricity but there is a dramatic difference in shape that is not picked up by eccentricity. Don't use eccentricity unless you know that your blobs are fairly close to ellipses.
Rai_313 on 24 Apr 2015
hi Image Analyst ,
Im would like to ask, why shouldnt we use the haralick circularity?
thank you.
Image Analyst
Image Analyst on 15 Jun 2021
it looks like it's the inverse of the coefficient of variation or the mean radius divided by the standard deviation of the radii = [(mean R) / (stddev R)]. So for a circle, the value is infinity since the standard deviation would be zero. He claims it's more accurate for small, digitized polygons, and that may be true.
I prefer the other definition - what he calls the Rosenfield formula P^2/(4*pi*Area). I like that it's simpler to compute plus it's nicely intuitive in that the value for a circle is 1, not some big undefined number. How big does the number need to be to be circular for Haralick? 10? 100? 1000? I don't know. I guess you could create randomly shaped blobs and compute it both ways and see what values each way produces.
But it comes down to whatever one you want to use. I don't think it's like one is better than another, though Haralick claims his is better for small circles where it's so quantized that it's more octagonal than circular. I mean a circle with a radius of 1 pixel would essentially be a cross + shape, not a circle. So if you have very small blobs then you might use Haralick's formula, though I might counter that comparing blobs based on circularity when the blobs are so tiny they can't really be circular in the first place is not a proper comparison.

Sign in to comment.

More Answers (2)

Amith Kamath
Amith Kamath on 22 Aug 2013
I would do one of the following:
1. Use the 'solidity' option in REGIONPROPS to estimate how 'curvy' the blob is, and solidity is defined as the area/convexArea.
2. Use the 'MajorAxisLength' and 'MinorAxisLength' properties in REGIONPROPS and compare the two. If they are close to equal, the object would be more circular (in most cases).
3. Use 'Area' and 'Perimeter' from REGIONPROPS to estimate circularity in my custom code. may be useful to see.

Shashank Prasanna
Shashank Prasanna on 22 Aug 2013
  1 Comment
Muhammet on 23 Aug 2013
I am not looking for perfect circular objects almost with same radius.Objects are differing both in size,in circularity.Thank you for your concern.

Sign in to comment.


Find more on Linear Algebra in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!