Automated inspectionReading time 12 min
Machine Vision Starts With the Image, Not the Algorithm
If a defect barely appears in the image, software cannot reliably find it. Lighting, optics and part presentation determine the signal the algorithm receives. Fix the image first.
Wikimedia Commons・Robotic Arm Polishing Guitars at Martin Guitar・CC BY 4.001Start with resolution
Before choosing an algorithm, check whether the defect occupies enough pixels to be measured. The field of view divided by the sensor's horizontal pixel count gives an approximate size per pixel. Use that figure to set the optics and camera, then test whether the lighting gives reliable contrast.
| Item | Example | What it asks |
|---|---|---|
| Field of view | 50 mm | The area you need to see |
| Sensor | 2448 × 2048 (5 megapixel) | Camera specification |
| Spatial resolution | 50 ÷ 2448 ≈ 0.020 mm/px | How much one pixel covers |
| Detectable defect | About 0.06 to 0.1 mm | Usually needs 3 to 5 pixels to be reliable |
| Measurement accuracy | About 0.005 to 0.01 mm | Sub-pixel algorithms reach 1/4 to 1/2 pixel |
02Design the lighting
Lighting changes the image before any algorithm sees it. Choose the angle, color and diffusion so the target feature stands apart from the background while normal variation stays as even as possible.
| Technique | Arrangement | Good at finding |
|---|---|---|
| Backlight | Source behind the part | Outline, through holes, missing parts |
| Coaxial | Light through a beam splitter, on the lens axis | Scratches on mirror surfaces, printed characters |
| Ring light (high angle) | Angled down from around the lens | Surface texture, general appearance |
| Low-angle ring light | Almost parallel to the surface | Engraving, relief, edge chips |
| Diffuse dome | Diffuse reflection off a hemisphere | Even lighting on curved or shiny parts |
| Structured light | Projected fringes or a line laser | Three-dimensional height, flatness, volume |
Wavelength is a variable too
Light color and wavelength are tools, not universal rules. Red, blue, infrared and ultraviolet illumination each interact differently with materials and coatings. Test the actual defect and part under candidate lighting before locking the design.
03Typical applications
- Presence and absence. Is the part there, is it the right way round. The simplest, most stable and highest-return application.
- Dimensional measurement. Outline, hole diameter, spacing. Needs accurate lens calibration and a repeatably positioned part.
- Appearance inspection. Scratches, dents, contamination, colour variation. The hardest, because defects vary so much in form.
- Character and code reading. OCR, barcodes, DataMatrix. Mature technology; lighting and contrast are what matter.
Begin with a simple, measurable task such as presence detection. Once optics, fixturing, triggering and data handling are stable, move to more variable appearance judgments. This order makes failures easier to diagnose.
04Questions before deployment
- Can you write down the definition of the defect? If your own experienced inspectors do not agree with each other, no system will be consistent either. Run a repeatability study on human judgement first, much like GR&R.
- Can you control how the part sits? Nothing hurts a vision system more than variable position and attitude. Most failed projects fail on mechanics, not software.
- What does each kind of error cost? The cost of a miss and the cost of an over-reject are usually not symmetric, and the threshold should lean towards whichever is cheaper.