rectangularity
cellseg_gsontools.geometry.rectangularity(polygon, **kwargs)
¶
Compute the rectangularity of a polygon.
Note
Rectangularity is the ratio of the object to the area of the minimum bounding rectangle. Rectangularity has a value of 1 for perfectly rectangular object.
Rectangularity: $$ \frac{A_{poly}}{A_{MRR}} $$
where \(A_{poly}\) is the area of the polygon and \(A_{MRR}\) is the area of the minimum rotated rectangle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
polygon |
Polygon
|
Input shapely polygon object. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The rectangularity value of a polygon between 0-1. |