panel_segmentation.utils.getRectangleDimensions#

panel_segmentation.utils.getRectangleDimensions(polygon)[source]#

Calculate the width and length of a rectangular polygon. Returns the two edge lengths and their orientations.

Parameters:

polygon ((shapely.geometry.Polygon)) – Rectangular polygon that we want to calculate the width, length, and associated angles for

Returns:

Dictionary object with fields for the width, length, and associated angles of the mask. If not a rectangle, returns None

Return type:

dictionary or None