Inspection task
Start with the first count mismatch and identify whether components were joined, split or excluded. Use independently known physical counts rather than assuming the desired answer. Replay the same original at unchanged segmentation before changing an area limit. This establishes whether the symptom comes from connectivity or eligibility filtering.
Prerequisites and sample controls
State the expected number and what constitutes one physical component. Prepare correctly filled, short-filled and touching-part samples, with independently counted answers. The baseline counts separated connected regions, not hidden objects. A connected region can contain several touching parts, while a single shiny part can break into several regions. Keep these limitations in the sample definition before choosing a counting threshold.
Choose the camera route
Use an area-scan camera when the full tray fits in one triggered frame. Choose monochrome for silhouette contrast and color only for an actual color requirement. Motion during feeding calls for verified global-shutter timing or a settled capture position. A line-scan route needs motion reconstruction; it is not an automatic improvement for a stationary tray.
Run the controlled procedure
Freeze a copy of the failing workflow and retain the original failed image before testing a correction. Reproduce the symptom on saved data first, then determine whether it follows the part, illumination, acquisition or software state. A changed final answer is insufficient: the relevant intermediate evidence must improve for the expected physical reason. Do not erase the initial failure after a successful rerun.
- Layer each of the labelled areas over the original tray image.
- Compare component areas before and after filtering.
- Separate touching parts in a new capture without editing the old image.
- Test glare reduction independently from threshold changes.
Process map
Trace raw regions through eligibility filters to the mismatch, then test one physical or algorithmic cause.
- Original failure
- One change
- Replay controls
- Residual risk
Record the evidence
Record physical count, raw region count, eligible count and rejection reason. Label each excluded region; the difference between raw and eligible counts should be explainable. Preserve examples that remain impossible to resolve from the image.
Create a component-level failure map before trying to repair the total. Associate every physical part with the raw connected region or regions that cover it. Record components removed by the eligibility filter separately from regions that never existed in the mask. This distinguishes a visible small part discarded by minimum area from a part lost through poor contrast. Inspect the large merged region for the original gap: if the gap is absent in the raw image, a threshold adjustment cannot reliably restore its true shape. Capture a new image after physically separating the parts to test the connectivity hypothesis, retaining both old and new inputs. For a suspected glare split, change only the light arrangement and check that the same physical part becomes one coherent region without adding neighboring tray features.
| Control | Required observation | Decision boundary |
|---|---|---|
| N3: 3 separated parts | 3 eligible regions expected in this example | Compare with independent physical count |
| N2: 2 separated parts | 2 eligible regions expected in this example | Short fill; do not change the expected 3 |
| T3: 3 touching parts | Region count may differ from 3 | Review; connected regions are not physical objects |
Diagnose failed cases
A minimum-area filter can discard a small valid component; a reflection can split one part into several eligible islands. Widening area bounds may add tray noise. Recover separation or visibility before trying to compensate numerically.
Failure isolation
A joined pair, a split part and a filtered small part require different remedies, even if they produce the same total error.
- Merged
- Split
- Filtered
- Tray noise
Validate independently
Alter one suspected cause per trial and replay all previously failing controls. Keep image IDs, parameter differences, ROI and runtime identity in the log. If the result changes without a corresponding change in the expected intermediate observation, investigate timing or provenance. Inconclusive frames should remain explicit review cases instead of being removed to make a comparison look better.
Replay every old mismatch after the correction and inspect individual regions. Test a new short-fill tray independently; never adjust the expected count to match a failed image.
Use a correction ledger that follows the suspected mechanism. An area-filter correction should change eligibility while leaving the raw segmentation unchanged. A light correction should change the original contrast and its resulting mask. A settling correction should remove motion-related bridges in new frames but need not change the saved blurred image. If the observed effect differs from the prediction, keep the hypothesis unresolved and examine other changes. Replay the full tray controls after each accepted correction, including extra parts and the smallest permitted component. Check that one merge and one split do not cancel into an apparently correct total. Mark touching and hidden parts as unresolved when the installed route cannot explain them. A reviewer should be able to reproduce the old mismatch, the specific improvement and the remaining limits from the supplied originals and parameter differences.
Continue the engineering handoff
Send the original failure, corrected result, parameter difference and remaining boundary cases to Deyi Vision for review. Verify corrections on the live installation only after saved-image isolation succeeds. A correction demonstrated on one file is not evidence of physical-camera reliability, robot calibration or production acceptance.
Save the original image and the resulting record together.
Sources and technical references
These references explain the methods and limits used in this tutorial. Example checks are guidance; production acceptance requires evidence from your own samples.
- Visual inspection system design checklistDeyi Vision
Define sample decisions, station constraints and measurable acceptance before hardware selection.
Checked - Morphological transformationsOpenCV
Erosion and dilation alter binary regions; kernels can remove details or join regions.
Checked
Component and selection references
- Automated Visual Inspection
- Industrial 2D Cameras
- Machine Vision Lighting
- Visual Inspection System Design Checklist
- What Is Machine Vision?
- Machine Vision Systems
- Machine Vision System Components
- How Does a Machine Vision System Work?
- PCB Connector Pin Presence Inspection
- Industrial Barcode Readers
- Component counting: camera setup for separation
- Component counting: lighting and ROI boundaries
- Part positioning: acceptance and motion handoff
- Part positioning: an AI-assisted pixel workflow
- Part positioning: camera and coordinate setup
- Part positioning: lighting and ROI stability
- Part positioning: locate the cause of pick offset
- Presence inspection: acceptance and line integration
- Presence inspection: build an AI-assisted workflow
- Presence inspection: a reliable camera setup
- Presence inspection: lighting and ROI control
- Presence inspection: isolate false-pass causes

