Defect Detection Cameras: How Machine Vision Finds Scratches, Cracks and Surface Defects

Defect detection camera: a smart camera with the Better Code logo detecting a scratch, dark spot and dent on a metal part and signalling NG to the PLC
Article views 0 views
Quick answer

A defect detection camera is a machine vision system that images part surfaces on the production line and uses software to find scratches, cracks, dark spots, foreign matter, dents, broken edges, stains and incomplete printing. It then decides OK / NG and signals a PLC to reject defective parts automatically. Defects with a consistent appearance can be handled by rule-based vision tools, while defects that vary in shape, size and position are better handled by deep learning. The most important factor is lighting that makes the defect clearly visible, followed by testing with real good and defective parts before choosing a system.

8 defect groupsScratch · crack · spot · dent · edge · stain · burr · print
2 ways to decideRule-based or deep learning
Automatic rejectionReal-time OK / NG signal to the PLC

What is a defect detection camera?

A defect detection camera, or defect detection system, replaces human eyes for surface quality inspection. It images every part under purpose-designed lighting, compares it with the criteria for a good part, and reports whether a defect is present, where it is and what type it is. HIKROBOT’s Introduction to Machine Vision places this task in the Inspection group, alongside surface inspection, contaminant detection and completeness checks.

Compared with manual inspection, it checks every part against the same criteria for the whole shift, does not tire like human eyes, and stores images of rejected parts for root-cause analysis. For the basics of what a vision system includes, read types of machine vision cameras.

Better Code is the official HIKROBOT distributor in Thailand. We supply, install and support defect detection cameras, from smart cameras to PC-based vision systems with deep learning, and test with your real parts before you decide. See HIKROBOT vision inspection.

What can a defect detection camera inspect?

Common factory defects fall into 8 groups, and each needs different lighting and analysis.

8 defect groups a defect detection camera can inspect: scratches, cracks, dark spots and foreign matter, dents, broken edges, stains, burrs and incomplete printing
8 defect groups a defect detection system can find (illustration)
Defect typeExample from HIKROBOT casesSuitable approach
ScratchPhone back covers, displays, LCD panels, plastic partsLow-angle or coaxial light · deep learning for low contrast
CrackStamped metal phone camera modulesHigh resolution · deep learning segmentation
Dark spot / foreign matterPlastic parts, liquid medicine, display backlight platesBlob analysis or deep learning
DentGear teeth and internal threadsLow-angle light · 360° inspection
Broken edgeMagnetic rings for motorsBacklight or low-angle light · deep learning
Stain / smudgeProduct nameplates, packaging surfacesDome light · deep learning when print varies
Burr / residueInternal gear threads · solder beads on PCBsHigh resolution · deep learning object detection
Print defectDates on milk cartons that are incomplete, distorted or smudged by dropletsDeep learning character defect check with OCR

How does a defect detection camera work?

How a defect detection camera works: lighting and image capture, analysis by rule-based tools or deep learning, OK/NG decision and PLC signal to reject defective parts
From image capture to rejection within one production cycle
  1. Trigger and capture: a sensor signals when the part arrives and the camera captures an image under lighting set up to reveal defects.
  2. Prepare the image: locate the part, align the image and define the inspection region (ROI).
  3. Analyse defects: use blob, match and measurement tools or a deep learning model to find anomalies.
  4. Decide: compare defect size and type with the acceptance criteria and conclude OK or NG.
  5. Output and record: signal the PLC via I/O or an industrial protocol to reject the part, and store NG images for root-cause analysis. (See signalling and reject timing in vision OK/NG sorting.)

Lighting matters most in defect detection

A defect can only be detected if it is clearly visible in the image. The wrong light can hide a scratch in reflections, even with a high-resolution camera. General lighting guidelines:

4 lighting setups for defect detection: low-angle light for scratches and dents, coaxial light for flat reflective surfaces, dome light for curved glossy surfaces and backlight for edges and holes
Match the lighting to the surface and defect type
  • Low-angle (dark-field) light: light grazes the surface so scratches and dents shine against a dark background. Suits metal and plastic surfaces.
  • Coaxial light: light travels along the camera axis. Suits flat reflective surfaces such as glass, polished metal and displays.
  • Dome light: diffuse light from all directions reduces shadows and glare on curved glossy surfaces. Suits stains and colour defects.
  • Backlight: light from behind the part gives a sharp silhouette. Suits broken edges, missing holes and shape defects.

Rule-based or deep learning?

Comparison of rule-based and deep learning defect detection: setup, suitable defects, sample images needed and tolerance to lighting and position changes
Choose the analysis method by how consistent the defect is
FactorRule-based (blob, match, measurement)Deep learning
Suitable defectsConsistent pattern and clear contrast, e.g. dark spots on a plain surface, missing holesVariable shape, size and position, many types, low contrast
Sample images neededA few good-part images to set criteriaTens to hundreds of defect images to train a model
Tolerance to site conditionsCamera position and lighting must stay stableCopes better with light decline, vibration and changing backgrounds
HardwareA smart camera in most casesA supported smart camera, or an industrial camera with a PC and GPU

For an overview of the four AI jobs, training images and hardware, see AI vision inspection with deep learning.

HIKROBOT’s Deep Learning Application Case Set describes a project that originally used feature matching and blob analysis, which required a stable camera position and light source. Vibration and light decline on site reduced accuracy, so the project moved to deep learning, which can learn site variation. Scratches on LCD panels are similar: reflections and low-contrast scratches made traditional methods unreliable.

Real results: figures from HIKROBOT cases

Figures from HIKROBOT defect detection cases: 300 parts per minute surface inspection, 0.15 square millimetre minimum solder bead, over 99.5% accuracy after 100 training images, and 55 milliseconds per image
Data from HIKROBOT case documents (results depend on parts and site conditions)
  • Phone back covers: surface and label scratch inspection plus label position check at 300 parts per minute with a smart camera.
  • Gearbox parts: dents, scratches and burrs on internal threads plus dimension measurement with 60 micron accuracy, 360° coverage (see dimension measurement cameras).
  • Helmets: 360° surface inspection at 60 parts per minute.
  • Plastic parts (deep learning image comparison): scratches, dark spots and foreign matter at 55 ms per image, 0% missing rate, 4% over-check rate.
  • Solder beads on PCBs: minimum bead size 0.15 mm², missing rate below 0.01%, trained on 300 NG images.
  • Magnetic ring broken edges: accuracy above 99.5% after training on 100 NG images.
  • Phone camera modules: crush, cracks, stuck material and missing material, accuracy 99.73–100%.
  • CPU socket pins: deviated, skewed or missing pins at 50 ms per image, 1% over-check, 0.3% missing.
  • Milk carton characters: incomplete, distorted or smudged dates detected at above 99.95%. To read the date values too, see date code inspection cameras (OCR).

Over-check vs missing rate: what is the difference?

Defect inspection is measured with two key figures. The missing (escape) rate is defective parts judged as good (NG → OK). It must be kept as low as possible because defects reach customers. The over-check (overkill) rate is good parts rejected (OK → NG), which wastes good product and needs re-inspection. Set targets for both from the start of a project. In an automotive air-conditioning radiator case, for example, the customer required zero missed defects and an over-check rate below 5%.

Smart camera or PC-based system for defect detection?

A smart camera suits defect inspection in a limited space on a single line where easy installation matters, such as checking surface scratches and label position with one camera. An industrial camera with a PC suits high resolution, several cameras around the part, or deep learning models that need a GPU. In HIKROBOT’s cases, complex deep learning jobs such as magnetic rings and PCB solder beads used industrial cameras with an industrial PC and graphics card. See how to start selecting a factory inspection camera.

How to start a defect detection project

  1. Collect samples: real good and defective parts covering every defect type you need to catch.
  2. Define criteria: the smallest defect to detect (length, width or area) and which defects are acceptable.
  3. Specify the line: speed, parts per minute, part size and the faces to inspect.
  4. Test lighting and camera: try several lighting setups until defects are clear, then choose resolution and lens.
  5. Set missing and over-check targets: validate with a sample set before installation, and keep collecting line images to refine the model.

To connect cameras to existing rejection systems or conveyors, see industrial automation and line integration.

Summary

A defect detection camera inspects every part for scratches, cracks, dark spots, dents, broken edges, stains, burrs and print defects against the same criteria. Start with lighting that makes defects visible, use rule-based tools for consistent defects and deep learning for variable ones, and measure performance with missing and over-check rates. Better Code, the official HIKROBOT distributor in Thailand, tests with your real parts, selects the camera, lens and lighting, and provides installation and after-sales support.

Defect detection camera FAQ

What is a defect detection camera?

A machine vision system that images part surfaces on the production line and analyses them for scratches, cracks, dark spots, foreign matter, dents, broken edges, stains or print defects, then decides OK / NG and signals a PLC to reject defective parts.

How small a scratch can a camera detect?

It depends on camera resolution, lens, field of view and lighting, so there is no single figure for every job. In a HIKROBOT case, solder beads on PCBs were detected down to 0.15 mm². Test with the smallest real defect you need to catch.

Do I need deep learning?

Not for every job. Defects with a consistent pattern and clear contrast can use standard vision tools. Use deep learning when defects come in many types, vary in shape and position, have low contrast, or when lighting and backgrounds change on site.

How many defect images are needed?

It depends on defect complexity. HIKROBOT cases range from 100 NG training images (magnetic rings, above 99.5% accuracy) to 300 images (PCB solder beads). The more varied the defects, the more complete the sample set needs to be.

Can defects be inspected on glossy or reflective surfaces?

Yes, with suitable lighting. Flat reflective surfaces often use coaxial light, curved glossy surfaces use dome light and shallow scratches use low-angle light. For very low-contrast scratches, deep learning separates them better than traditional methods.

What are the missing rate and the over-check rate?

The missing rate is defective parts judged as good (NG → OK), and the over-check rate is good parts rejected (OK → NG). Quality applications usually minimise the missing rate first, then reduce over-check to an acceptable level.

Where can I buy a HIKROBOT defect detection camera in Thailand?

Contact Better Code (Better Code Co., Ltd.), the official HIKROBOT distributor in Thailand, via LINE @bettercode or +66 2-170-9611. The team tests with your good and defective parts, selects the camera, lens and lighting, and provides installation and after-sales support.

Sources

  • HIKROBOT – Introduction to Machine Vision: the Inspection group (defect detection, surface inspection, contaminants) and vision system components
  • HIKROBOT – Smart Product Application Cases (Dec 2021): phone back cover surface inspection at 300 parts/min, gearbox parts at 60 microns and helmets at 60 parts/min
  • HIKROBOT – Deep Learning Application Case Set (2021): defect cases for plastic parts, camera modules, liquid medicine, magnetic rings, PCB solder beads, CPU socket pins, LCD panels and milk carton characters

Can a camera catch the defects on your parts?

Send photos or samples of good and defective parts, your line speed and the smallest defect you need to catch. The Better Code team will test lighting and HIKROBOT cameras and recommend the right system for your line.

Related articles