Can scratch and dent detection be done with cameras?
Yes, scratch detection and dent detection on metal and painted surfaces can be done with cameras, but lighting and viewing angle decide the result long before software does. Many plants still inspect surfaces in a light tunnel, where the outcome depends on who is looking. A TOK 2023 paper on vehicle bumper surface defects from Istanbul Technical University calls the traditional method, operators reading defects from the reflection of fluorescent lamps, relatively costly, time-consuming and hard to reproduce; its system finds dents, residue, dust, runs and polishing marks in reflected images with deep learning. An automated system applies the same light and rule to every part, but if the light does not reveal a defect, no model will find it.
Why is surface defect detection mainly a lighting problem?
Because a scratch or a dent is not a change in colour but a small change in surface shape, visible only at certain angles of light and view. A matte surface scatters light everywhere, so a scratch shows only under shallow-angle light. Glossy paint and polished metal act as mirrors: the camera sees lamps and ceiling before the defect. A broad review of deflectometry explains that when the surface normal tilts by α, the reflected ray turns by 2α, so reflections are very sensitive to small slope changes. An inspector moving their head to find a kink in a lamp's reflection uses the same principle.
| Lighting method | Shows best | Suited surface | Limit |
|---|---|---|---|
| Dark-field, low-angle light | Scratches, pits, pinholes, edge damage | Flat or gently curved metal | Also lights up brushing marks; misses soft, wide dents |
| Diffuse dome light | Stains, colour differences, residue on the surface | Small curved and shiny parts | Can suppress shallow defects along with the glare |
| Photometric stereo (one camera, several lights fired in turn) | Dents, dings, embossing and texture faults | Matte or semi-matte, printed parts | Gives wrong results on mirror-like surfaces |
| Deflectometry (reflected stripe patterns) | Dents, waviness, orange peel, runs, inclusions under paint | Glossy paint, mirror-like metal | Does not work on matte surfaces; sensitive set-up |
| Laser triangulation (3D) | Depth of dents and scratches | Matte metal, profiles, castings | Struggles on glossy surfaces; can be weak on fine scratches |
Edmund Optics' application note on dark-field ring lights shows low-angle light revealing scratches on a metal gear, with the light about 50 mm from the object; its note on dome lights says diffuse light evenly illuminates curved, specular objects such as automotive parts. MVTec's HALCON documentation on photometric stereo says three or more images from one viewpoint under known light directions separate shape from print and suit finding small surface defects, but glossy surfaces are not processed correctly and the method does not replace 3D methods such as sheet of light. For dents and paint defect inspection on glossy finishes, deflectometry is therefore the natural candidate.
What can a camera catch, and where does it struggle?
With the right light, a camera catches scratches, dents, orange peel, runs, inclusions and pits; it struggles to tell defects from harmless marks. Most false rejects come from dust, water drops, oil, tool marks and brushing direction, which can shine like a scratch under low-angle light. Two light angles, shape information, a separate class for harmless marks and a drying step before the camera reduce the confusion.
- Brushed metal: A scratch running parallel to the brushing disappears among the brush marks, so light the part from at least two directions.
- Textured surfaces: On blasted or anodised surfaces the texture itself produces noise; methods that learn the normal texture can beat fixed thresholds.
- Colour: Dark glossy paint reflects more, and the flakes in metallic paint sparkle at every angle; treat each colour as its own test condition.
Unseen edges, marks below the resolution and defects the chosen light does not reveal will be missed; list them at the start.
How do you choose the camera, scan type and part handling?
Start from the smallest defect you must reject, the part size and how the line moves. A rule of thumb is that the smallest defect should cover at least three pixels, because a one-pixel mark cannot be told apart from noise. For a 0.3 mm defect that means 0.1 mm per pixel; across a 1,000 mm wide panel, that is 10,000 pixels per line.
- Area-scan camera: For discrete parts; a sensor triggers the shot, and a fixtured part can be imaged under several light directions.
- Line-scan camera: For sheet strip, coil and aluminium profiles; an encoder ties the camera to line speed.
- Robot-mounted camera: For doors, bonnets or white goods panels; camera and light travel around the part.
- Several views: Edges and concave areas cannot be seen from one angle; a coverage table should show which camera sees each zone.
Enclose the station: sunlight from a roof window changes the image hour by hour.
Rule-based image processing or a learned model?
If the light separates the defect cleanly from the background, rule-based image processing is enough; when texture, colour and harmless marks interfere, a learned model is needed. Rules measure a scratch's length and position with thresholds and edges; they need little data and are easy to explain. A segmentation model, trained on labelled defects, outputs a mask that calibration turns into millimetres. We compared output types in our article on segmentation versus detection for defective parts. Anomaly detection is trained on good parts only and flags regions that differ from normal. A widely used benchmark, the MVTec AD dataset, holds over 5,000 images in fifteen categories, with defect-free training images and test images whose anomalies are annotated pixel by pixel. Benchmark scores do not carry over to your paint; threshold choice is covered in our article on anomaly detection without defect labels. Most systems combine the two: a model proposes a region, a rule measures it and decides by zone.
Who sets the acceptance limit, and how should results be reported?
The acceptance limit comes from your customer's limit samples and defect catalogue, not from the software. The catalogue states the largest acceptable length, area or depth per defect type and zone. A common approach splits surfaces by visibility: zone A is always visible to the user, B occasionally, C hidden after assembly. The same 2 mm scratch can be a reject in zone A and acceptable in zone C. Without a catalogue, the model learns the disagreement between inspectors, so write one first.
- Recall: Of 100 truly defective parts, how many were caught; the rest is the escape rate.
- Precision: Of 100 rejected parts, how many were really defective.
- False reject rate: Of 100 good parts, how many were wrongly rejected.
- Cycle time: Whether the decision fits the line speed.
Report results per defect type, zone, colour, shift and lighting condition rather than as one average. Test on parts never used in training, with the true answer given independently by two inspectors. Set targets from the light tunnel's measured performance and your error costs, not a brochure. Writing those criteria is covered in our article on acceptance tests for visual inspection pilots.
How does the system talk to the line, and what happens when it is unsure?
The system sends a decision to the PLC, shows where the defect is, stores the image and routes parts it is unsure about to a person.
- PLC: An OK, NOK or "check" signal goes over a digital output or fieldbus to a diverter or a robot.
- Defect position: Marked on the operator screen or projected onto the part, so rework does not start with a search.
- Uncertain parts: Borderline parts go to a review station; decisions confirmed by an expert join the training data.
- Archive: Images are stored with serial number and decision to answer customer claims; the decision also goes to the MES if there is one.
What makes a quote bigger or smaller?
Part size, surface gloss and the number of views needed drive the scope most. A robot or several cameras, pattern screens, very small defect limits, high line speed, many colours and a catalogue written from scratch add work; a flat part in a fixture, one colour and an existing reject mechanism reduce it. A quote should itemise:
- Hardware: cameras, lenses, lighting, pattern screen, enclosure, computer.
- Mechanics: fixture, robot cell, conveyor changes.
- Data: image collection, limit sample catalogue, labelling.
- Software and integration: model, operator screen, archive, PLC, MES.
- Commissioning and monitoring: lighting trials, acceptance test, revalidation for new colours.
Why do surface inspection projects fail?
Most failures come from lighting, samples and defect definitions rather than from the model:
- Choosing the camera before a lighting trial with real defective parts.
- Running the demo on clean, dry parts; water marks on the line multiply false rejects.
- Labelling without limit samples.
- Sending false rejects straight to rework; once the load grows, operators bypass the system.
- Skipping revalidation when the paint colour or sheet supplier changes.
Hypothetical example: how do you calculate escapes and false rejects on a painted panel?
The following example is hypothetical; the numbers only illustrate the method. A white goods supplier paints 2,000 panels a day, and 3% of them, 60 panels, are defective. On a separate test set of 300 defective and 3,000 good panels, a system using deflectometry and low-angle light scores as follows:
| Defect type | Defective panels | Caught | Recall |
|---|---|---|---|
| Dent | 100 | 88 | 88% |
| Scratch | 100 | 97 | 97% |
| Inclusions and runs | 100 | 97 | 97% |
| Total | 300 | 282 | 94% |
Recall is 282 / 300 = 94%, so the escape rate is 6%. The average hides weak dent results: 9 of the 12 missed dents sit on the lower edge, outside the pattern, so the fix is another view. Of the good panels, 66 were rejected: 66 / 3,000 = 2.2% false rejects, 39 of them water marks that a drying step could largely prevent. Precision on the test set is 282 / (282 + 66) = 81%, but on the line each day about 43 of 1,940 good panels and 56 of 60 defective ones are rejected, so only 57% of flagged panels are defective.
The threshold depends on where rejects go. In relative units, a look at the review station costs 1, sanding and repainting 15, and an escape to the customer 60. A sensitive threshold raises recall to 97% and the false reject rate to 4.5%, or 87 panels a day.
| Threshold | Escapes per day | False rejects per day | Rejects go to review | Rejects go to repaint |
|---|---|---|---|---|
| Normal | 3.6 | 43 | 3.6 × 60 + 43 × 1 = 259 | 3.6 × 60 + 43 × 15 = 861 |
| Sensitive | 1.8 | 87 | 1.8 × 60 + 87 × 1 = 195 | 1.8 × 60 + 87 × 15 = 1,413 |
With a review station, the sensitive threshold is cheaper; without one, the normal threshold is. On the same test set, the light tunnel's recall ranged from 86% to 95% by shift; the target is set against that baseline.
What should you prepare before you start?
Prepare these before talking to vendors, so that quotes can be compared:
| Item | What to prepare |
|---|---|
| Defect catalogue | Types, size and depth limits, A, B, C zone map, photographed limit samples |
| Samples | Defective parts of every type, good parts, and harmless ones carrying water, dust or oil marks |
| Line details | Line speed, reject mechanism, PLC signal list, number of colours and models |
| Today's baseline | The light tunnel's recall and false reject rate per shift |
| Owner | A named quality expert who rules on limit samples |
You do not need thousands of labelled defect images up front or a new line; the first lighting trials can be run with set-aside parts.
Hatson Tech builds surface inspection stations like this as part of its computer vision quality control service. If you want to review your parts and defect catalogue together, the first meeting and the discovery review are free.