Inspection task
A presence rule often fails because a highlight or shadow becomes the strongest object in the ROI. Build contrast around the required feature, not the brightest patch. Compare silhouette lighting for an exposed outline with diffuse front lighting for a recessed feature. Keep the fixture visible in the full image so an accidental fixture target can be recognized.
Prerequisites and sample controls
Define presence as a visible feature at a specified location, not merely any dark object in the frame. Prepare a correctly assembled sample, an intentionally missing feature and an obscured feature with recorded human answers. Keep fixture details and permitted part variation in the dataset. The fixed-station baseline distinguishes separated components by image contrast; it is not a general semantic recognizer and must not infer a hidden component.
Choose the camera route
A monochrome area-scan camera is a practical starting point for a fixed, contrasting feature. Use a global-shutter route when motion remains during exposure; a compact smart-camera route needs verified processing and I/O support. A color camera is justified when color is part of the decision. If depth or occlusion determines presence, a flat image alone cannot settle the question.
Run the controlled procedure
Use the same original parts when comparing light arrangements, and keep the camera, exposure and lens position fixed. Establish the region of interest in original-image coordinates and include every allowed loading position. A crop removes irrelevant background but cannot recover an invisible target. Check the full image before accepting a smaller ROI, especially when the fixture or part can move.
- Capture each control with backlight and diffuse front light where access permits.
- Mark the allowed feature envelope in original-image coordinates.
- Inspect the raw image and threshold mask for competing fixture regions.
- Replay all controls after choosing the light; then freeze the ROI.
Process map
Compare complete raw images before choosing a region. Lighting creates visibility; the ROI restricts where that evidence is evaluated.
- Full image
- Light control
- ROI
- Visible target
Record the evidence
Record light geometry, exposure, target/background intensity separation and ROI coordinates. Mark pixels clipped by glare rather than averaging them into a contrast score. The table defines physical controls; enter your observations for each light arrangement.
Prepare a contrast comparison that can expose a misleading light choice. For each accessible arrangement, put the present and missing controls at the same fixture position and keep their raw capture settings identical. Examine the assigned feature region together with an adjacent background region. Record whether the feature pixels remain distinct or overlap the background distribution; an average intensity alone can conceal glare and local shadow. Mark saturated patches directly on a copy of the original, preserving the untouched original alongside it. Move the controls through the allowed loading envelope and repeat the comparison. If a light reveals the feature only in the center position, document that limitation rather than treating the entire envelope as validated. Keep the rejected lighting arrangement and its failed image so a later maintenance change can be recognized.
| Control | Required observation | Decision boundary |
|---|---|---|
| P: feature present | Visible feature in its assigned region | Presence requires valid evidence |
| A: feature missing | Region visible; intended feature absent | Absence is a valid failure |
| O: feature obscured | Feature cannot be observed | Review; never infer presence |
Diagnose failed cases
An ROI that excludes the missing-feature location can make an empty assembly look acceptable. A dark screw or fixture edge can also impersonate the feature. Reject that arrangement or tighten the location definition. Morphological closing must not join a nearby fixture region to the target merely to produce one component.
Failure isolation
A target, fixture edge and saturated highlight are different image causes. Compare their raw appearance and mask rather than accepting any foreground.
- Target
- Fixture edge
- Glare
- Occlusion
Validate independently
Change only one light variable in each trial: geometry, intensity or ambient shielding. Compare raw image contrast, saturation and the resulting mask before changing a decision threshold. Save both the successful and unsuccessful arrangements. The useful choice is the one that separates relevant classes over the allowed variation, not the one that makes a single sample look attractive.
The selected light and ROI must separate visible presence from visible absence at every allowed loading position. Keep obscured cases unresolved. Repeat with ambient illumination at the expected extremes before treating the contrast as stable.
Then challenge the ROI independently of the light. Show the required-feature location on the full image and check the saved crop coordinates against it. Move the present control toward each allowed extreme and verify that the whole distinguishing feature remains in the region. Replay the missing control at those same positions and inspect any remaining foreground: identify whether it belongs to a fixture, dirt or the intended feature. An engineer should be able to explain why each counted region qualifies without referring to the desired final decision. If area filtering or morphology is necessary, retain the mask before and after that operation. The selected region is acceptable only when it removes irrelevant evidence without removing the very location where absence must be evaluated. Repeat this check after changing the light mount or fixture.
Continue the engineering handoff
Provide the light arrangement, ROI coordinates, raw frames and masks for review. Explain whether the task requires a silhouette or a top-surface feature before selecting Deyi Vision lighting and optics. Do not silently resize a crop; any coordinate or scale conversion must be explicit in the saved workflow.
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.
- Machine vision lighting basicsDeyi Vision
Illumination geometry determines whether a surface feature or silhouette is visible.
Checked - Image thresholdingOpenCV
Thresholding converts image intensity into a binary segmentation; this does not identify semantic objects.
Checked
Component and selection references
- Vision Inspection System
- Industrial 2D Cameras
- How to Calculate Camera Resolution for Inspection
- PCB Connector Pin Presence Inspection
- What Is Machine Vision?
- Machine Vision Systems
- Machine Vision System Components
- How Does a Machine Vision System Work?
- Industrial Barcode Readers
- Component counting: camera setup for separation
- Component counting: lighting and ROI boundaries
- Component counting: merged and split part diagnosis
- 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: isolate false-pass causes

