An axis-aligned bounding box has a hidden assumption baked into it: that whatever you are detecting is roughly upright. On a real inspection line that assumption breaks constantly. Parts arrive rotated in a feeder, a component sits at a slight tilt after placement, a scratch runs diagonally across a housing. When you draw a rectangle whose sides are locked to the image axes around any of those, you either swallow neighbouring geometry or clip the target — and both corrupt the measurement the reject decision downstream depends on. An oriented bounding box (OBB) fixes exactly this problem. It carries an angle, so the box rotates to hug the object regardless of how the part landed under the camera. A tilted solder joint, a rotated connector, a diagonal crack — each gets localised tightly, without dragging in background pixels that inflate the defect signal. That is the whole difference, and on a densely packed board it is the difference between a defect count that holds and one that drifts the moment packaging orientation changes. How should you think about an oriented bounding box in practice? A standard detector predicts four numbers per object: the centre coordinates (or two corners) plus a width and height. Those four numbers describe a rectangle that is always parallel to the image edges. An OBB detector predicts a fifth quantity — a rotation angle — so the box is described by centre, width, height, and orientation. In practice that means the model is no longer forced to approximate a rotated part with an over-large upright rectangle; it can lay the box down along the part’s actual major axis. The consequence matters most where geometry is tight. Consider a rotated capacitor sitting between two others on a PCB. An axis-aligned box tight enough to cover the capacitor’s diagonal extent will overlap its neighbours; a box that avoids the neighbours will clip the capacitor. Neither is a clean localisation. An oriented box aligned to the capacitor’s body avoids both failure modes at once. When we build inspection models on lines where parts do not arrive in a fixed orientation, this is usually the first structural decision — long before threshold tuning or augmentation strategy. The angle is not free. It adds a regression target that the training data has to actually support, and it introduces a well-known headache: rotation is periodic, so a box at 89 degrees and a box at −91 degrees can describe nearly the same rectangle while looking numerically far apart to the loss function. Modern OBB heads in frameworks like Ultralytics YOLO handle this with angle-aware loss formulations and representations that avoid the discontinuity at the wrap-around point. You do not have to implement that yourself, but you do have to know it exists, because it explains why an OBB model sometimes behaves oddly near the ±90-degree boundary if the training set under-samples those orientations. How OBB differs from an axis-aligned box, and how the angle is represented The cleanest way to see the difference is to look at what each representation can and cannot express. Property Axis-aligned box (AABB) Oriented box (OBB) Parameters per object 4 (centre x/y, width, height) 5 (centre x/y, width, height, angle) Aligned to Image axes, always Object’s own major axis Rotated part Over-covers or clips Hugs the part Background pixels captured High for tilted objects Low IoU on rotated targets Degrades with tilt Stable across tilt Compute / label cost Lower Higher (rotated labels, angle regression) Comparison of axis-aligned and oriented box representations; the trade-offs are structural, not benchmarked — the right choice is set by how parts present under the camera. Angle representation is where implementations vary. Some encode the angle directly in radians over a defined range (commonly −π/2 to π/2 for a “long-edge” convention). Others avoid the periodicity problem by regressing a Gaussian or by predicting the box as a set of ordered corner offsets. The DOTA aerial-imagery benchmark popularised much of this work, and its conventions leaked into general-purpose OBB heads, which is why you will see the long-edge definition show up in tooling that has nothing to do with satellites. For an AOI pipeline the specific encoding matters less than consistency: the annotation tool, the training loss, and the evaluation metric must all agree on how the angle is defined, or your reported accuracy will be quietly wrong. When does an AOI line actually need OBB versus a standard detector? Not every line needs oriented boxes, and adding the angle target where it earns nothing just costs you label effort and a slightly harder training problem. The decision is about how parts and defects present, not about wanting the more sophisticated tool. Use this rubric before committing: Do parts arrive at arbitrary or variable rotation? If a feeder, tray, or conveyor delivers components in a fixed orientation every time, an axis-aligned detector is often enough. If rotation varies — even within a bounded range — OBB earns its keep. Are targets elongated? Long, thin objects (scratches, solder bridges, wire runs, connectors) suffer most from axis-aligned over-coverage when tilted. Roughly square defects care far less about the angle. Is the scene densely packed? Overlap between an over-large upright box and adjacent parts is the mechanism that corrupts the count. On sparse scenes the overlap rarely happens, so the axis-aligned approximation is harmless. Does a downstream measurement depend on the box geometry? If you only need a present/absent signal, tight localisation matters less. If the box feeds a size measurement, an angle check, or a per-component defect tally, geometry accuracy propagates directly into the decision. If you answered yes to the first three, OBB is likely the right call. If parts are fixed-orientation and sparse, resist the temptation — you would be paying for rotation the line never produces. This is the same judgment we apply when choosing a detector architecture that survives production: the fanciest option is not the reliable one; the one matched to how the line actually behaves is. Where OBB sits in the AOI pipeline, between capture and reject Oriented detection is one localisation stage inside a longer chain, and it is worth being precise about where. Image capture and lighting come first — an OBB head cannot recover an angle the optics never resolved. Detection sits next: the model consumes the frame and emits oriented boxes with class labels and confidence scores. Those boxes then feed the measurement and decision logic — counting defects per component, comparing localised regions against tolerance, aggregating into a board-level pass/fail — which finally drives reject actuation. The angle is not only a localisation nicety at that middle stage; it can be a signal in its own right. A component detected at an unexpected orientation may itself be the defect — a misplaced or rotated part. That overlaps with dedicated component-orientation checks that pose estimation handles in PCB AOI, and in a mature line the two approaches complement each other: OBB gives you a fast, coarse angle as a by-product of detection, while pose estimation resolves finer placement questions where they matter. Where you also need the defect region to persist across frames as the board moves, that hands off to the object trackers running in line-side inspection, which carry identity and geometry between successive captures. The broader point is that OBB is a localisation decision embedded in a reliability pipeline, not a standalone accuracy win. How that pipeline earns a defensible reject decision is the subject of our production-AI reliability practice, and OBB is one of the earliest choices that either supports or undermines everything measured after it. How switching to oriented boxes changes the defect count and false-reject rate Here is the effect that surprises teams the first time they see it. On densely packed boards, moving from axis-aligned to oriented boxes tends to reduce the false-reject rate, because a large share of false rejects on those boards come from box overlap — an upright box around a tilted part touches a neighbour, the overlap trips a proximity or size rule, and a good board gets kicked. Tighten the boxes and that class of false reject largely disappears (an observed pattern across rotated-part inspection work, not a benchmarked rate; the size of the effect depends heavily on board density and the specific reject logic). The deeper consequence is stability. An axis-aligned detector on rotated parts produces a defect count that is a function of orientation — change the packaging layout or the conveyor angle, and the same physical boards yield a different count because the overlap pattern shifted. That is the drift the parent reliability hub cares about: a metric that moves for reasons unrelated to actual quality. Oriented boxes decouple the count from presentation angle, which is what lets the false-reject and escape rates stay comparable across production changes. What has to be re-validated when a model moves to OBB? The catch is that this improvement is a change to the measurement, and any change to the measurement has to be re-validated or the release criterion becomes a lie. When a detector switches from axis-aligned to oriented boxes, the defect-count distribution shifts — usually favourably, but differently — and the thresholds that were calibrated against the old distribution no longer mean what they used to. At minimum, the validation pack has to pin and regression-test: the OBB IoU metric (rotated IoU, not the axis-aligned version, or the numbers are incomparable), the recalibrated confidence and proximity thresholds, the defect-count distribution on a fixed reference set before and after the switch, and the behaviour near the ±90-degree angle boundary where OBB models are most fragile. Anchoring these into an industrial-CV validation lens is what keeps the release criterion honest across the change — a switch from axis-aligned to oriented boxes is precisely the kind of localisation decision the validation artefact exists to freeze and re-run. This is also why we treat detector changes with the same care as fine-tuning a YOLO model for PCB AOI: the model got better, but the evidence that it is safe to ship has to be regenerated, not inherited. FAQ How does oriented bounding box actually work? An OBB detector predicts a rotation angle in addition to the usual centre, width, and height, so the box aligns to the object’s major axis instead of the image axes. In practice this lets a rotated part be localised tightly without swallowing neighbouring geometry or clipping the target — which is the first structural decision on lines where parts do not arrive in a fixed orientation. How does an oriented bounding box differ from an axis-aligned bounding box, and how is the rotation angle represented? An axis-aligned box uses four parameters and is always parallel to the image edges; an oriented box adds a fifth parameter, the angle, and rotates to hug the part. The angle is commonly encoded in radians over a defined range (a “long-edge” convention is typical), though some implementations regress corner offsets or a Gaussian to avoid the discontinuity where the angle wraps around. What matters most is that the annotation tool, training loss, and evaluation metric all agree on the convention. When does an AOI line actually need OBB detection versus a standard axis-aligned detector? OBB earns its keep when parts arrive at variable rotation, targets are elongated (scratches, solder bridges, connectors), and the scene is densely packed so box overlap can corrupt the count. If parts are fixed-orientation and the scene is sparse, an axis-aligned detector is usually enough, and adding the angle target just costs label effort for no gain. Where does oriented bounding box detection sit in the AOI pipeline, between image capture and reject actuation? It is the localisation stage: capture and lighting come first, the OBB head then emits oriented boxes with classes and confidences, and those boxes feed the measurement and decision logic that drives reject actuation. The angle can also be a signal in itself — an unexpected orientation may be the defect — which is where OBB complements dedicated pose-estimation and tracking stages. How does switching from axis-aligned to oriented boxes affect the defect count and false-reject rate on densely packed boards? On dense boards it tends to lower the false-reject rate, because much of that false-reject volume comes from upright boxes overlapping neighbouring parts and tripping proximity rules; tighter oriented boxes remove that class of error. It also stabilises the count against presentation changes — the same physical boards no longer yield different counts when packaging or conveyor angle shifts. What has to be re-validated when an inspection model moves to OBB, so the release criterion stays honest? The switch changes the measurement, so the validation pack must re-pin the rotated IoU metric, the recalibrated confidence and proximity thresholds, the before-and-after defect-count distribution on a fixed reference set, and the model’s behaviour near the ±90-degree angle boundary. Without regenerating that evidence, thresholds calibrated on the old distribution silently stop meaning what the release criterion assumes. If your line runs rotated parts today on axis-aligned boxes, the question worth asking is not whether OBB would localise better — it almost certainly would — but whether your validation package can still tell a true quality change from a change in how boxes now overlap. The compound-failure-mode framing behind that question is where the computer-vision reliability requirements start, and it is the part that decides whether the improvement is safe to sign.