DEV Community

calliope
calliope

Posted on

Detection Accuracy Failing? 9 Troubleshooting Directions from Camera to Algorithm (Part 1: Hardware & Physical Layer)

If you work in industrial quality inspection, you've probably experienced this frustrating moment: the system runs perfectly in the lab, but once deployed on the production line, it "crashes" — or the equipment passes acceptance testing flawlessly, yet three months later the miss rate starts to spike.

In machine vision, detection accuracy is never determined by a single link — from camera selection to algorithm parameters, any weak point can cause the entire precision to "collapse."

This article is divided into two parts, presenting 9 troubleshooting directions based on real project experience. Part 1 focuses on hardware selection and the physical environment (Directions 1–6), helping you quickly locate the physical-layer root causes of accuracy issues.

Direction 1: Camera Resolution — Is Pixel Accuracy Sufficient?

This is the most fundamental yet most overlooked issue.

Pixel Accuracy = Field of View ÷ Camera Resolution. The industry-standard safe rule is: Pixel Accuracy ≤ 1/8 of the Tolerance. That is, if your inspection tolerance is 0.1mm, the pixel accuracy must reach at least 0.0125mm/pixel.

For example: a connector housing inspection project required a tolerance of ±0.03mm. The team used a 65MP camera (9344×7000) with a 42.95×32.18mm FOV, achieving a theoretical pixel accuracy of 0.004597mm/pixel — well above the requirement — and the final measurement repeatability reached 0.01mm. Conversely, if resolution is insufficient, tiny defects are simply "invisible" in the image — no matter how powerful the algorithm is, it's useless.

⚠️ Trade-off Note: Increasing resolution comes with reduced frame rates and longer processing times. If the line speed is high, simply boosting resolution may cause the processing to fall behind the takt time — a trade-off between "inspection accuracy" and "line speed" is necessary.

Troubleshooting Tip: First calculate whether your current pixel accuracy meets the 1/8 tolerance requirement. If not — upgrade to a higher-resolution camera, or reduce the FOV.

Direction 2: Shutter Type — Global Shutter or Rolling Shutter?

Correction Note: This section replaces the original "CCD vs CMOS" discussion. Currently, CMOS occupies over 90% of the industrial camera market, and CCD has largely exited the industrial vision space. For industrial inspection scenarios, agonizing over "CCD or CMOS" is pointless — just choose CMOS. The real critical decision point is the shutter type.

Industrial camera shutters fall into two categories: Global Shutter and Rolling Shutter.

Rolling Shutter works by exposing line by line — the sensor scans from top to bottom, with tiny time differences between rows. This works fine for static objects, but when capturing high-speed moving objects, it produces the "Jelly Effect": moving workpieces appear tilted, stretched, or distorted, directly causing measurement errors.

Global Shutter, on the other hand, exposes all pixels simultaneously, instantly "freezing" moving objects and capturing images that match the actual physical shape — it's the standard for industrial dynamic inspection scenarios.

Major industrial camera manufacturers (such as Hikrobot, Daheng Image, Basler, etc.) all have mature global shutter CMOS product lines, with Sony's Pregius series and Onsemi's PYTHON series being the most typical representatives.

How to tell if you chose wrong? If your images show tilted edges on moving objects, wheels turning into ellipses, or characters becoming stretched — that's the classic "Jelly Effect," and you need to switch to a global shutter camera.

Troubleshooting Tip: Capture a calibration target moving at constant speed and observe whether straight lines become curved or slanted. If so, decisively switch to a global shutter camera.

Direction 3: Lens Distortion & Calibration — Poor Calibration, All Effort Wasted

Real lenses always have distortion — primarily radial distortion and tangential distortion. The geometric distortion error of ordinary industrial lenses directly alters the true size and shape of the target image in high-precision measurement scenarios.

There's a saying: "Poor calibration, all effort wasted." Calibration is not just a routine procedure — the accuracy of the calibration target (ceramic targets have better thermal stability than glass ones), ambient lighting during calibration, and the number and angles of calibration images all affect the final result. After obtaining distortion coefficients through the calibration algorithm, the software must perform distortion correction. If the calibration step is sloppy, all subsequent measurements will carry systematic bias.

Troubleshooting Tip: Re-run camera calibration and check whether the reprojection error is within a reasonable range (typically <0.1 pixel). For high-precision measurement scenarios, prioritize telecentric lenses — they have minimal distortion and are the top choice for precision dimensional measurement.

Direction 4: Lighting Selection & Stability — The "Foundation" of Image Quality

Lighting selection and layout is the part of vision system design that requires the most professional experience. Coaxial lighting is suitable for detecting surface flatness anomalies, oblique lighting highlights surface concave-convex defects, and backlighting is suitable for detecting holes and transmission features. Insufficient contrast caused by incorrect lighting selection is the single most common cause of high miss rates in vision inspection.

For example: a project used red ring light to detect fine scratches on a metal surface, but the scratch direction happened to be parallel to the ring light's illumination direction, resulting in zero contrast. After switching to bar light, the scratch features immediately became clearly visible, and the detection rate jumped from 60% to 98%.

A more subtle issue is light source degradation. Industrial LEDs experience luminous decay over time — brightness gradually decreases, typically dropping 10% to 20% within thousands of hours. If the system lacks closed-loop brightness control or regular verification mechanisms, image brightness slowly "dims," and the contrast between defects and background also degrades.

Troubleshooting Tip: Use a standard gray card to check whether current brightness matches the debug setting. If brightness has dropped, either replace the light source or implement software brightness compensation (such as auto-exposure or gain adjustment).

Direction 5: Lens & Protective Glass Contamination — The Invisible "Filter"

Oil mist, dust, and moisture in factory environments accumulate on lenses or protective glass, forming an uneven transmission layer. This contamination isn't always visually obvious, but in high-sensitivity inspection tasks, it's enough to blur defect images or introduce artifacts.

A detail many overlook: upward-facing lenses accumulate more dust than downward-facing ones. When designing camera mounting, if you can install cameras facing downward or at an angle, it significantly reduces dust settlement. Meanwhile, whether protective glass can be quickly replaced, and whether cameras need protective housings — these design details are rarely mentioned during project delivery, but over a 2-3 year operational cycle, they become critical factors affecting system reliability. For environments with heavy oil mist, adding compressed air purging or oil mist filters is a more proactive protection solution.

Troubleshooting Tip: Wipe the lens and protective glass with a clean lint-free cloth and check if accuracy recovers. If yes, contamination is the root cause — consider adding a protective housing or adjusting the mounting orientation.

Direction 6: On-site Ambient Light & Vibration — The "Gap" from Lab to Production Line

This is the most classic "lab champion, production line bronze" problem.

Here's a real case: a vision inspection system based on Jetson Orin NX achieved 99.8% detection accuracy in the lab, but after mass production deployment, the false positive rate suddenly jumped to 15%-20%. On-site tracking revealed three causes:

① Ambient Light Interference: Sunlight streaming through production line windows caused reflective areas on metal parts to be misjudged as defects, with an abnormal false positive peak between 9-11 AM daily. The lab used an integrating sphere uniform light source (1000±50 lux), while instantaneous illuminance near the production line windows reached 12,000 lux.

② Vibration Blur: Conveyor mechanical vibration induced motion blur — motor start/stop shock peak acceleration of 0.8g, creating a smearing effect in the motion direction, with maximum blur kernel reaching 7 pixels.

③ Material Batch Color Variation: The new supplier's plastic parts had a color temperature deviation ΔE > 8 (lab samples had ΔE < 3).

Solutions included: adding linear polarizers to reduce specular reflection by 60%, using narrow-band filters to suppress ambient light interference, enabling HDR mode to expand dynamic range, and adding magnetic damping mounts to attenuate high-frequency vibration.

Troubleshooting Tip: Add extreme condition tests during acceptance testing — test when adjacent equipment runs at full power, and test separately during day and night shifts. If these aren't tested during the debugging phase, they become "time bombs" after mass production.

Preview of Part 2

In Part 1, we started with hardware selection and the physical environment, covering 6 troubleshooting directions: camera resolution, shutter type, lens calibration, lighting selection, lens contamination, and on-site environmental interference.

Part 2 will move to the software and algorithm layer, focusing on image preprocessing, threshold tuning, and training sample coverage (Directions 7–9), along with a complete quick troubleshooting checklist.

Stay tuned.

Reference: https://www.mindvision.ltd/

Top comments (0)