Scratch and Dent Detection on Metal and Painted Surfaces
Business

Scratch and Dent Detection on Metal and Painted Surfaces

Trial the lighting on real defective parts before choosing a camera or model, take acceptance limits from the customer's limit samples, and measure results per defect type and zone.

Short answer

Scratch and dent detection on metal and painted surfaces can be done with cameras, but lighting decides the result first: low-angle light for scratches, photometric stereo for dents on matte parts, deflectometry for dents and waviness on glossy paint, and laser triangulation for depth. Dust, water marks and brushing marks cause many false rejects. Acceptance limits should come from the customer's limit samples and defect catalogue, and results should be measured as recall and false reject rate per defect type and zone.

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 methodShows bestSuited surfaceLimit
Dark-field, low-angle lightScratches, pits, pinholes, edge damageFlat or gently curved metalAlso lights up brushing marks; misses soft, wide dents
Diffuse dome lightStains, colour differences, residue on the surfaceSmall curved and shiny partsCan suppress shallow defects along with the glare
Photometric stereo (one camera, several lights fired in turn)Dents, dings, embossing and texture faultsMatte or semi-matte, printed partsGives wrong results on mirror-like surfaces
Deflectometry (reflected stripe patterns)Dents, waviness, orange peel, runs, inclusions under paintGlossy paint, mirror-like metalDoes not work on matte surfaces; sensitive set-up
Laser triangulation (3D)Depth of dents and scratchesMatte metal, profiles, castingsStruggles 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:

  1. Hardware: cameras, lenses, lighting, pattern screen, enclosure, computer.
  2. Mechanics: fixture, robot cell, conveyor changes.
  3. Data: image collection, limit sample catalogue, labelling.
  4. Software and integration: model, operator screen, archive, PLC, MES.
  5. 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 typeDefective panelsCaughtRecall
Dent1008888%
Scratch1009797%
Inclusions and runs1009797%
Total30028294%

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.

ThresholdEscapes per dayFalse rejects per dayRejects go to reviewRejects go to repaint
Normal3.6433.6 × 60 + 43 × 1 = 2593.6 × 60 + 43 × 15 = 861
Sensitive1.8871.8 × 60 + 87 × 1 = 1951.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:

ItemWhat to prepare
Defect catalogueTypes, size and depth limits, A, B, C zone map, photographed limit samples
SamplesDefective parts of every type, good parts, and harmless ones carrying water, dust or oil marks
Line detailsLine speed, reject mechanism, PLC signal list, number of colours and models
Today's baselineThe light tunnel's recall and false reject rate per shift
OwnerA 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.

Key takeaways

  • Scratches and dents are changes in surface shape, so run a lighting trial with real defective parts before choosing a camera or model.
  • Use low-angle light for scratches, photometric stereo for dents on matte parts, deflectometry for dents and waviness on glossy paint and laser triangulation for depth.
  • Keep dust, water marks, oil and brushing marks as a separate class and consider a drying step before the camera, because they drive false rejects.
  • Take acceptance limits from the customer's limit samples and defect catalogue, and report recall and false rejects per defect type, zone, colour and shift.
  • Set the threshold from your own escape and rework costs, since sending rejects to a review station or straight to repaint changes the best setting.

Frequently asked questions

How much does a surface inspection system cost?

There is no single price. Cost is driven by part size, surface gloss, the number of views, line speed, the number of colours and how deeply the system is integrated. A comparable quote lists hardware, mechanics, data and labelling, software, integration and commissioning as separate items.

Is adding a camera to our existing light tunnel enough?

Usually not on its own. A light tunnel is designed for a person who moves their head and the part, while a camera looks from a fixed angle. The tunnel's stripe lamps can work as a reflected pattern on glossy paint, but only a lighting trial with real defective parts shows which defects become visible.

Will a camera system replace our inspectors?

Not at first. The system sends uncertain parts and rejects to a person, who decides at a review station and keeps the limit samples up to date. The inspector's time shifts from looking at every part to the flagged parts and to improving the rules.

How many defective samples do we need?

Anomaly detection can start training on good parts only, but the acceptance test needs enough real defects of every type and zone; recall measured on a handful of defects is very uncertain. Start setting aside defective parts well before the pilot.

How long does installation take?

It depends on how many rounds the lighting trial needs, whether a limit sample catalogue already exists, the mechanical work such as fixtures or a robot cell, and when the line can stop. Shadow mode should run long enough to cover every shift and colour.

Can it work with our PLC and MES?

Yes. The decision goes to the PLC over a digital output or a fieldbus such as PROFINET or EtherNet/IP, and the serial number, decision and image link can be written to the MES or a quality database. Agree the signal list before the pilot.

All articles