Computer vision · 7 min read
Traditional computer vision vs deep learning, when a threshold is enough and when the line needs a model
A colour threshold checks caps until the lamp changes. A scratch on dark paint has no rule anyone can write. Most lines end up running both, in that order.
Summary
This post sets a colour threshold on bottle caps against a learned model for scratches on dark paint, to show where a deterministic pipeline is the right tool and where it stops working. It concludes that thresholds fail loudly and models fail quietly, that most lines run a threshold in front of a model, and that the model is the half that keeps improving after launch. It is for manufacturing engineers deciding which kind of vision a new check needs.
Andreas Ohrvall · CTO · Oct 3, 2026

Bottling line under the fill head, bottles queued and one missing its cap, generated scene with detections from our model
Bottling line 1 has a camera at the capper that checks every cap is blue. The check was written in an afternoon years ago: crop to where the cap should be, measure the average colour, compare it with a range, reject if it falls outside. It has run for years without a label ever being drawn, and when it fails, it fails in a way the technician can read from a single number on the screen.
Across the site, the body shop wants a camera to find scratches on dark painted panels. Nobody has written a threshold for that, because nobody can say in numbers what a scratch is. It is a faint line, sometimes, at some angles, under some lights, on a surface that reflects the ceiling. The bottling check and the scratch check are both computer vision. They are not the same kind.
A colour threshold on the caps works until the lamp is changed
The cap check is a deterministic pipeline: a fixed sequence of operations with parameters someone chose. A crop, a colour measurement, a comparison. Every step can be printed, every threshold can be explained to an auditor, and the whole thing runs on the smallest processor in the cabinet. For a question with a stable answer, a blue cap under a fixed lamp on a fixed belt, it is the right tool and a model would be an expensive way to do the same thing worse.
Its weakness is that it knows nothing outside its parameters. When the maintenance crew replaced the lamp above the capper with one of a slightly warmer colour temperature, every cap on the Monday shift measured outside the blue range and the line rejected all of them until someone re-tuned the threshold. The pipeline was right by its own rule. The rule was written for a lamp that no longer existed.
The caps come from two suppliers in two slightly different blues, and the threshold has a notch in it that nobody remembers adding, wide enough to pass both.
A scratch on dark paint has no rule anyone can write
The body shop check is different because the thing to find does not have a stable measurement. A scratch is a departure from a surface that is itself varied: reflections, orange peel, the seam between panels, a fleck of dust that will blow off. A pipeline that looks for thin bright lines finds the reflection of the strip light on every panel that leaves booth 2. Tighten it to exclude reflections and it excludes the scratches that look like them.
This is the case for a learned model. Rather than writing the rule, the line shows the model examples: a bounding box around every scratch on a few hundred panels, and a few hundred clean panels with no box, checked by an inspector before anything trains. The model learns the difference from the frames, including the difference between a scratch and a reflection, because the inspector boxed one and not the other. The what a vision model can and cannot see lesson has the test for whether this will work: if the body shop's best inspector can call the scratch from the frame alone, the model has something to learn.
The learned model needs a bounding box on every scratch and the threshold does not
What the model costs is the part the threshold never had. Someone draws the boxes on the panels from booth 2. Someone else checks them, because a bounding box drawn a little wide on every scratch teaches the model that scratches include their surroundings. And when the model is wrong on the line, the wrongness is not a number to adjust; it is a frame to review, correct and fold into the next version.
The model also needs more compute than the cap check, though on a line camera sampled every couple of seconds, a small box beside the recorder is enough, and the deployment doc describes that arrangement. What it does not need is a rule. The body shop never has to say what a scratch is in numbers, and that is the whole reason to use it.
The deterministic pipeline fails loudly and the model fails quietly
The lamp change on the bottling line was found in an hour, because every cap was rejected and the number on the screen was outside the range. A threshold that stops working stops working for every bottle at once, and visibly so.
A model that stops working does so at the edges. A new paint colour arrives in the body shop in September, darker than the ones the model learned, and scratches on it are missed while scratches on the old colours are still found. Nothing on the line looks different. The reject rate drops a little, which reads as good news. The only early sign is the inspector overriding the model's clean verdict on the new panels, and that override rate is the signal that the model needs to see the new colour.
My own view is that this difference matters more than the accuracy comparison people usually make, and that anyone choosing a model over a threshold should plan the review queue before they plan the training run.
Most lines run both, the threshold in front and the model behind
On the manufacturing lines we run, the choice is rarely one or the other. The usual shape is a deterministic stage in front, doing what it does well, and a learned model behind it doing what a threshold cannot. On the camera at booth 2 the front stage finds the panel, crops to it, and corrects the exposure, all of which are fixed operations with explainable parameters. The model then looks at the crop for scratches. On the bottling line the colour threshold still runs; a model was added later for the caps that are present but cross-threaded, which no colour range can see.
The hybrid also gives the model a guard. If the front stage cannot find the panel, the frame goes to review instead of to the model, and a camera that has been knocked is caught by a step that has no opinion about scratches.
The model is the part that keeps learning after launch
The cap threshold was tuned once and again when the lamp changed. The scratch model is never finished in that way. LexData takes it through its whole life: you type what to look for, Lexi puts a box on every scratch in every frame, and an inspector checks each label before anything trains on it. The model then watches the body shop camera the plant already has, in the cloud, on the plant's servers, or on a runner beside the recorder. Frames it is unsure of come back to a person, the corrections retrain it, and the new version replaces the old one with no downtime.
The new paint colour became a version that way. The inspector's overrides on the dark panels were the corrections, and the next version found scratches on them at the rate it found them on the old colours, which on that line is the 99%+ accuracy the plant holds in production. The threshold on the caps is still the one from the afternoon it was written, with the notch.
See it on your own footage.
Start with your footageMore in Computer vision

Computer vision · 6 min read
What CLIP is and why typing a description finds the frame
A shared space for pictures and words lets an operator type a sentence and get the matching frames from a recorder. A way to look, and the boxes come after.
Rob Hickey · Oct 3, 2026

Computer vision · 6 min read
An end-to-end object detection workflow starts with decisions, and the first frame is labeled last
Tag, box, mask or keypoints. A class list with occlusion and size rules. A metric and an acceptance sentence. Then, and only then, the first camera's frames.
Ayman Quadir · Oct 3, 2026

Computer vision · 7 min read
Image recognition AI, explained on the cameras a site already owns
A tag, a box, a mask or keypoints, on a substation camera, a line camera and an aisle camera. How a model gets there, and what its score does not promise.
Esdras Ntuyenabo · Oct 3, 2026