Image & Point Cloud Fundamentals · Fundamentals

What is a Bounding Box?

A bounding box is a rectangle that gives an object a compact image location. Learn its common coordinate formats, what information it preserves, and how Telekinesis represents boxes.

An AMR may need to know where a pallet appears in its camera image before it can slow down or inspect the scene more closely. A bounding box provides that approximate location with only four numbers.

1. What is a Bounding Box?

A 2D bounding box is the smallest—or simply a chosen—rectangle used to describe where an object appears in an image. Most detectors return axis-aligned boxes, whose sides remain parallel to the image edges.

A component enclosed by a two-dimensional bounding box

The same rectangle is commonly written in three formats:

FormatFour valuesMeaning
XYXY(x1,y1,x2,y2)(x_1,y_1,x_2,y_2)Top-left and bottom-right corners
XYWH(x1,y1,w,h)(x_1,y_1,w,h)Top-left corner, width, and height
CXCYWH(cx,cy,w,h)(c_x,c_y,w,h)Centre, width, and height

x1x_1 and y1y_1 locate the top-left corner, x2x_2 and y2y_2 locate the opposite corner, cxc_x and cyc_y locate the centre, and ww and hh are the width and height. Always state the format: the tuple [100, 80, 40, 30] describes different rectangles under XYXY and CXCYWH.

1.1 What a Box Preserves—and What It Loses

A box is compact. It can crop an image, associate a category with a region, or tell another model where to inspect. But every pixel inside the rectangle is not necessarily part of the object. Background appears around angled or irregular shapes, and overlapping boxes do not prove that objects touch in 3D.

RepresentationBest used for
Bounding boxApproximate location and extent
Binary maskExact selected pixels
KeypointOne meaningful image position
6D poseObject position and orientation in 3D

For an industrial arm, a box can nominate a component but rarely defines a safe grasp. Segmentation, depth, calibration, and collision checks must add the missing geometry.

1.2 Comparing Two Boxes

Detectors are often evaluated with intersection over union:

IoU(A,B)=∣A∩B∣∣A∪B∣.IoU(A,B)=\frac{|A\cap B|}{|A\cup B|}.

AA and BB are two box regions, ∣A∩B∣|A\cap B| is their overlapping area, and ∣A∪B∣|A\cup B| is the total area covered by either box. An IoU of 1 means identical boxes; 0 means no overlap. IoU measures image overlap, not category correctness or grasp accuracy.

2. Bounding Boxes in Telekinesis

Telekinesis uses datatypes.Box2D for one axis-aligned box. Its native format is [cx, cy, width, height], or CXCYWH.

from telekinesis import datatypes

box = datatypes.Box2D([320, 240, 180, 120])

print(box.center)      # [320, 240]
print(box.dimensions)  # [180, 120]
print(box.area)        # 21600

When another system uses corner coordinates, construct or export the box explicitly with from_xyxy(), from_xywh(), as_xyxy(), or as_xywh(). Explicit conversion prevents one of the most common detection-integration errors.

3. Where to Go Next