Oriented bounding box (OBB)

An oriented bounding box (OBB) is a rectangle rotated to follow an object's orientation, described by a center, width, height and angle or by four corner points. It encloses long or tilted objects with far less background than an axis-aligned box.

AnnotationAlso called rotated bounding box, rotated box

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

EncodingValuesUsed by
Center, size, anglecx, cy, w, h, θMany detector heads and training libraries
Four cornersx1 y1 x2 y2 x3 y3 x4 y4DOTA 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.

Frequently asked questions.

What is the difference between a bounding box and an oriented bounding box?

A bounding box is axis-aligned, so around a tilted object it takes in a lot of background. An oriented bounding box rotates with the object and is described by a center, width, height and angle, or by four corner points.

When should I use oriented bounding boxes?

For long or tilted objects packed close together, such as ships, vehicles and buildings in aerial images, text lines or parts on a conveyor, where axis-aligned boxes would overlap and cover mostly background.