circularity
cellseg_gsontools.geometry.circularity(polygon, **kwargs)
¶
Compute the circularity of a polygon.
Note
Circularity (sometimes roundness) is the ratio of the area of an object to the area of a circle with the same convex perimeter. Circularity equals 1 for a circular object and less than 1 for non-circular objects. Note that circularity is insensitive to irregular boundaries. - Wirth
Circularity: $$ \frac{4 \times \pi A_{poly}}{P_{convex}^2} $$
where \(A_{poly}\) is the area of the polygon and \(P_{convex}\) is the perimeter of the convex hull.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
polygon |
Polygon
|
Input shapely polygon object. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The circularity value of a polygon between 0-1. |