When a rotated box pays off
An axis-aligned bounding box around a ship seen diagonally from above is mostly water, and the boxes of ships moored side by side overlap heavily. A rotated box hugs each hull. That matters most in aerial and satellite imagery (vehicles, ships, aircraft, buildings), for lines of text in photos and scans, and for parts or parcels lying at random angles on a conveyor.
Two ways to store one
| Encoding | Values | Used by |
|---|---|---|
| Center, size, angle | cx, cy, w, h, θ | Many detector heads and training libraries |
| Four corners | x1 y1 x2 y2 x3 y3 x4 y4 | DOTA labels; the YOLO OBB format stores them normalized |
The two describe the same rectangle, but converting between them is where most bugs hide.
Angle traps
- The same box has several descriptions: rotating by 90° and swapping width and height gives an identical rectangle. Libraries pick different angle ranges and different conventions for which side is the width.
- Degrees or radians, clockwise or counterclockwise, image y pointing down: check all three when moving labels between tools.
- The order of the four corners matters to some formats; a box with its corners out of order may load as a crossed shape.
- Overlap metrics need polygon intersection, so IoU for rotated boxes is slower and differs from axis-aligned IoU.
Oriented boxes in Supervisely
The image labeling toolbox has a rotated box that turns with the object and exports to DOTA, one of the formats listed on the data curation page. For shapes a rectangle cannot follow at all, a polygon is the next step up.