Both bounding boxes and polygons describe the location of something in an image. The difference is fidelity — and fidelity has a measurable effect on detection accuracy, false positive rates, and downstream processing.
This article explains when to use each, why it matters, and how to decide based on your actual use case.
Bounding boxes: what they are and when they’re right
A bounding box is an axis-aligned rectangle defined by two corners (or by x, y, width, height). It’s the fastest shape to draw and the most widely supported annotation format.
Use bounding boxes when:
-
The objects are roughly rectangular. A license plate, a document, a product on a conveyor belt. The rectangle captures most of the object with minimal dead space.
-
You’re training an object detector. YOLOv8, Faster R-CNN, SSD, and most detection models expect bounding box annotations. Even if the actual object is irregular, the model learns the class from the box.
-
Speed matters more than precision. Annotating at scale — thousands of images for a training dataset — bounding boxes are 3–5× faster than polygons. For coarse training data, this trade-off is often correct.
-
The background inside the box is acceptable. A bounding box around a standing person includes their legs, the floor under them, and part of the background. For object detection (is a person present?), that’s fine. For segmentation (which pixels are person?), it isn’t.
Polygons: what they are and when they’re right
A polygon is a closed shape with an arbitrary number of vertices that traces the actual boundary of the annotated region.
Use polygons when:
-
The object has an irregular shape that a rectangle misrepresents. A bird seen from above, a vehicle on a road with other objects nearby, a damaged product with a non-rectangular defect. A tight polygon reduces the background included in the annotation.
-
You’re defining detection zones. Zone polygons aren’t training labels — they’re configuration data for a deployed system. A detection zone for an L-shaped corridor must be a polygon; two rectangles are possible but awkward and don’t export cleanly as a single zone.
-
You’re doing instance segmentation. Models like Mask R-CNN and YOLOv8-seg expect polygon masks. The tighter the mask, the better the model learns object boundaries.
-
Spatial precision is critical. A privacy masking zone that must not overlap with a monitored area. A camera coverage boundary that needs to accurately document the field of view. A floor plan room polygon that will be queried by coordinates. In all these cases, a rectangle introduces false area.
The ROI definition use case
Zone definition is the case where polygons are almost always the right choice, even though bounding boxes feel simpler.
Consider a detection zone for a building entrance. The entrance is a trapezoid — wider at the front, narrower at the back, angled to match the camera perspective. Draw a rectangle and you include the wall beside the door and part of the lobby furniture. Draw a polygon and you capture just the doorway geometry.
The consequence: with a rectangular zone, objects detected near the edge of the rectangle — near the wall, near the furniture — generate false alerts. With a polygon that matches the actual geometry, false positives in those areas disappear immediately.
When bounding boxes are fine for zones: If the zone genuinely is rectangular (a window, a square room section, a conveyor segment), use a rectangle. RegionKit’s Rectangle tool is equally capable and the export format is identical.
Practical guidance by task type
| Task | Shape |
|---|---|
| Object detection training (YOLO, SSD) | Bounding box |
| Instance segmentation training (Mask R-CNN) | Polygon |
| Detection zone definition | Polygon (usually) |
| Exclusion zone definition | Polygon |
| Floor plan room boundaries | Polygon |
| Camera coverage boundary | Polygon |
| Tripwire / counting line | Polyline |
| Rectangular product inspection zone | Rectangle |
| License plate region | Rectangle |
Drawing both in RegionKit
RegionKit supports both tools — R for Rectangle, P for Polygon. The workflow is identical: click-to-place anchors, commit with double-click or Enter, edit by dragging vertex handles. Both export to COCO JSON, YOLO TXT, and native JSON.
The native JSON format uses type: "rectangle" and type: "polygon" to distinguish them. In COCO export, both appear as segmentation polygons (rectangles are converted to 4-vertex polygons for format compliance).
Related: How to Define Regions of Interest for Computer Vision · Free Polygon ROI Editor