panel_segmentation.utils.standardizeRectangleWidth#

panel_segmentation.utils.standardizeRectangleWidth(polygon, target_width)[source]#

Adjust a rectangular polygon to have a standardized width while maintaining its center position, orientation, and length.

Parameters:
  • polygon ((shapely.geometry.Polygon)) – Rectangular polygon that has a non-standardized width (tracker row or fixed-tilt row)

  • target_width ((float)) – target width of the row. Normally determined via finding the median row width across all masks.

Return type:

Shapely polygon representing the newly standardized rectangle mask