Code readingGuide

Barcode to part verification for similar assemblies

Build barcode to part verification around visible assembly features, CAD-guided recipes, camera sizing, ambiguous variants and reject logic.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01Define the acceptance decision before choosing hardware
  2. 02Use CAD to select observable differences
  3. 03Size the view around the distinguishing feature
  4. 04Choose a reader, smart camera or host-based camera
  5. 05Build recipes from real production images
  6. 06Prove separation between similar variants
  7. 07Bind the label and inspection to the same transaction
  8. 08Check the limits before ordering
  9. 09Turn the inspection specification into a shortlist
  10. 10Questions

A readable barcode can still be attached to the wrong assembly. Preventing that error requires two independent observations: what the label claims and what the physical part actually shows. This guide is for teams checking similar frames, brackets or welded assemblies before release to the next operation. You will learn how to turn a CAD library into inspectable differences, choose an imaging architecture, size the image and define a controlled reject path. The objective is not a general photograph-to-model similarity score, but a documented decision supported by visible evidence.

Define the acceptance decision before choosing hardware

Barcode to part verification compares the expected identity from a decoded label with independently observed assembly features. Reading the label establishes the claimed identity; it does not prove the assembly matches that claim.

Start with a recipe table containing the approved part identifiers and the features distinguishing each variant. For example, one assembly might require a left-side mounting tab, an open center hole and a connector bracket facing outward. Another might share the same outline but use a different tab position.

An acceptance rule can be expressed as:

Accept = valid transaction AND approved identifier AND correct recipe active AND acceptable image quality AND all required distinguishing features pass AND no forbidden feature is detected

A missing observation is not a passing observation. If a clamp hides the only distinguishing bracket, the result must remain unresolved rather than defaulting to the expected variant.

This identity check differs from dimensional inspection or weld-quality inspection. A correctly identified assembly can still have defects requiring separate checks. It also differs from confirming that a downstream device received the right code. For that handoff, use the transaction principles in barcode verification before picking with multiple robots.

Define the consequence of each result before purchasing hardware: accept, reject, controlled reinspection or manual disposition. Keep unresolved results out of the accepted-part flow.

Use CAD to select observable differences

CAD is useful for discovering where variants differ, estimating feature sizes and planning camera viewpoints. It does not automatically provide a production-ready photographic inspection recipe.

A rendered model and a camera image differ in illumination, surface finish, shadows, weld appearance and background. Models may omit manufacturing variation or include small details that are not reliably visible. Direct photograph-to-model matching requires suitable software, calibration and validation; do not assume it is included with a camera.

Build a variant matrix before training or configuring inspection tools:

Candidate feature Distinguishes variants? Visible from planned view? Main uncertainty
Overall frame outline Sometimes Usually Similar variants can share an outline
Mounting-tab presence Often Only without occlusion Clamps and overlapping members
Hole position relative to a datum Often With suitable contrast Perspective and manufacturing tolerance
Bracket orientation Often Viewpoint-dependent Edge-on brackets can disappear
Surface brightness Rarely dependable alone Lighting-dependent Finish, contamination and reflections

Select features with the greatest practical separation between variants, not merely the smallest CAD difference. Prefer stable geometry over incidental texture, markings or reflectivity.

Establish visible datums for locating the assembly before inspecting variant-specific regions. A fixture may constrain the part, but still allow small translations and rotations. Measurements should follow the located part rather than remain tied to fixed image coordinates.

Where possible, check two independent distinguishing features. This improves coverage only when they provide genuinely different evidence; two measurements of the same obscured edge do not solve the visibility problem.

If two variants look identical from the proposed viewpoint, change the view, expose another feature or add another identification method. No image classifier can recover a difference that the image does not contain.

Size the view around the distinguishing feature

Determine the smallest feature that must be distinguished and the largest field of view needed to contain every permitted part position. Total megapixels alone do not answer that question.

The following sampling estimate applies near the inspected plane, assuming approximately uniform image scale:

Required horizontal pixels = horizontal field of view × desired pixels across feature / feature width Object sampling = horizontal field of view / horizontal image pixels

Suppose the required horizontal coverage is 1200 mm, and a distinguishing feature is 4 mm wide. Choosing an initial design target of 8 pixels across that feature gives:

Required horizontal pixels = 1200 mm × 8 pixels / 4 mm = 2400 pixels

This is a starting target, not a universal inspection threshold. A high-contrast presence check and a precise edge-position measurement have different requirements. Blur, focus, lens performance and low contrast can make nominal pixels ineffective.

Use the camera finder to shortlist suitable image widths, and use the resolution calculator to check the sampling arithmetic.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

Field of view must include location variation and the datums used to align the inspection, not just the feature itself.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

For a hypothetical image width of 4000 pixels, the same coverage gives 1200 / 4000 = 0.3 mm per pixel. The feature would span approximately 4 / 0.3 = 13 pixels. That offers more sampling margin, but does not demonstrate sufficient optical resolution or depth coverage.

Test the nearest and farthest required features at the intended aperture and exposure. Angled or recessed features can appear smaller than their CAD dimensions suggest. A close-up second view may be more practical than increasing resolution across the entire assembly.

Choose a reader, smart camera or host-based camera

Select the architecture around both jobs: decoding the identifier and inspecting the assembly. Do not assume that a code reader can perform the necessary geometry checks, or that an inspection camera includes the required decoder.

Architecture Appropriate starting point Confirm before selection Main limitation
Fixed reader plus separate inspection device Label and assembly need different views Result association, triggering and interfaces More integration between devices
Smart camera Inspection can run on the device with supported tools Decoder, alignment, feature tools and recipe handling Tool availability and processing capacity vary
Area scan camera with host processing Custom inspection or model-based processing is required Software licensing, acquisition, processing and recovery More software and system integration

Fixed code readers address the label-reading role. The LS-CRD-0028 is a catalog candidate for that role. Confirm the required symbology, label view, triggering and result interface before selecting it.

Fixed code readers2560 x 2048 fixed code reader, 30 fps, 60 codes/s, 8 mm lens (LS-CRD-0028)LS-CRD-0028
Interface
Fast Ethernet
Resolution
5 MP
Sensor format
1/1.7"
Shutter
Global
$920.00View part

Smart cameras are worth evaluating when inspection should run on the device. The LS-SMC-0063 is a catalog candidate to evaluate for this architecture. Its catalog listing is not evidence that a particular decoder, CAD tool or recipe function is included; request confirmation against your inspection sequence.

Smart cameras & vision sensors1.6 MP smart camera, 60 fps, 16 mm lens, white light (polarized, transparent light) (LS-SMC-0063)LS-SMC-0063
Interface
GigE
Resolution
Up to 3 MP
$1,110.00View part

Area scan cameras provide another route when processing belongs in a host application. The LS-CMR-0166 is listed with USB3 and 4000 × 3000 resolution. Inspection software, decoding capability, optics and timing requirements need separate confirmation.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 (12 MP) resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

A separate reader is often useful when the label needs a close view while the assembly inspection needs wide coverage. A single image can simplify association, but only if both the barcode and distinguishing geometry remain readable throughout the permitted placement range.

Build recipes from real production images

Use CAD to propose the checks, then develop and validate them using images of actual assemblies. Include finish variation, normal weld appearance, approved tolerances and expected fixture variation.

A practical recipe-building sequence is:

  1. Define the approved identifier-to-recipe mapping, including revision handling.
  2. Locate the assembly using stable datums that exist across the relevant variants.
  3. Transform inspection regions into the located part coordinate system.
  4. Test required features and forbidden alternatives independently.
  5. Set explicit limits for image quality, location success and inspection confidence.
  6. Save representative pass, reject and unresolved images with the recipe revision.

Do not use the barcode label itself as the sole alignment reference for the physical inspection. A misplaced label could otherwise move the inspection regions away from the intended geometry.

Separate physical localization from result indexing. When software returns multiple detections, associate measurements using documented identifiers or coordinates rather than assuming the result order stays constant. The article on barcode detection coordinate indexing explains this class of association error.

Recipe activation also needs confirmation before capture. A requested recipe and an active recipe are different states. The timing approach in vision format selection timing helps prevent an image from being evaluated against a previous selection.

Record the active recipe revision in each inspection result. Otherwise, saved images may be impossible to interpret after limits or feature definitions change.

Prove separation between similar variants

Validate the boundary between variants, not just recognition of an ideal sample. For each expected identifier, present every visually similar wrong assembly and confirm it cannot pass.

Consider a hypothetical bracket-offset check. Variant A permits an offset from 18 mm to 22 mm; variant B permits 28 mm to 32 mm. The nearest allowed positions are separated by:

Minimum separation = 28 mm - 22 mm = 6 mm

If validated measurement error is bounded by ±1 mm under the tested conditions, the possible reported ranges become 17–23 mm and 27–33 mm. They retain a gap of 27 - 23 = 4 mm.

These are illustrative application values, not product accuracy claims. The error bound must cover calibration, part location, depth variation, edge detection and repeatability. If the expanded ranges overlap, that measurement alone cannot support an unambiguous decision.

Keep an unresolved band rather than forcing every measurement into the nearest variant. A part between expected ranges may be damaged, incorrectly assembled or outside the validated conditions.

Build a challenge set containing correct assemblies, each similar wrong variant, missing features, damaged labels and partially obscured parts. Include deliberately swapped labels: those samples directly test the error the system is intended to prevent.

Report wrong-part acceptances separately from unreadable labels and unnecessary rejects. For example, zero wrong-part acceptances in 200 challenge presentations describes that test result; it does not prove zero risk in future production. Retest after changes to fixtures, illumination, recipes or part revisions.

Bind the label and inspection to the same transaction

A correct decode and a correct image can still produce a wrong decision if they belong to different assemblies. Associate both observations with a transaction identifier generated for the inspection cycle.

For a stopped-part station, the sequence might be: confirm part present, establish the transaction, acquire the code, activate and acknowledge the recipe, acquire the inspection image, evaluate, then release the result. Confirm that the assembly cannot be exchanged unnoticed between those observations.

For moving parts, association requires validated tracking through the station. Timing alone may be insufficient when parts stop, slip, overlap or change spacing.

Use explicit outcomes rather than a single reusable pass bit:

Condition Inspection outcome Process action
Approved code and matching visible features Match Permit the defined release sequence
Valid code but conflicting geometry Mismatch Reject or hold for disposition
Unreadable or unapproved code Unresolved Hold or route for controlled reinspection
Occlusion, poor image or ambiguous features Unresolved Do not infer identity
Timeout, disconnect or stale transaction Invalid cycle Clear acceptance and require recovery

An acceptance result should apply only to its transaction and be consumed once. Clear it at cycle start, after completion and during defined recovery states. Repeated communication must not create repeated releases; barcode scan event handling without recursive updates covers related event-handling problems.

Where reject confirmation is required, monitor whether the rejected assembly actually left the accepted flow. A reject command alone is not evidence of successful removal.

Check the limits before ordering

The usual answer is not always a higher-resolution camera. A different fixture position, clearer silhouette or second viewpoint may provide better evidence with less processing.

Use this checklist before committing to hardware:

  • List every approved variant and the visible differences separating its nearest alternatives.
  • Confirm those differences remain visible with the production fixture, clamps and allowed placement variation.
  • Calculate sampling at the least favorable feature location, then test actual image quality.
  • Confirm lighting reveals geometry without depending on unstable reflections.
  • Verify decoding, inspection tools, licensing and interfaces for the selected architecture.
  • Test wrong labels on correct parts, correct labels on wrong parts and unreadable labels.
  • Check duplicate results, interrupted cycles, startup states and communication recovery.
  • Define unresolved-part handling, reject confirmation and authorized recipe changes.

If decoding is unreliable, address acquisition before adjusting geometry thresholds. The guide to 1D barcode preprocessing for rotation, blur and glare helps separate label-image problems from inspection problems.

When several labels may appear together, define which identifier belongs to the assembly. The guide on multiple QR codes not reading addresses image and search checks relevant to that situation.

If distinguishing geometry is hidden, internal or identical between variants, use additional evidence such as another view, a validated measurement or a controlled upstream identification step. Do not claim physical verification from label agreement alone.

Turn the inspection specification into a shortlist

Prepare a small application package containing the variant matrix, annotated CAD views, real sample images, field of view, smallest distinguishing feature and cycle sequence. Include the wrong-part examples the system must reject, not only ideal assemblies.

Start the camera configuration once the imaging requirements are defined. For an architecture review, send those requirements through application support so the discussion can focus on observable differences, supported tools and transaction behavior.

Questions

Can a fixed barcode reader verify the physical assembly?

Only if the reader includes suitable inspection tools and those tools are validated against the distinguishing geometry. Decoding alone confirms label content. A separate inspection camera may be necessary when the barcode and assembly features require different viewpoints, image scales or lighting.

Can a CAD library replace production inspection images?

CAD can identify differences, estimate feature sizes and help select viewpoints. Direct model-to-image comparison requires appropriate software and validation with real parts. Many applications are better served by checking a few observable features than by comparing the entire photographed assembly with a rendered model.

What should happen when similar variants cannot be distinguished?

First establish whether the difference is actually visible and adequately sampled. Improve the viewpoint, fixture or lighting when necessary. If the features remain ambiguous, add an independent observation or identification step. Keep uncertain results unresolved rather than selecting whichever recipe receives the highest similarity score.

How do you prevent a previous inspection result from accepting another part?

Use a transaction identifier that binds the decode, active recipe, inspection image and final result. Clear acceptance at defined cycle boundaries, reject late responses and consume each release decision once. Validate interrupted cycles and reconnections so a previous result cannot authorize the next assembly.

How much camera resolution does assembly verification need?

Begin with the smallest distinguishing feature and required field of view. Estimate pixels across that feature, then validate contrast, focus, motion blur and measurement repeatability. More pixels can improve sampling, but cannot reveal hidden geometry or compensate for an unsuitable viewpoint.