A part locator must answer two questions before inspection begins: which object is present, and where is its inspection coordinate frame? Color can help distinguish similar shapes, but it also introduces sensitivity to illumination and camera processing. This guide explains how to choose useful features, recover a rotated part's position, and validate the resulting inspection regions without confusing fine numerical output with physical accuracy.
Choose color only when it adds separation
Use color pattern matching when chromatic information separates the correct part from backgrounds or alternatives that have similar geometry. A colored insert, printed orientation mark, or differently colored connector body may resolve an ambiguity that grayscale contours cannot.
Prefer grayscale edges when the silhouette and internal geometry already distinguish the part. These features often remain useful despite changes in surface brightness, provided their contrast and visibility remain adequate.
A hybrid approach is frequently worth testing: locate geometry first, then verify color in a registered region. This separates pose estimation from identity checking and makes failures easier to diagnose.
| Approach | Useful when | Main limitation | First validation test |
|---|---|---|---|
| Grayscale or edge matching | Shape and internal features are distinctive | Similar outlines can produce competing matches | Add geometrically similar wrong parts |
| Color pattern matching | Color arrangement distinguishes otherwise similar objects | Lighting and channel processing can shift the appearance | Test allowed color lots and lighting variation |
| Geometry followed by color verification | Pose comes from shape, identity comes from color | Both stages need independently defined acceptance limits | Test correct geometry with the wrong color |
| Color segmentation followed by geometry | Colored regions provide a simple candidate search | Reflections and background colors can fragment or merge regions | Introduce background distractors and highlights |
Do not assume a color matcher uses chromatic information simply because it accepts a color image. Check its documented feature representation and preprocessing. For the distinction between raw channel values and meaningful color evidence, use the guide to machine vision colour inspection.
Stabilize illumination before training
Control the image before adjusting the matching threshold. A specular highlight can replace a colored feature with a bright reflection, while a deep shadow can remove useful channel separation.
For curved, reflective surfaces, dome lights can provide broad diffuse illumination. This can reduce localized reflections, although the camera opening and surrounding geometry may still appear in reflective parts. The guide to dome lighting for shiny and curved parts explains those limitations.
Review LS-DOM-0085 as a dome-light candidate. Confirm the emitting area, viewing clearance, selected color variant, and mounting arrangement against your application.
- Size
- 100-200 mm
- Voltage
- 24 V
For accessible parts with less troublesome reflections, ring lights offer another geometry to test. Diffusion can soften individual reflections, but a diffused ring is not equivalent to surrounding the part with a dome.
Review LS-RNG-0143 as a diffused ring-light candidate.
- Size
- 100-200 mm
- Type
- Diffused
- Angle
- 30°
- Voltage
- 24 V
For color discrimination, start with broadband white illumination rather than assuming a narrowband source will preserve the required color differences. Evaluate the actual part colors under the chosen source; nominally white sources can produce different camera responses.
Use the lighting finder to compare candidate geometries, then document light position and operating settings. A mechanical change to the light can matter more than a small threshold adjustment.
Specify acquisition and freeze the processing pipeline
Choose area scan cameras from the required field of view, feature size, exposure time, interface, and shutter behavior. Color capability alone does not determine localization performance.
For a color, global-shutter acquisition option, examine MV-CU020-90GC. Its catalog identifies a GigE interface and C-mount. This identifies acquisition hardware, not included pattern-matching software or a guaranteed localization accuracy.
- Sensor format
- 1/1.7"
- Lens mount
- C-mount
- Interface
- GigE
- Resolution
- Up to 3 MP
Compare acquisition requirements in the camera finder. Check software compatibility, pixel format support, triggering, and the lens image circle separately before committing to hardware.
Once the image is suitable, hold these settings fixed where production conditions permit:
- Exposure time and analog gain.
- White-balance channel ratios on color cameras.
- Gamma, tone mapping, and any color transformation.
- Pixel format, demosaicing method, and software preprocessing.
- Lens focus, aperture, and camera position.
Avoid clipping meaningful features in any channel. A grayscale preview may hide a saturated red channel that carries the identity information.
If automatic exposure is necessary, constrain its range and evaluate the entire permitted range. The explanation of which pixels control automatic exposure and gain helps prevent background changes from controlling the part's appearance. Read settings back after startup rather than assuming the saved configuration was applied.
Locate the part before inspecting it
Build the workflow around a stable part coordinate frame, not around fixed image rectangles. Otherwise, a valid inspection region can move onto the wrong feature when the part rotates.
- Define the required output. Specify the part origin, angle convention, allowed search area, permitted rotation, and whether scale variation is physically expected.
- Select stable training features. Include geometry or color boundaries that remain present on acceptable parts. Exclude variable printing, replaceable labels, and defects that the downstream inspection must detect.
- Restrict the search to plausible locations. Mechanical presentation usually provides useful bounds. Searching unnecessary background increases the opportunity for distractor matches.
- Evaluate candidate identity and pose. Apply documented score, feature-coverage, and geometric checks. Compare competing candidates rather than accepting the highest score without qualification.
- Transform the inspection regions. Move each downstream region using the accepted part pose, then inspect the expected features.
- Return an explicit failure state. Keep no-match, ambiguous-match, acquisition failure, and inspection failure distinguishable in the application logic.
Train from representative, well-focused images, then reserve different parts and captures for validation. Enlarging a template until it includes the fixture may improve an apparent score while making the locator dependent on the wrong object.
The guide to planar vision guidance provides related context for coordinate frames and presentation constraints.
Transform inspection regions with the recovered pose
For a planar part at approximately constant height and magnification, translation and rotation can map template coordinates into image coordinates. Define template feature coordinates relative to the trained origin.
Here, t_x and t_y locate the template origin in the current image. All coordinate distances must use consistent units. Document the angle convention because image coordinates commonly increase downward, which affects how positive rotation appears.
Apply the same transform to inspection regions and expected feature positions. Confirm that the software also rotates masks and handles pixels outside the image as intended.
Transforming region coordinates does not always require resampling the image. If you do create a rotated image, interpolation changes pixel values and can soften narrow features. Keep that processing consistent between training and production; the guide to antialiasing during image warping explains the sampling issue.
A rigid planar transform is not sufficient for large height changes, perspective changes, or deformable parts. Do not enable scale adjustment merely to conceal an unstable working distance.
Work through pixel and angle budgets
Start with the feature that must remain inside its inspection region. Calculate the image sampling, then allocate allowable translation and rotation error.
Consider a hypothetical horizontal field of view of 120 mm sampled by 2400 pixels. This is an application sizing example, not a specification for a listed camera.
Twenty pixels across a feature describes sampling, not the number of independent, sharply resolved details. Lens performance, focus, motion blur, and color reconstruction still affect the usable signal. The machine vision lens selection guide helps connect camera sampling to optical requirements.
Rotation error becomes more significant farther from the origin. For small angular errors, the tangential displacement is approximately radius multiplied by angle in radians.
At the example sampling, this corresponds to about 2.1 pixels. A region close to the origin might remain acceptable while a distant inspection window shifts onto the wrong edge.
Suppose a stationary repeat test produces a translation standard deviation of 0.1 pixel. Multiplying by 0.05 mm/pixel gives 0.005 mm of repeatability under those test conditions. It does not establish 0.005 mm measurement accuracy. Calibration error, distortion, bias, and presentation changes remain separate contributors.
Handle occlusion and ambiguous matches explicitly
Partial occlusion is not just a percentage of hidden template area. Hiding a unique orientation mark can be more damaging than hiding a larger, repetitive surface.
Test occlusion where production can actually hide features. Cover the origin neighborhood, distinctive corners, colored marks, and repeated structures separately. Include occluders that resemble valid features, not only uniform masks added in software.
There is no universal acceptable hidden fraction. A template with 25% of its area obscured may remain distinctive in one location and become ambiguous in another.
Rotational symmetry creates another limitation. A circular outline cannot define a unique angle by itself. A distinctive notch or color mark may resolve orientation, but losing that feature must produce uncertainty rather than a fabricated angle.
Match scores are generally tool-specific similarity measures, not calibrated probabilities. Examine the separation between the correct candidate and plausible alternatives. Define how the system handles multiple acceptable candidates, especially where adjacent parts overlap.
Validate against production variation
Create the validation set before final threshold tuning. Separate training images from held-out images by physical part or production lot where possible, not merely by saving neighboring frames from one stationary object.
A practical coverage matrix might include 8 rotations, 3 image positions, 3 production lots, and 2 permissible lighting settings:
Add intermediate angles and random presentations so the test does not favor a regular angular grid. Include wrong parts, similar colors, permitted surface variation, missing orientation features, and empty fixtures.
Record more than the acceptance rate:
- Position and angle error against an independent reference.
- Missed valid parts and accepted wrong parts.
- Ambiguous matches and incorrectly accepted poses.
- Downstream region placement at the most distant inspection feature.
- Acquisition-to-decision latency and its variation.
Use a calibrated reference when claiming physical accuracy. Repeatedly finding the same biased pose demonstrates consistency, not correctness. For position-dependent failures, the troubleshooting guide to intermittent localization errors offers useful isolation tests.
A finite test cannot prove that failures are impossible. With zero observed failures in 3000 independent, representative trials, the approximate one-sided 95% upper bound on the failure probability is 3 / 3000, or 0.1%. Correlated frames and untested production conditions weaken that interpretation.
Know when color matching is the wrong tool
Color is a poor primary locator when acceptable color variation overlaps the differences between target and distractor. It also becomes unreliable when the identifying region is frequently covered, clipped by glare, or too small to resolve consistently.
A geometry-first approach may be better when color verifies identity but should not determine pose. Conversely, segmentation may be sufficient when a large colored region reliably identifies the candidate and a separate geometric check confirms it.
Use multiple templates only for documented appearance classes. Adding templates to accommodate every failure can hide a lighting problem or increase confusion between similar parts.
Planar matching is also the wrong model when out-of-plane rotation changes the visible geometry substantially. Consider improved presentation, additional views, or depth information rather than expecting a wider rotation search to solve perspective changes.
Finally, localization and dimensional inspection have different acceptance criteria. A pose that places a generous inspection region correctly may still be unsuitable for precision gauging. Validate those tasks separately.
Checks before ordering and release
Use this checklist to turn a promising demonstration into a defined inspection system:
- Discrimination: show why color improves separation over grayscale on held-out images.
- Optics: verify field of view, smallest identifying feature, focus, and distortion.
- Lighting: confirm the chosen geometry preserves both color and stable boundaries.
- Acquisition: verify shutter behavior, exposure, triggering, and channel clipping under motion.
- Configuration: save settings, read them back after startup, and version the processing recipe.
- Pose: document origin, angle convention, search limits, and ambiguity handling.
- Inspection: test transformed regions at the greatest distance from the origin.
- Validation: retain representative images, independent references, error measurements, and failure examples.
- Integration: distinguish invalid acquisition, uncertain localization, and a genuinely defective part.
Start the camera configuration workflow with your field of view and motion requirements, or the lighting configuration workflow with representative part samples. For help selecting a testable combination, send the application requirements through the contact page.
Questions
When is color pattern matching better than grayscale matching?
Color helps when parts share similar geometry but differ in a stable colored feature or arrangement. Grayscale edges are often preferable when shape already identifies the part. Compare both approaches on held-out production images, including similar wrong parts, before choosing the additional complexity of color processing.
Can color distinguish parts with the same outline?
It can, provided the identifying color differences remain visible under the selected illumination and camera settings. White balance, exposure, channel clipping, and reflections can change those differences. A useful alternative is to locate the shared geometry first, then verify color in a registered inspection region.
Should automatic exposure and white balance stay enabled?
Fixed settings generally make template appearance easier to control. If production requires automatic exposure, limit its operating range and validate every permitted condition. White balance and other color transformations should remain consistent unless the complete adaptation process has been validated for identity and pose decisions.
Does subpixel localization mean subpixel measurement accuracy?
No. Subpixel output describes numerical position estimation, while accuracy concerns agreement with a physical reference. You must also evaluate calibration, lens distortion, systematic bias, focus, and presentation changes. Measure repeatability and reference-based accuracy separately, including angular error at downstream inspection locations.
How much partial occlusion can a locator tolerate?
There is no generally valid percentage. Performance depends on which features disappear and how distinctive the remaining evidence is. Test realistic obstructions at orientation marks, corners, and repeated structures. Reject uncertain poses when the remaining visible information cannot distinguish competing candidates.


