A robot detector places a box around an object. Its center can coincide with a reference box while its covered region differs substantially. Conversely, a displaced center can still belong to a box with considerable overlap.

Intersection over union, usually abbreviated IoU, describes that region overlap. Center distance describes the separation between two selected points. Neither number can be substituted for the other without changing the localization question.

The examples below use invented rectangles. They are geometric calculations, not detector outputs, robot accuracy measurements, or evaluation acceptance criteria.

Define the coordinate convention first

Represent an axis-aligned box as (x_min, y_min, x_max, y_max), with strictly positive width and height. Coordinates identify rectangle edges on a continuous image-coordinate plane.

Use area = (x_max − x_min)(y_max − y_min). Equivalently, integer-aligned coordinates can describe half-open pixel regions with these edge positions. Do not add one to either dimension under this convention.

For two boxes, intersection width is the larger of zero and min(x_max values) minus max(x_min values). Intersection height follows the corresponding y expression.

Multiply those two nonnegative lengths to obtain intersection area I. If the box areas are A and B, their union area is A + B − I. Their IoU is:

I/(A + B − I).

The positive-area assumption avoids a zero-area denominator. Degenerate boxes and differing coordinate conventions need their own treatment.

What the primary references establish

Torchvision's version 0.24 box_iou documentation describes pairwise intersection-over-union values for boxes and identifies supported coordinate formats. That API description does not report a detector's classification correctness.

The original Microsoft COCO paper, version 3 revised February 21, 2015, uses a bounding-box overlap condition in its historical detection/segmentation evaluation discussion. The paper also distinguishes box overlap from detailed segmentation quality.

Those references establish the metric's role. The rectangles and thresholds that follow are independently constructed, and no evaluation package is executed.

Identical centers can conceal very different sizes

Choose a reference R = (0, 0, 10, 10). Its area is 100 square coordinate units and its center is (5, 5).

Consider a small predicted box P_small = (4, 4, 6, 6). Its center is also (5, 5), so center distance is zero. It lies wholly inside R and has area four.

Intersection is four and union is 100. IoU is 0.04.

Now consider P_large = (−5, −5, 15, 15). Its center remains (5, 5), but its area is 400. It wholly contains R, so intersection is 100 and union is 400. IoU is 0.25.

Both center distances are zero, yet their IoUs differ. Neither predicted region equals the reference. A perfect center match does not establish a correct box extent.

A displaced center can overlap much more

Translate the reference two units right to obtain P_shift = (2, 0, 12, 10). Its center is (7, 5), two units from the reference center.

The overlapping region has width eight and height ten, so intersection is 80. Union is 100 + 100 − 80 = 120. IoU is 80/120, or approximately 0.666667.

This shifted box overlaps the reference much more than either concentric size-mismatch example, despite its nonzero center error.

For another prediction, use (6, 4, 8, 6). Its center is also (7, 5), giving exactly the same two-unit center distance. Its area is four and it is contained in R, so its IoU is only 0.04.

The same center distance therefore does not determine overlap, even when the reference remains fixed.

Shape makes displacement direction matter

Use a separate thin reference box T = (0, 0, 10, 1), with area ten.

Shift it two units horizontally. Intersection area is eight and union area is twelve, giving IoU two-thirds.

Instead shift it two units vertically. The two boxes do not overlap, so IoU is zero. Both translations move the box center by exactly two units.

An isotropic center-distance value treats those displacements equally. The overlap calculation responds to the box's different width and height.

A square-box intuition should consequently not be assumed to describe narrow tools, long parts, or other elongated image regions. This is a statement about declared box geometry, not a claim about detection performance on those objects.

Translate a threshold into geometry only under stated assumptions

For two equal squares of width w, aligned vertically and separated horizontally by d with 0 ≤ d ≤ w, intersection area is w(w − d). Union area is w(w + d).

Their IoU simplifies to (w − d)/(w + d).

Under an invented rule requiring IoU at least tau, solving the inequality gives:

d ≤ w(1 − tau)/(1 + tau).

For w = 10 and tau = 0.5, the bound is approximately 3.333333 coordinate units. For tau = 0.75, it is approximately 1.428571.

These are consequences of equal size and one-axis translation. They are not general conversions from IoU to center distance. Changing width, height, orientation, or relative size changes the relationship.

A box that merely touches another along an edge has zero intersection area in this convention. Counting a touching edge as one extra pixel would silently introduce a different area definition.

Scale and semantic meaning remain separate

Multiply every coordinate in both boxes by the same positive factor. Intersection and union areas scale by its square, leaving IoU unchanged. Center distance scales by the factor.

Thus IoU is dimensionless, while center distance needs coordinate units. Neither is automatically a physical millimeter error without a camera geometry model.

A high IoU also does not establish the correct object category, correspondence, or detailed object boundary. Two overlapping boxes can refer to different annotations, and a box includes background as well as foreground.

Matching several predictions to several references introduces additional evaluation rules. The pairwise metric does not select that matching policy by itself.

For robot perception records, preserving the edge convention, reference region, box format, and intended matching rule makes the overlap number interpretable. The original rectangles show the practical boundary: a center says where one point lies; IoU says how two declared regions overlap.

Sources checked October 23, 2026

Torchvision 0.24, torchvision.ops.box_iou, versioned official API:

https://docs.pytorch.org/vision/0.24/generated/torchvision.ops.box_iou.html

Lin and coauthors, Microsoft COCO: Common Objects in Context, arXiv 1405.0312v3, revised February 21, 2015, original paper:

https://arxiv.org/html/1405.0312v3

All coordinates and threshold calculations are original hypothetical examples. No detector, evaluation library, or robot was tested.

Illustration note: An accompanying generic robot vision scene is a concept illustration. It does not show annotated evaluation boxes, a measured IoU score, or validated localization performance.