squareness
cellseg_gsontools.geometry.squareness(polygon, **kwargs)
¶
Compute the squareness of a polygon.
Note
Squareness is a measure of how close an object is to a square.
Squareness:
where is the area of the polygon and is the perimeter of the polygon.
Note
For irregular shapes, squareness is close to zero and for circular shapes close to 1.3. For squares, equals 1
Parameters:
Name | Type | Description | Default |
---|---|---|---|
polygon |
Polygon
|
Input shapely polygon object. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The squareness value of a polygon. |