mt.skimage.poly_approx

Approximates a polygon with an axis-aligned rectangle.

Functions

  • poly2rect(): Approximates a polygon with an axis-aligned rectangle by minimising the mean of point-to-polygon distances of all points on the rectangle.

mt.skimage.poly_approx.poly2rect(poly)

Approximates a polygon with an axis-aligned rectangle by minimising the mean of point-to-polygon distances of all points on the rectangle.

Parameters:

poly (numpy.array) – a list of 2D points forming a single polygon

Returns:

rect – a 2D rectangle with integer coordinates

Return type:

mt.geo.rect.Rect