The first project weighs more organisationally than technically
The first machine vision system in a plant is technically the smallest job and organisationally the largest: where maintenance meets a camera, and where whoever approved the budget asks whether it works. A start on a hard problem can half-succeed and still never earn a second project. So the criterion is not the most expensive defect but the highest solvability with the clearest measurable outcome; the most expensive defect is usually the hardest problem, and belongs second in the queue.
Easy problems, hard problems
One distinction sets the order: is the defect defined by physics, or by someone’s taste? A physical defect can be given a threshold and two inspectors reach the same verdict; a taste-based one has no reference, so the same part passes in the morning and fails at night.
| Problem type | Example | Difficulty | Deciding reason |
|---|---|---|---|
| Presence / absence | Gasket fitted, label applied | Easy | Binary verdict, large feature, clean contrast |
| Gauging | Hole diameter, edge length, angle | Easy–medium | Numeric verdict, but needs calibration |
| Code and text reading | DataMatrix, lot code (OCR/OCV) | Medium | Print quality and surface variation |
| Defined surface defect | Scratch over 2 mm, burr, porosity | Medium–hard | Many-formed defect; lighting decides |
| Cosmetic defect | “The paint looked wrong to the customer” | Hard | No written criterion; judgement drifts |
The first project comes from the top rows. The bottom ones are not unsolvable, just slower: longer sample collection, more controlled optics, a written criterion.
Five questions that screen a candidate
Any “no” means turning that answer into a “yes” is the project’s first task, not camera selection.
1. Does the defect appear repeatably in the image? Put twenty defective parts under the same fixed lighting; it should show on all twenty. If the inspector finds it by tilting the part toward the light, a fixed camera will not.
2. Can the lighting be held constant? Daylight through a roof window, a welding arc opposite, a lamp switched on per shift — all change the image over a day. Standard fix: an enclosed shroud, strobed light, a bandpass filter matched to the illumination wavelength. If that is impossible, the problem is no longer easy.
3. Is the part position repeatable? ±1 mm or ±20 mm, and can it rotate? Software alignment works, but every degree of freedom costs cycle time and error budget; a mechanical stop is cheaper than days of algorithm work.
4. Can the pass/fail decision be written down? Target sentence: “A scratch exceeding 0.3 mm in width and 5 mm in length is rejected; scratches within 2 mm of the edge are not assessed.” Without it nothing the system learns can be verified. Give 50 parts to two inspectors separately: below 90 % agreement, write the criterion before automating anything.
5. Is there a reference sample set — good and bad? Bad parts are the hard part: at a 0.3 % defect rate one example turns up every 333 parts. Aim for 20–30 real examples per defect class; with deep learning, hundreds.
Lighting is the most decisive part of the system
One rule outweighs the rest: if the defect is not plainly visible to the human eye in the raw image, no algorithm will find it reliably. An algorithm does not create contrast, it exploits contrast already there — which is why most of the feasibility effort goes into optics and lighting trials.
- Backlight: silhouettes the part; makes presence/absence and outside gauging nearly deterministic. The safest first project.
- Diffuse dome: suppresses reflections on shiny, curved metal.
- Dark field (low-angle): near-parallel to the surface, so only scratches and nicks light up.
Wavelength is a tool too: red or near-infrared separates the scene from ambient light, blue raises fine detail, crossed polarisers cut glare.
The resolution and cycle time budgets
Resolution. The smallest defect must cover at least 3–5 pixels (sub-pixel methods allow less for gauging; below 3 pixels detection blends into noise). A 0.2 mm scratch across a 200 mm field needs 0.2 / 4 ≈ 0.05 mm per pixel, about 4000 pixels horizontally. A 5 MP camera (~2450 px wide) gives 0.08 mm per pixel there, so the defect falls to ~2.5 pixels: borderline. The fix is two cameras or a narrower field. Skip the arithmetic and it returns at commissioning as “the camera does not see the defect”.
Cycle time. At 60 parts per minute there is 1 second per part: trigger, exposure, transfer, processing and the verdict reaching the PLC all fit inside it. Motion blur is a separate constraint: at 0.5 m/s a 1 ms exposure means 0.5 mm of blur, so hunting a 0.2 mm defect drops exposure to around 100 µs — which then sets the light output and the strobe driver.
Rule-based or deep learning
| Criterion | Rule-based | Deep learning |
|---|---|---|
| Suitable problem | Geometry, gauging, presence/absence, codes | Many-formed surface defects, texture |
| Sample appetite | Tens of parts | Hundreds per class; thousands screened for rare defects |
| Explainability | Full — which measurement crossed which threshold | Partial; a heat map gives no dimension |
| New product variant | Adjust thresholds and ROIs | Relabel and retrain |
The third option works most often on the floor — a hybrid arrangement: a rule-based layer locates and aligns the part and crops the region of interest (ROI); the learned layer decides only inside that crop, so sample appetite drops and the verdict stays traceable. Where learned models earn their keep is covered on the artificial intelligence and machine learning page.
Who balances false rejects against escapes
One threshold moves two errors in opposite directions: tighten it and false rejects rise, loosen it and escapes rise. The curve is an engineering output; the operating point on it is a business decision, set with written approval from the quality and production owners.
Numbers shorten the argument. 10,000 parts a day at a 0.5 % defect rate is 50 defective parts: a 1 % false reject rate scraps 100 sound parts a day, a 10 % escape rate sends 5 defective parts to the customer. An escape means PPM penalties and recalls in automotive; in high-volume packaging the scrap can outweigh it. And a system with a high false reject rate gets switched off — most “inspection bypass” switches exist because a threshold was not trusted.
The order to run a feasibility study in
Reverse it and you get the classic expensive mistake: hardware arrives, then someone tries to solve the lighting.
- Collect samples — good and bad, tagged with date and defect class. With no archive, put a box on the line and add “do not throw these away” to the shift instructions.
- Trial lighting and optics — several geometries and wavelengths. The output is not a report, it is raw image files.
- Resolution budget — mm per pixel, sensor and lens, working distance, depth of field.
- Cycle time budget — exposure, transfer, processing, verdict to the PLC; check motion blur.
- Try the algorithm on the collected images — a held-out test set is mandatory; a result tuned on the images it is measured on will not repeat on the line.
- Plan mechanics and integration — fixturing, trigger source (encoder or proximity sensor), reject mechanism, who notices a full reject bin, where results are stored.
- Only then order hardware.
Storing verdicts alongside line data is the invisible item: how the defect rate shifts with shift, supplier batch or machine setting often produces more value than the inspection itself — plan it with data acquisition and analytics.
A negative proof of concept is also a result
A PoC that concludes “not reliably solvable with this lighting and this budget” is a gain, not a failure: it buys a camera never ordered, a panel never built, a system never switched off. What remains is a sample archive, the geometries tried, a written criterion and a realistic resolution calculation — so when the problem is reopened six months later with different mechanics, work does not restart from zero. Hence the PoC deliverable list belongs in the contract.
What you can do tomorrow
- Sort the last three to six months of reject and complaint records by cause frequency.
- Run the five questions against the top three causes; within a day the easy candidate is obvious.
- Put a labelled defective-sample box on the line and add it to the shift instructions.
- Write the pass/fail criterion for your leading candidate as one paragraph and have two inspectors read it; the sentences they disagree about are the project’s real risk list.
More on method on the machine vision and camera systems page.