VolkerH / np_obb

Calculate oriented bounding boxes for label images in python
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

implementation in shapely #12

Open VolkerH opened 8 months ago

VolkerH commented 8 months ago

Just noted that shapely now contains methods minimum_rotated_rectangle and oriented_envelope which at first look solve the same problem: https://shapely.readthedocs.io/en/maint-2.0/reference/shapely.oriented_envelope.html

Computes the oriented envelope (minimum rotated rectangle) that encloses an input geometry, such that the resulting rectangle has minimum area.

Unlike envelope this rectangle is not constrained to be parallel to the coordinate axes. If the convex hull of the object is a degenerate (line or point) this degenerate is returne