Skip to main content

Owned specimen · synthetic images

Show where the vision rule fails.

A small conventional image-processing example: count separated dark shapes, then change the input. Every pixel is generated. This is not a camera trial, a trained model or evidence of customer accuracy.

A count is only useful inside its limits.

The task is to locate three generated target rectangles in a 320 × 180 pixel image. A fixed intensity threshold separates dark pixels, and a four-neighbour connected-component pass groups them. Size and rectangular fill rules select candidates. A border brightness check can withhold the count before processing.

The detector receives pixels only. Known target boxes are used afterwards to compare its output with the constructed labels. A contaminant can satisfy the same rules as a target; the algorithm does not understand what an object is.

Dark pixel
Intensity below 100 / 255
Component area
600–1600 pixels
Rectangular fill
At least 85% of its bounding box
Lighting gate
Border median at least 180 / 255

These thresholds are selected for this example. They have not been calibrated against physical parts, camera noise or a representative dataset.

Case 01 · synthetic input

Separated shapes

Three dark rectangles on an even light background.

Generated input: Three dark rectangles on an even light background.
Input · three labelled targets. The labels are separate from the image given to the detector.
Processing output: 3 candidates reported. matches constructed labels.
Result · cyan boxes: accepted components. Orange boxes: rejected components. An orange outer frame means processing was withheld.

Reported count

3

Compared with labels

3 matched · 0 false positive · 0 missed

Border median

235 / 255

One-to-one bounding-box matching at IoU >= 0.5 against three generated target rectangles. Lighting gate passed; report qualifying dark components.

Case 02 · synthetic input

A false positive

A fourth dark rectangle represents contamination. Its size passes the same rule as a target.

Generated input: A fourth dark rectangle represents contamination. Its size passes the same rule as a target.
Input · three labelled targets. The labels are separate from the image given to the detector.
Processing output: 4 candidates reported. fails constructed labels.
Result · cyan boxes: accepted components. Orange boxes: rejected components. An orange outer frame means processing was withheld.

Reported count

4

Compared with labels

3 matched · 1 false positive · 0 missed

Border median

235 / 255

One-to-one bounding-box matching at IoU >= 0.5 against three generated target rectangles. Lighting gate passed; report qualifying dark components.

Case 03 · synthetic input

Two objects become one component

A dark bridge joins two target rectangles. The merged component is rejected by the size and fill rules.

Generated input: A dark bridge joins two target rectangles. The merged component is rejected by the size and fill rules.
Input · three labelled targets. The labels are separate from the image given to the detector.
Processing output: 1 candidates reported. fails constructed labels.
Result · cyan boxes: accepted components. Orange boxes: rejected components. An orange outer frame means processing was withheld.

Reported count

1

Compared with labels

1 matched · 0 false positive · 2 missed

Border median

235 / 255

One-to-one bounding-box matching at IoU >= 0.5 against three generated target rectangles. Lighting gate passed; report qualifying dark components.

Case 04 · synthetic input

Lighting gate withholds the count

The whole background is darkened. The border check fails before component counting.

Generated input: The whole background is darkened. The border check fails before component counting.
Input · three labelled targets. The labels are separate from the image given to the detector.
Processing output: count withheld. withheld.
Result · cyan boxes: accepted components. Orange boxes: rejected components. An orange outer frame means processing was withheld.

Reported count

Withheld

Compared with labels

Not scored as a detection

Border median

140 / 255

No count issued; this is not a successful inspection. Border median below the declared lighting threshold.

Reproduce all four cases.

Download the Python source and run the command below. Python 3 is the only dependency. The script generates its own inputs, processes them, records the results and checks that the demonstrated failures still occur. It makes no network requests.

python3 cv-inspection-specimen.py --output cv-output
python3 cv-inspection-specimen.py --output cv-output --check

The results include a source SHA-256 and hashes of the input PNG files. The check compares regenerated files byte for byte in the same Python environment. PNG compression may differ between zlib versions; algorithm counts and component measurements should remain unchanged.

What this does not establish

  • Four constructed cases, not an accuracy benchmark or representative dataset.
  • Fixed thresholds are chosen for these shapes; no model training or semantic object recognition.
  • The border lighting rule only observes the border and cannot detect every lighting failure.
  • The count does not control equipment or certify product quality.

The lighting guard catches the deliberately darkened case; it does not fix the false positive or the joined-object failure. A real feasibility assessment needs representative images, independent labels, camera and lighting evaluation, and agreed consequences for errors and withheld results.

Start with your inspection task.

Describe what needs to be seen or measured, the operating conditions and what happens when the result is wrong. We can scope an evaluation before selecting a production approach.

Discuss a vision workflowComputer vision scope and deliverables