addaScan home
Assessment
Application // 04

Surface defect detection with machine vision

Scratch detection, dent detection, flash, short shots, marks, colour faults and contamination on moulded, metal and packaging parts made in South Africa.

Technical review: Frank GuoReviewed

Request an assessment for this application
// Short answer

Surface defect detection, or surface defect inspection, is a camera check that finds visible faults on a part’s surface, such as scratches, dents, flash, short shots, marks, colour differences and contamination, when lighting makes them stand out consistently. Lighting geometry decides most of the result: low-angle light for scratches and dents, dome light for shiny parts, backlight for outline faults. Rule-based tools suit well-defined defects; deep learning helps when defects and good parts vary. Internal defects cannot be seen. We confirm feasibility on your samples first.

// What it checks

Which surface defects a defect detection system can find

Four common defect groups in surface defect inspection. Whether a defect can be found depends on its contrast under the right light.

01 // Scratch

Scratches and scuffs

Scratch detection on machined, painted, moulded or printed surfaces, including metal surface defect detection on reflective parts.

Usually needsLow-angle light
02 // Dent

Dents and sink marks

Local changes in surface shape, seen as changes in shading or reflection.

Usually needsLow-angle or structured light
03 // Moulding

Flash and short shots

Extra material at parting lines and incomplete fill, seen as a changed outline.

Usually needsBacklight or strong contrast
04 // Marks

Marks and contamination

Stains, black specks, foreign material and colour faults visibly different from the part.

Usually needsEven, diffuse light

Lighting decides what is visible

Lighting geometries for surface inspection
LightingHow it worksMakes visible
Low-angle (dark-field)Light skims the surface; raised or cut features light up.Scratches, dents, embossing, burrs.
Dome (diffuse)Light from all directions removes glare and hot spots.Marks and colour faults on shiny or curved parts.
BacklightThe part is seen as a silhouette.Flash, short shots, outline and edge faults.
CoaxialLight along the camera axis; flat glossy areas appear bright.Scratches and marks on flat polished or glossy faces.

Rule-based tools or deep learning

Rule-based tools compared with deep learning for surface defects
MethodSuitsNeedsWatch out
Rule-based toolsDefects with clear contrast on a consistent background.Good samples and a defined defect list.Struggles with natural texture and variable defects.
Deep learningDefects and good parts that vary, such as textured surfaces.Labelled images of good and bad parts; retraining when products change.Needs more samples and a validation plan; harder to explain.

This page covers separate parts. Continuous film, sheet, board and coil are imaged with line-scan cameras: see web and line-scan inspection. Surface checks on tiles, bricks and boards are described under building materials. Specks, bubbles and short shots on PET preforms are covered with empty container and preform inspection.

For incomplete plastic caps, read the short-shot inspection guide for moulded closures. It connects missing edges and bridges with lighting and viewing choices, and explains why good samples from each cavity matter.

// Definitions

What is a surface defect, and when is it a reject?

The terms a quality team and an integrator need to agree before a surface inspection station is designed.

A surface defect is any visible deviation from the good surface: a scratch, a dent, extra or missing material, a mark, a foreign particle or a colour difference. Whether it is a reject is a quality decision, not a camera decision. Your quality team sets the limits, for example the longest scratch allowed on a visible face, and the station applies them the same way on every part. Borderline samples that the team has already judged are the fastest way to agree those limits.

Colour inspection and shade differences

Colour inspection compares the colour of a part, a print or a cap with a reference under controlled light. Clear differences, such as a wrong colour or missing print colour, are reliable with a colour camera and stable white light. Small shade differences between batches are harder: they depend on the light, the angle and the surface finish, and may need a dedicated colour measurement instead of an inspection camera. The sample test shows which case you are in.

Defect detection rate, false rejects and escapes

Two numbers describe a surface defect detection camera or station. The defect detection rate is the share of defective parts it catches; the parts it lets through are called escapes or missed defects. The false reject rate is the share of good parts it rejects. Tightening the limits raises the detection rate and the false reject rate together, so both are defined and measured before acceptance, as described in reducing false rejects.

// Limits

Where surface inspection stops

We agree these boundaries before a project starts. We do not promise that any defect can be found.

Not detectable with a camera

  • Internal defects. Voids, porosity and cracks below the surface are invisible to a camera.
  • Defects without contrast. A fault that looks like the good surface under every lighting tried cannot be separated from it.
  • Faces out of view. Undersides, bores and hidden faces need extra cameras or part handling.

Works reliably when

  • Lighting is designed for the defect. Chosen on your parts, shielded from daylight.
  • Parts arrive the same way. A fixture or guides keep each face at the same angle to the light.
  • Defects are defined. A defect list with borderline samples your quality team has judged.
// Evidence

What you can check before you ask us

How feasibility is decided on your own samples, and the published budgets of complete line solutions that use this check.

Engineering method

How a sample test is judged

Samples
Good samples that show normal variation, and defective samples for each defect you need to catch, including borderline ones.
Imaging
Imaged under candidate lighting and optics; what is, and is not, visible is recorded.
Acceptance
False rejects and missed defects are agreed in writing and measured at FAT and SAT.
Outcome
A written feasibility conclusion with example images, before any proposal.

The method used on every project; not a measured result.

How to prepare inspection samples →
Budget model

Installed budgets of line solutions that use this check

Can ends and dents
R 100 000 – R 1 180 000
Egg cartons and trays
R 180 000 – R 850 000
Glue and sealant beads
R 230 000 – R 1 590 000
Aluminium extrusions
R 360 000 – R 1 340 000
Copper and carbon anodes
R 1 190 000 – R 2 760 000
Basis
Indicative budget for a typical application, in rand, excluding VAT, as at 2 October 2026, low to high configuration. A firm price follows the sample test.

Each figure is for a complete station on that line, not a price for this check on its own.

All line solutions with budgets →
// Station layout

How a surface inspection station is laid out

Side view of a typical station with low-angle lighting. The real layout follows the sample test and site survey.

[Schematic]Side view · not to scale

Swipe sideways to see the whole drawing →

Side view of a surface defect inspection station A part held in a fixture on the conveyor passes a trigger sensor and stops under a camera. A low-angle ring light close to the part sends light that skims the surface, so a scratch reflects light up into the camera while the flat surface stays dark. A reject further down removes failed parts. PRODUCT FLOW → [1] TRIGGER SENSOR [4] PART IN FIXTURE [2] CAMERA + LENS [3] LOW-ANGLE RING LIGHT SCRATCH SCATTERS LIGHT TO CAMERA [5] REJECT
[1] Trigger sensor: tells the station a part is in position.
[2] Camera: resolution chosen from the smallest defect that matters.
[3] Low-angle light: skims the surface so scratches and dents show up.
[4] Fixture: holds each part at the same angle to the light.
[5] Reject: removes failed parts; the PLC tracks each one.
// Pass and reject[Illustrative examples]

What a pass and a reject look like

Illustrations, not images from a real line. Which marks count as a defect is agreed with you, using borderline samples, during the sample test.

TEXTURE ACCEPTED
PASS
Example // Machined face

Surface within limit

Normal machining texture is accepted, because good samples taught the station what it looks like.

SURFACE: IN LIMITACTION: PASS
SCRATCH FOUND
SCRATCH
Example // Machined face

Scratch above limit

Under low-angle light the scratch shows bright and exceeds the agreed limit.

DEFECT: ✗ SCRATCHACTION: REJECT
OUTLINE INCOMPLETE
SHORT SHOT
Example // Moulded part

Incomplete moulding

The outline lacks a corner compared with the reference, typical of a short shot.

OUTLINE: ✗ INCOMPLETEACTION: REJECT
// Line interface

What we need to know about your line

These conditions decide the station design. Each is confirmed on site or during the sample test.

Line conditions for a surface defect inspection station
ConditionWhat we need to knowWhy it mattersConfirmed during
Part presentationConveyor, fixture or robot; orientation and how stable it is.Defects must appear in the same lighting each time to be found consistently.Site survey
Surfaces to inspectWhich faces matter, and whether the part must be turned.Each face needs its own view; hidden faces need another camera or handling.Design review
Material and finishShiny, matte or textured; colour and finish variation between batches.Decides the lighting and whether rule-based tools are enough.Sample test
Cycle timeParts per minute or cycle time of the machine.Sets exposure, trigger and how much processing time is available.Site survey
PLC and rejectPLC make and model, spare I/O, existing reject or sorting.Decides how results, reject timing and changeover are handled.Design review
// Acceptance

How the station is accepted

Tighter limits catch more defects but reject more good parts; looser limits do the opposite. We agree the balance before FAT and SAT.

01

False reject rate

The share of good parts rejected, measured on agreed good samples that cover normal variation. The acceptable level is agreed per project.

02

Missed defect rate

The share of defective parts that pass, measured with known defect samples, including borderline ones. The target is set with you.

03

Defect catalogue

A signed list of defect types with reference images and accept or reject decisions, kept under change control with any trained model.

// Evidence

Seeing the defect, sizing the camera and measuring the result

Lighting physics from the light maker’s own catalogue, a defect atlas, and worked examples of pixel size and reject metrics.

Light decides what is visible. HIKROBOT’s light catalogue explains each lighting geometry in terms of where the reflected light goes (HIKROBOT light catalogue, glossary). The table restates that glossary for surface defects; in a bright-field image the feature is darker than the background, in a dark-field image it is brighter.

Lighting geometry and the surface defects it reveals
Lighting geometryWhat happens to the light (HIKROBOT glossary)Defects it tends to show
High-angle front light (above 45°)Flat areas reflect into the lens and look bright; rough areas look darkScratches on matte faces, print, contours
Low-angle front light (below 45°)Flat areas look dark; rough or raised areas scatter light into the lens and look bright (dark-field)Scratches, dents, embossing, burrs on flat parts
Coaxial lightLight along the lens axis: a flat surface acts as a mirror and roughness shows clearlyScratches, indentations, bumps and hollows on polished or glossy flat faces
Shadowless (dome) lightLight from all angles weakens grain and creases so the image is evenMarks and colour faults on curved, shiny or textured parts
Backlight, diffuse or parallelThe part blocks the light and shows as a silhouette; parallel light keeps edges sharp on round or chamfered partsFlash, short shots, outline and edge faults
Structured (pattern) lightA projected line or dot pattern is twisted by surface defectsFlatness and dents on smooth, reflective surfaces
Colour casting and filtersLight of the complementary colour, or white light with a band-pass filter, raises contrast of a coloured featureColour contamination, coloured marks on coloured parts
Polariser pairTurning two polarisers against each other filters strong reflectionsMarks under glare on glossy film or coated parts

Defect atlas

Common surface defects, how they appear and where vision stops
DefectHow it appears in the imageLighting to try firstLimit
ScratchA thin line that breaks the surface textureLow-angle or coaxialVery shallow polishing marks may only show at one angle; agree which are defects
Dent or sink markA gentle change of surface shape, no lineLow-angle, structured lightShallow dents on matte parts may need 3D
Flash or short shotOutline differs from the good partBacklightOnly on edges the camera sees in silhouette
Stain, speck, contaminationA local change of brightness or colourDome or diffuse, colour castingSame-colour contamination may not show
Colour or shade deviationWhole part slightly off colourStable diffuse white light, colour cameraNeeds light and camera colour stability over time
CrackA sharp line, often with a stepLow-angle; backlight if it goes throughClosed or internal cracks are not visible

Worked example: how big must a defect be? Assume a 2,448-pixel-wide camera and a scratch 0.2 mm wide. The pixel size on the part is the field of view divided by 2,448. A defect that spans only two or three pixels depends heavily on contrast, focus and lighting stability, so the sample test decides; these figures are for planning, not a detection promise.

Example: field of view and the pixels across a 0.2 mm defect (assumed 2,448-pixel sensor)
Field of view acrossPixel size on the partPixels across a 0.2 mm scratchWhat it means
50 mm0.020 mmabout 10 pixelsEasy to resolve; small view per camera
100 mm0.041 mmabout 5 pixelsOften enough with good contrast
200 mm0.082 mmabout 2 to 3 pixelsBorderline: contrast and sharpness decide

How results are measured, and why accuracy misleads

Treat “defective” as the positive class. Recall, the true positive rate, is the share of defective parts that are caught; the false positive rate is the share of good parts wrongly rejected; precision is the share of rejected parts that really are defective. Google’s machine-learning course notes that accuracy is misleading when one class is rare (Google ML Crash Course), which is always the case for defects.

Worked example (assumed figures). 10,000 parts, of which 50 are defective. The station rejects 48 of the 50 and also rejects 100 good parts. Recall is 48 / 50 = 96 %. The false reject rate is 100 / 9,950, about 1 %. Accuracy is 9,898 / 10,000, about 99 %, which sounds excellent. But precision is 48 / 148, about 32 %: two of every three parts in the reject bin are good. That is why acceptance uses recall and false reject rate separately, and why the reject bin is reviewed from the saved images. A challenge test with no misses bounds the miss rate rather than proving it is zero (NIST e-Handbook, 7.2.4.1).

For defects that vary too much for fixed rules, VisionMaster includes anomaly detection and edge-model defect tools alongside its deep-learning modules (HIKROBOT Smart Product Catalogue, p.62); whichever tool is used, the same metrics apply.

// Before we start

What to prepare for the sample test

We image your parts under different lighting before proposing a station. We confirm quantities and shipping with you first.

Sample preparation guide

Good samples

Parts that pass today, covering batches, colours, moulds or tools.

Defective samples

Each defect type, including borderline parts, marked with your decision.

Defect list

Your current defect names, photos and limits, and which defects matter most.

Line information

Cycle time, how parts are handled, PLC make and model, existing reject.

// FAQ

Surface defect questions

What is machine vision defect detection?
Machine vision defect detection means finding a fault on a product in a camera image and deciding whether it is bad enough to reject. The station compares each part with limits taught from good and defective samples. How well it works is measured by the share of defects caught and the share of good parts wrongly rejected.
What are the types of surface defects?
The common groups are scratches and scuffs, dents and sink marks, moulding faults such as flash and short shots, marks and stains, contamination and foreign material, and colour or shade deviations. Each group shows best under a different light, which is why the defect list comes before the station design.
What is a defect detection camera?
An industrial camera or smart camera with lighting and software set up to find surface faults on moving parts. The camera itself matters less than the lighting geometry and the limits taught from your good and defective samples.
Can machine vision detect scratches on metal and steel surfaces?
Often, yes. Scratch detection on metal works the same way for machined parts, sheet, coil and extrusions. Low-angle dark-field light makes a scratch appear bright against a dark background; with coaxial bright-field light on a flat reflective surface, a scratch usually appears dark against a bright background. Which works depends on the surface and its geometry. Reflections, machining marks and oil can look similar, so feasibility and the smallest scratch that can be found are confirmed on your parts. Metal surface defect detection and steel surface defect detection on wide or continuous material usually need a line-scan camera; on aluminium extrusions before powder coating, scratches, dents and die lines are tested on your profiles first.
What is a surface defect detection system made of?
A camera, the lighting that makes the defect stand out, software with limits taught from your samples, and the reject or marking that acts on the result. For discrete parts the surface defect inspection camera is usually an area-scan camera with dome or low-angle light; for continuous material it is usually a line-scan camera.
Can short shots and flash be detected on moulded parts?
Yes, when the affected edge is visible. Both change the part outline, so a backlight or high-contrast view compared with a good reference usually works. Flash inside a hole or on a hidden face needs another view.
When is deep learning needed instead of rule-based tools?
When defects vary in shape and good parts vary in texture or colour, so fixed rules either miss defects or reject good parts. It needs labelled examples of good and bad parts.
Can a camera find internal defects?
No. A camera sees only the surface. Voids, internal cracks and porosity need other test methods.
Which software do you use?
We build stations on HIKROBOT VisionMaster, whose deep-learning tools ship as a separate package with classification, object detection and segmentation modules (vendor-stated). We build on it as an independent integrator; this website does not claim any official HIKROBOT partnership or distributor status.

Sources

  1. HIKROBOT VisionMaster product page (deep-learning modules) (vendor page, checked 2026-09-24)
  2. HIKROBOT Download Center (VisionMaster DL Package) (vendor download listing, checked 2026-09-24)
// Production checks

Machined surfaces: separate the defect from the imaging condition

On a reflective machined surface, the light and part position can determine whether a mark is visible. Compare the intended defect with normal tool marks, oil droplets, loose chips and allowed finish variation before choosing a detection rule.

Decision or event / Check or action / Acceptance boundary
Decision or eventCheck or actionAcceptance boundary
Exposed edgeTest silhouette lighting for protruding materialThe view does not cover a hidden internal edge.
Shallow surface reliefCompare directional lighting and the required pose rangeDiffuse illumination may hide the relief.
Oil and chipsCompare production-condition and permitted cleaned samplesA cleaning step changes the process and needs agreement.
Surface acceptanceDefine the visible defect class and inspection regionImages do not establish hardness, roughness or technical-cleanliness grade.

Record the optical arrangement and challenge it after fixture or lighting maintenance. A low false-reject rate is only useful when the same setting still catches the agreed defects.

Burr inspection · Oil, chips and fixtures · Aluminium extrusion surfaces

// Surface defects

Request an assessment for this application

Describe the defects that matter and send good, bad and borderline parts. We will tell you what can be made visible.