Purpose and operating boundary
Implement a color decision on a declared image format, while keeping semantic SKU recognition and approval of any cloud model separate.
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
Freeze source channel order, bit depth, object mask and allowed classes. Bind a local executable workflow explicitly; a browser template or review archive does not supply a runtime. 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. Color sorting and SKU recognition answer different questions. A color region may match a red reference while the item is the wrong size, label or package variant. Define whether the job sorts a physical color, verifies an expected SKU or requires both independent checks. Use color images with known channel order and keep exposure, white balance and light spectrum in the recipe. Test acceptable material lots, glossy surfaces, shadows and foreign products rather than only a clean reference swatch. Low saturation makes hue unreliable, and clipped highlights remove information that an algorithm cannot restore. Unknown, unobservable and mixed-color items need an explicit route. If semantic SKU recognition uses a model, validate that model separately from the color threshold and require approval before any cloud transfer. 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
- Convert with the correct input order and declare the HSV representation before setting ranges.
- For an 8-bit OpenCV trial, handle red across the circular hue boundary using H ranges 0–10 or 170–179; select saturation and value limits from source specimens, not a universal preset.
- Count matching valid object pixels, return Review when evidence is insufficient and retain the measured ratio.
- Evaluate semantic SKU separately with approved product identities; any cloud upload needs explicit data, provider, model and cost approval.
Interpret the trial
The hypothetical object contains 1000 valid pixels and 600 matching pixels, giving 60%. A declared trial criterion of 70% returns Review, not a forced red class. These illustrative hue ranges and ratio criterion require validation on the installed depth and products. Correct color alone cannot identify two same-color SKUs.
Recording worksheet
| Record | Value / observation | Interpretation |
|---|---|---|
| HSV trial representation | 8-bit; H [0,10] OR [170,179] | Illustrative red intervals, validate S/V |
| Match / valid pixels | 600 / 1000 | Ratio = 60% |
| Trial criterion | 70% | 60% < 70% → Review |
ratio = 600 / 1000 = 60%
60% < 70% -> ReviewTwo 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
- Using a hue range from a different pixel depth silently changes the class boundary.
- A high cloud confidence without an approved SKU mapping or usable object evidence must not authorize a physical route.
Acceptance and handover
Accept color logic with independent known and unknown specimens, then evaluate the separate product rule. Keep range, mask, executable package and any model revision bound to the result record.
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 - Thresholding Operations using inRangeOpenCV
HSV conversion and explicit channel ranges; not proof of Deyi runtime support.
Checked - Color Space ConversionsOpenCV
Explicit input channel order and depth-dependent color conversion semantics.
Checked
Component and selection references
- machine vision software
- Automated Visual Inspection
- Visual Inspection System Design Checklist
- Build an AI-assisted visible assembly workflow
- EAN-13 traceability: line acceptance
- EAN-13 traceability: decode and data rules
- Stable camera acquisition: buffers, timeouts and reconnection
- Accept and integrate a visible fill-level workflow
- AI-assisted workflow for a visible level proxy
- Link inspection records, images and part identifiers
- OCR labels: acceptance and PLC contract
- OCR labels: native workflow and exact match
- Accept and integrate open-package completeness checks
- Build an AI-assisted open-package completeness workflow
- Build a PLC–vision handshake with explicit states
- Seal and bead appearance: line acceptance
- Seal and bead appearance: workflow rules
- SKU color sorting: acceptance and unknown route
- Surface defects: acceptance and line output
- Surface defects: bounded AI evaluation
- Load-test latency from trigger to PLC decision
- Version and roll back the complete vision recipe

