1.  [](/)
2.  [Glossary](/glossary)
3.  Bounding Box

[Back to Glossary](/glossary)

# What is Bounding Box

## Bounding Box - The rectangle that marks where an object sits in an image or page

A bounding box is the smallest axis-aligned rectangle that encloses an object in an image, a video frame or a document page. It is stored as two corners (x1, y1, x2, y2) or as one corner plus width and height, in pixels or as fractions of the image size. Object detectors, face detectors and document layout models all return bounding boxes, and search systems use them to crop, highlight or filter what was found.

### Formats

*   Corners: (x\_min, y\_min, x\_max, y\_max), used by Pascal VOC and most detection libraries
*   COCO: (x, y, width, height) from the top-left corner
*   YOLO: (x\_center, y\_center, width, height), each divided by the image size so values run from 0 to 1
*   Rotated boxes add an angle, used for text lines and aerial images
*   Converting between formats is the most common source of boxes that land in the wrong place

### Intersection over Union (IoU)

IoU measures how well a predicted box matches a labeled one: the area where they overlap divided by the area they cover together. A predicted box of 100 × 100 pixels shifted 20 pixels right of an identical labeled box overlaps 80 × 100 = 8,000 pixels out of a union of 12,000, so IoU = 0.67. Detection benchmarks count a prediction as correct above a threshold, commonly 0.5; see [mean average precision](/glossary/mean-average-precision).

### Bounding Boxes in Mixpeek

*   The [face identity extractor](https://mixpeek.com/docs/processing/extractors/face-identity) stores a \`bbox\` (x1, y1, x2, y2, width, height) and a detection score with every face it finds in images and video
*   The [document extractor](https://mixpeek.com/docs/processing/extractors/document) stores a \`bbox\` for every layout block of a PDF page (paragraph, table, figure, form) and can render a thumbnail cropped to it
*   Search results carry these boxes, so an application can highlight the matched face or passage instead of showing the whole frame or page

### Common Pitfalls

*   Mixing coordinate formats or origins between a model and the code that draws the boxes
*   Forgetting to rescale boxes after resizing or cropping an image
*   Using axis-aligned boxes for long rotated objects, which then cover mostly background
*   Reporting detection accuracy without the IoU threshold it was measured at

[One-click templatesStart from a templateEach template deploys a working search app on your own files.Browse templates](/templates)

[Put it to work: search your own files](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=glossary_onramp&utm_campaign=mvs_onramp)

### Related Terms

[ACID](/glossary/acid)[API](/glossary/api)[Blob Storage](/glossary/blob-storage)[CLIP](/glossary/clip)[Embedding](/glossary/embedding)