Purpose and operating boundary
Build a registered reference-difference baseline and compare a bound candidate without turning anomaly scores or AI suggestions into confirmed defect answers.
This tutorial defines an engineering evaluation, not a ready-to-run product certification. The current Deyi Vision public PC example covers an EAN-13 workflow on confirmed sample images. Native OCR and detection work in the engineering code must be checked against the installed runtime, bound models and job before use. A browser template does not prove browser execution: the planned OpenCV.js backend needs separate verification. Cloud recognition requires explicit approval of the image scope, provider, model and cost. A review archive is not an executable release package. Camera, firmware and driver compatibility require their own check. All worksheet values below are hypothetical; they are not Deyi Vision measurements or customer results.
Prepare the evidence
Keep the good reference, registration datum, exclusion mask and defect labels in separately versioned records. Confirm the selected backend actually implements each requested node. Check the intermediate output against its contract before interpreting the final flag. A missing region, malformed text field, invalid coordinate or non-finite numeric value must remain an explicit failure, not a default good result. Record the actual execution backend and dependencies used for that run; do not transfer acceptance from another backend with the same template name. If a new model or preprocessing revision is selected, preserve the previous version and rerun the fixed comparison rather than combining results across identities. Present the complete number of attempted cases, how many returned usable evidence and the decision made for the remainder. These quantities describe coverage and failure handling as well as recognition quality. A surface-defect station must distinguish a material defect from a change in viewing conditions. Scratches, dents, oil, texture and a reflection can produce similar intensity changes, yet require different dispositions. Prepare acceptable parts from the expected finish range and defect samples with recorded locations and orientations. Choose a datum that remains visible when the surface changes. A reference image is useful only after its pose and illumination are comparable with the current part. An image difference is not a physical depth measurement, and a detected region does not by itself identify a defect mechanism. Decide whether dirt is a reject, a cleaning request or an excluded condition before collecting answers. Store original views of ambiguous samples rather than inventing a clean reference or a corrected label. Treat a workflow as a sequence of typed decisions, not as a single model answer. Bind the input identity, region transform, node versions, preprocessing and model package before running an experiment. Separate parameter selection on development images from evaluation on a frozen set whose answers were not used for tuning. Keep the baseline and candidate results for every case, including unsuccessful execution. An AI suggestion can propose a revision but cannot confirm the reference answer, grant data upload permission or approve production use. If a provider call has an uncertain receipt, preserve the request identity and investigate that receipt before considering any resend. Runtime availability, recognition quality and release approval are independent checks.
Procedure
- Register source and reference using a stable datum before subtraction; review the transform on both images.
- Inspect the difference image before thresholding and morphology so that registration edges are not mistaken for scratches.
- Compare a candidate on development data, then freeze it and evaluate the untouched defect and good-part set.
- Route missing registration, absent dependencies and unobservable surfaces to Review or Error, never a default good verdict.
Interpret the trial
For the hypothetical set, 2 of 10 defects are missed and 1 of 20 good parts is rejected. Report both denominators. An anomaly score is not a defect probability; unbound segmentation or anomaly models are outside this executable trial.
Recording worksheet
| Record | Value / observation | Interpretation |
|---|---|---|
| Defect cases | TP = 8; FN = 2 | Miss rate: 2 / 10 = 20% |
| Good cases | TN = 19; FP = 1 | False reject: 1 / 20 = 5% |
Two engineering views
Two engineering views · 1
The diagram shows the order of checks. Each arrow requires recorded evidence; it does not imply an implemented automatic connection. Input identity → Bound nodes → Result contract → Review.
- Input identity
- Bound nodes
- Result contract
- Review
Two engineering views · 2
The diagram shows the order of checks. Each arrow requires recorded evidence; it does not imply an implemented automatic connection. Development → Frozen evaluation → Candidate → Approval.
- Development
- Frozen evaluation
- Candidate
- Approval
Failure diagnosis
- A ring around the part silhouette suggests registration or scale error rather than an entire defective surface.
- A kernel that removes the narrow scratch improves the image appearance while destroying inspection evidence.
Acceptance and handover
Retain the baseline when the candidate has no demonstrated benefit. Freeze reference, transforms, mask, node/model identities and the complete confusion matrix before approval.
Keep the source images, the expected decision, the exact revision and the complete result record together. Freeze the evaluation set before selecting the final parameters. If those answers are later used to tune the workflow, mark that set as development data and obtain a new independent acceptance set. Keep Review, NoResult, execution error and missing acquisition visible in the denominator; do not turn them into passes by filtering rows. Save a reproducible failure alongside the successful sample. The handover should identify who may change the recipe, how a prior approved revision is restored and which device output remains inhibited until acceptance. A software result alone does not establish that a moving physical part reached the correct destination.
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.
- Deyi Vision machine vision software: evaluation scopeDeyi Vision
Public EAN-13 PC evaluation scope and separate hardware/production acceptance.
Checked - Operations on arraysOpenCV
Explicit array operations including absdiff and inRange; a vendor-neutral workflow must validate type, shape and independent test data.
Checked - Morphological TransformationsOpenCV
Opening/closing change binary foreground geometry; verify kernels against the smallest relevant feature.
Checked - Inspection threshold confusion matrixDeyi Vision
Use explicit false-positive/false-negative denominators and independent evaluation; do not hide Review, errors or missing acquisition.
Checked
Component and selection references
- machine vision software
- Reflective Metal Scratch Inspection Lighting Route
- Automated Visual Inspection
- Machine Vision Lighting
- How to Choose Machine Vision Lighting
- Machine Vision Lighting Types
- Machine Vision Lighting Basics
- Backlight vs Coaxial Lighting
- Automotive Metal Surface Defect Inspection
- Metal and Surface Inspection
- OPT Lighting Alternative
- EAN-13 traceability: lighting and quiet zones
- Lighting and ROI for a visible liquid boundary
- Calibrate flat-field shading without hiding bad data
- Compare red, blue and white illumination by defect contrast
- OCR labels: light and field geometry
- Choose lighting and ROI for open-package contents
- Run a polarization A/B test for glare
- Seal and bead appearance: lighting and ROI
- SKU color sorting: light and object mask
- Verify the optical strobe inside the exposure window
- Surface defects: acceptance and line output
- Surface defects: camera sampling and motion
- Surface defects: light and ROI validation
- Surface defects: false-alarm diagnosis

