Skip to content
EARLY-STAGE RESEARCH CONCEPT · SYNTHETIC DEMONSTRATIONS ONLY
QualiEdge AI

Proof of concept

Python + OpenCV synthetic baseline

A reproducible Python/OpenCV script generates synthetic 720×440 component images, varies position and lighting, converts BGR→HSV, measures coloured-pixel ratios in five fixed ROIs (top_clip, lower_clip, seal, orientation, surface_mark) and returns PASS/FAIL — with REVIEW for extreme brightness (mean grey < 32 or > 156). It saves annotated images and a synthetic evaluation CSV/JSON.

No machine-learning model has been trained. Results on artificial images must not be described as accuracy on real factory components.

Output frames · seed 33

Input vs annotated, for all five scenarios

Rendered in your browser with the same engine as the simulator — like the OpenCV script's outputs/ folder.

Correct assembly · normal

input_normal.png
annotated_normal.png

Missing lower clip · missing_clip

input_missing_clip.png
annotated_missing_clip.png

Missing seal · missing_seal

input_missing_seal.png
annotated_missing_seal.png

Incorrect orientation · wrong_orientation

input_wrong_orientation.png
annotated_wrong_orientation.png

Visible red marking · surface_mark

input_surface_mark.png
annotated_surface_mark.png

In-browser evaluation

Run the synthetic evaluation

30 samples × 5 scenarios, brightness 0.75–1.25 (equivalent), jitter 6 px.

Reference run

Reference run of the original Python script

Verified outputs from python qualiedge_poc.py --evaluate --count 30. Synthetic only.

Samples

150

Rows = expected, columns = predicted
PASSFAILREVIEW
PASS3000
FAIL01200
Seed-33 ROI ratios
ScenarioROI ratiosResult
normaltop_clip 0.620 · lower_clip 0.588 · seal 0.424 · orientation 0.188 · surface_mark 0.000✓ PASS
missing_cliplower_clip 0.003✕ FAIL
missing_sealseal 0.065✕ FAIL
wrong_orientationorientation 0.000✕ FAIL
surface_marksurface_mark 0.155✕ FAIL

SYNTHETIC/ILLUSTRATIVE DATA ONLY. No machine learning model was trained.

Code excerpts

The whole rule set fits on one screen

qualiedge_poc.py · ROIs & HSV rangespython
# HSV ranges (OpenCV: H 0–179, S/V 0–255) and fixed ROIs (x0, y0, x1, y1)
ROIS = {
    class="s">'top_clip':     (184, 139, 306, 177),
    class="s">'lower_clip':   (184, 249, 306, 288),
    class="s">'seal':         (468, 166, 545, 250),
    class="s">'orientation':  (140, 280, 183, 326),
    class="s">'surface_mark': (315, 196, 409, 247),
}
HSV = {
    class="s">'teal':   ((80, 70, 60),   (95, 255, 255)),
    class="s">'orange': ((5, 80, 70),    (25, 255, 255)),
    class="s">'purple': ((120, 40, 55),  (160, 255, 255)),
    class="s">'red':    [((0, 100, 100), (8, 255, 255)), ((170, 100, 100), (179, 255, 255))],
}
qualiedge_poc.py · decision rulepython
def classify(image_bgr):
    grey = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2GRAY)
    if grey.mean() < 32 or grey.mean() > 156:
        return class="s">'REVIEW', [class="s">'Extreme brightness']
    hsv = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2HSV)
    r = {k: ratio(hsv, ROIS[k], RULES[k].colour) for k in ROIS}
    failed = [k for k, rule in RULES.items() if not rule.ok(r[k])]
    return (class="s">'FAIL', failed) if failed else (class="s">'PASS', [])
CLIbash
pip install -r requirements.txt   # opencv-python, numpy
python qualiedge_poc.py            # writes sample inputs + annotations to outputs/
python qualiedge_poc.py --evaluate --count 30

Known limitations

  • Brittle colour rules that depend on part colour and lighting
  • Fixed ROIs — any large shift breaks the checks
  • The missing_seal rendering changes a coloured region rather than modelling real elastomer
  • No real optics, lens distortion or fixture
  • No image registration / alignment step

What real validation needs

  • Industrial camera & lens
  • Controlled illumination
  • Stable fixture
  • Permissioned real samples
  • Defect taxonomy
  • Registration
  • Held-out test sets
  • Data-rights agreements
  • Cycle-time measurement