You lower a pattern match score threshold to 50% and the part passes with an 83% final score. You raise it to 60% — still well below the result — and the match fails outright. Nothing changed: not the part, not the light, not the template. This is the most misread setting in geometric pattern matching, and it sends engineers tuning optics and lighting while the real gate sits inside the search itself. This explainer covers how the two-stage match works, the arithmetic that puts a floor under the coarse score, which numbers to use for candidate and acceptance thresholds, and when a falling score is a genuine defect signal instead of a search setting.
The decision, up front
Keep the candidate threshold at or below the lowest coarse score a good part ever produces, and gate pass/fail on the refined final score. For the case that brings everyone here — coarse hits around 50-60% that refine to 83% — that means a candidate threshold of 40-45%, an acceptance compare at 70-80% on the final score, and never a 60% candidate threshold. If a higher candidate threshold is mandatory, raise the coarse score itself: enable angle variation across the part's real presentation spread, loosen the coarse granularity one step, and re-run the same saved images while counting false candidates. Waiting for the fine stage to rescue the part cannot work, because a rejected candidate never reaches it.
Two stages, one threshold
A geometric matcher does not slide your template pixel by pixel across the scene. The first pass, the coarse search, subsamples the template edge points — typically every 4th to 10th — and tests them on a sparse grid of positions and rotation angles, typically in steps of 5-15°. Its job is speed: it discards nearly the whole search space and hands forward a shortlist. Every candidate that clears the score threshold then enters the fine pass, which uses the full edge set, interpolates position to a few hundredths of a pixel and angle to a fraction of a degree, and recomputes the score from scratch. That recomputed value, the 83%, is what the result register reports.
The threshold you configure belongs to the first pass. It is a candidate filter, not an acceptance limit. Some tools expose a search threshold and a separate acceptance score; many expose only the search threshold and leave the accept decision to your logic. Scores appear on a 0-1 or a 0-100% scale from tool to tool; the meaning is identical, and this article uses percent.
Why 60% rejects a part that scores 83%
Printed artwork on paper gives weak, broken edges, so the coarse pass finds the part at roughly 55% — low, but real. The fine pass locks position and angle and recomputes 83%. A threshold of 50% admits the 55% candidate and the refinement happens. A threshold of 60% discards that candidate before refinement runs: no match is left to score, and the tool reports failure or a zero result. The 83% never exists.
Two consequences follow. The gap between coarse and final scores is normal, and it is widest exactly where contrast is weakest — printed, textured or dimly lit parts. And a ten-point threshold change can flip a stable line from pass to no-match with no imaging change at all, which is why this setting belongs in the commissioning record next to exposure and focus.
The arithmetic that floors the coarse score
The coarse pass quantizes rotation, and quantization misaligns edges at the rim of the pattern. Three short formulas describe it:
Worked example with example sensor numbers. A 640 px sensor width viewing a 60 mm field gives a pixel size of 60 / 640 = 0.094 mm per pixel. A printed logo 30 mm across has a 15 mm radius, which is 15 / 0.094 = 160 px. With a 10° rotation step, an unlucky part sits half a step, 5°, from the nearest grid angle. Rim edges displace by d = 160 × sin(5°) = 160 × 0.0872 = 14 px, or 14 × 0.094 = 1.3 mm of arc. Against a coarse match tolerance t of 2 px, edges stay aligned only inside r_match = 2 / 0.0872 = 23 px — a 23 px core in a 160 px radius pattern.
An area ratio would predict a collapse to (23/160) squared, about 2%, yet real coarse scores for such a part land near 50%, because scoring kernels weigh gradient direction as well as position and degrade gracefully under a few degrees of rotation. The formulas bound the geometry, not the exact score. The practical reading: a half-step rotation costs a coarse score in the 40-60% band on a marginal-contrast part, and the fine stage, fitting angle to a fraction of a degree, restores it above 80%. That is the whole story of the 55% that becomes 83%.
Pixel size comes straight from field of view divided by sensor pixels; the camera resolution calculator gives it for your own sensor and field.
Which thresholds to set, case by case
Set the candidate threshold from data, not from the final score. Log the coarse score of good parts across a production run — most tools report it per candidate — and place the threshold 10-15 points below the logged minimum. Where a robot or PLC consumes the result, do the acceptance compare downstream on the returned score; reading X, Y, angle and score from a vision camera over a socket shows the wiring. The controller-side view of the same split — sorting parts on the score the camera returns — is covered in part sorting by score threshold in a robot controller.
| Case | Candidate threshold | Acceptance on final score | Note |
|---|---|---|---|
| Printed or low-contrast part, coarse hits 50-60% | 40-45% | 70-80% | 10-15 points under the logged coarse minimum |
| Machined, high-contrast, fixtured part | 60-70% | 80-90% | Coarse and final converge within a few points |
| One exposed threshold field only | Logged minimum minus 5 points | Downstream compare on the returned score | The single field is a candidate gate |
| Granularity loosened for presentation spread | 45% | 80% | Tighten the angle range and screen for false hits |
How to raise the coarse score instead
Three levers raise what the coarse pass sees, in order of payoff.
Enable angle variation. A fixed 0° search only works in a fixture. If parts arrive within ±8°, search ±12° so the grid brackets the spread. Search cost scales with the angle set: a full 360° sweep at 10° steps tests 36 angles, and at 5° steps it tests 72 — about twice the time — while ±12° at 6° steps tests 5 angles, roughly a sevenfold cut from the full sweep. The mechanics of the settings are covered in rotation and scale affine transform search; symmetric parts need the handling described in symmetric part orientation matching.
Loosen the coarse granularity one step. Where the matcher exposes a granularity control it is usually a coarse/fine pair; move the coarse value one increment toward wider tolerance — in several tool families that is a slightly higher coarse value — and re-run the same saved images. The automatic setting suits machine-made parts; hand-loosened values earn their keep in the print room. Every loosened setting also widens the door to wrong orientations, the failure mode behind fixing 180-degree false hits and tolerance settings, and the added candidates cost update rate, the trade behind shrinking the search region to speed the match.
Fix contrast before touching search settings. Weak edges cap the coarse score no matter how loose the search; on-board lighting, exposure and focus move both stages at once. Finer tolerance tuning past that point is pattern search sensitivity versus accuracy territory.
Where the match runs
The two-stage matcher is the same algorithm on a device and on a PC; what differs is where the tuning dialogs and the result logic live. Smart cameras and vision sensors run the match on their own processor, expose the granularity and threshold controls in their tooling, and switch results over I/O with no PC in the loop. For the printed-artwork case, an on-device matcher with its own light source attacks the contrast problem at the source:
- Interface
- GigE
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
Three on-device routes side by side:
| Specification | MV-SC6050C-08M-XBN | MV-SC5060XM-08M-WBN | MV-SC3050XC-16M-ATN-H |
|---|---|---|---|
| Function module | Vision Master Platform (include deep learning module) | Vision Master Platform (include deep learning module) | – |
| Communication protocol | TCP, UDP, MODBUS, Serial Port, PROFINET, EtherNet/IP, Fins, MC, FTP, etc. | TCP, UDP, Modbus, Serial Port, PROFINET, EtherNet/IP, Fins, MC, FTP, etc. | RS-232, TCP, UDP, FTP, PROFINET, Modbus, EtherNet/IP, MELSEC/SLMP, FINS, Keyence KV |
| Sensor type | CMOS, global shutter | CMOS, rolling shutter | CMOS, global shutter |
| Pixel size | 3.45 μm × 3.45 μm | 2 μm × 2 μm | 3.45 μm × 3.45 μm |
| Sensor size | 1/1.45" | 1/2.4" | 1/1.45" |
| Resolution | 2432 × 2048 | 3200 × 1920 | 2432 × 2048 |
| Max. frame rate | 80 fps | 15 fps | 40 fps |
| Gain | 0 dB to 18 dB | 0 dB to 34 dB | 0 dB ~ 15 dB |
| Exposure time | 16 μs to 1 sec | 72 μs to 150 ms | 6 μs ~ 1 sec |
| Pixel format | Mono 8, RGB 8 | Mono 8 | RGB 8, Mono 8 |
| Mono/color | Color | Mono | Color |
| Memory | 8 GB | 8 GB | – |
| Price | $3,449.00 · quoted | $1,629.00 | $1,809.00 |
All 3 share: Power supply 24 VDC; Humidity 20% RH to 95% RH (no condensation); Certification CE, KC. Values as printed in each product's data sheet; open a part for its drawing and full specifications.
The PC route keeps every tuning dialog on one screen and scales to multi-camera lines; the boxes built for it are the vision controllers:
- LAN ports
- 5+ LAN ports
- USB 3 ports
- 3-4 USB 3 ports
- Light outputs
- 4 built-in channels
- Memory
- 8 GB
The MV-VC3301H-128G66 bundles a VM6200Pro license with 4 built-in light channels, and its PCIe expansion slot leaves room for more camera traffic, so a single enclosure drives the light, the camera and the match.
When the falling score is real
If the candidate threshold is already low and the final score itself slides — 83% drifting toward 65% over days — the search settings are not the story. Falling final scores point at the image: print fade, an ambient light change between shifts, focus drift after a mechanical knock. Ambient leakage has its own playbook in controlling ambient light variation in pick and place vision. A second real cause sits upstream of the matcher: a template covering too few pixels makes coarse scores wander part to part, and the fix is the one in the template image too small error — more pixels on the part, not more tolerance in the tool. Trend the final score per cycle rather than the pass flag, and the two failure families separate cleanly: threshold artifacts are step changes, contrast and template problems are drift.
Checks before you touch the threshold
- Log the coarse score of ten consecutive good parts and write down the minimum.
- Set the candidate threshold 10-15 points under that minimum; 60% is wrong whenever the minimum sits near 55%.
- Put acceptance on the final score, as a band, where the result is consumed.
- Cover the measured presentation spread plus margin in the angle search before loosening granularity.
- Move granularity one increment at a time, re-running the same saved images and counting false candidates each time.
- Record the final threshold, angle range and granularity in the commissioning record beside exposure and focus.
Then build the station around the camera: the vision system configurator walks camera, lens, light and controller in one pass, the smart camera finder filters on-device matchers, and more matcher tuning lives under vision systems. For a line already built, send the logged coarse and final scores through the contact page and the threshold split is usually a one-reply fix.
Questions
Does the score threshold test the final match score?
No. In a two-stage geometric matcher the configured score threshold filters the coarse candidate pass; the score the tool reports comes from the fine pass afterwards. Use the threshold to keep every good part's coarse candidate alive, then do pass/fail on the returned final score in the camera's output logic, the PLC or the robot program. For printed parts, acceptance at 70-80% on the refined score is the usual split.
Why does a part with an 83% result fail at a 60% threshold?
Because the two numbers come from different stages. The coarse search found this part at about 55%; the fine pass then refined position and angle and recomputed 83%. A 60% threshold discards the 55% candidate before refinement runs, so the 83% is never computed and the tool reports no match. Set the candidate threshold 10-15 points below the lowest coarse score you log on good parts, which is 40-45% here.
What score threshold should I start from on a new line?
Start at 40-45% for low-contrast printed artwork and 60-70% for machined, high-contrast, fixtured parts. Then replace the starting point with data: log the coarse score of good parts across a run and set the threshold 10-15 points under the minimum. Where the tool shows a single threshold field, treat it as the candidate gate and compare the final score downstream.
How much does loosening the search slow it down?
Roughly in proportion to the candidate positions and angles tested. Doubling the rotation range doubles the angle count at a fixed step, and halving the step doubles it again; a full 360° sweep costs about seven times a ±12° range at 6° steps. Each granularity increment adds a similar step in cost, so loosen one increment, re-run the same saved images, and measure before going further.
Can I raise the final score instead of lowering the threshold?
Not through the matcher. The fine stage already fits position to hundredths of a pixel and angle to a fraction of a degree, so refinement has nothing left to give a candidate that was rejected. Contrast is the lever that moves both stages at once: light on the print, focus, ambient leakage. A rejected candidate is a threshold or search-range problem, never a refinement problem.

