A tray arrives holding cover plates that differ only in how many holes are punched through them, and the cell has to route each variant to its own operation. A teach-based camera locate cannot do that in one pass: it returns the pose of the model it was taught, never a count of the regions it saw. This guide gives you the workflow that works on any locate tool that accepts several taught models: order the models so the part with the most features is searched first, make each hole a blob the camera can actually resolve, and prove the chain on mixed parts before it routes anything. It also shows where the ordered-model trick stops scaling and a programmable smart camera counting regions in one capture becomes the better tool.
Why one locate step cannot count holes
Teach-based locate is template matching. You show the tool a part, it stores the pattern, and every cycle it returns the pose and a match score of the model that fits best. The tool has no step that reports how many separate regions it saw, so "nine holes" is not a number it can produce.
The trap is subset logic. A model taught on a six-hole plate also locks onto a nine-hole plate, because all six taught features are present on it. Ask "is there a six-hole part?" and stop at the first hit, and the nine-hole plate gets routed as a six-hole part. The fix is not a higher threshold. The fix is the order in which you search the models.
Counting itself lives one tool downstream, in blob analysis: threshold the image, label the connected dark regions, count the labels. Closed locate nodes on wrist cameras and vision sensors do not expose that step; programmable cameras and SDKs do. One model used as a pass/fail gate is exactly the camera locate as a true/false presence check pattern, and it is the right tool until several variants share one presentation.
The ordering rule: search the part with the most features first
Teach one model per variant and run the chain from the variant with the most visible features down to the fewest. The first model that locks on is the part identity.
The order is fixed by the subset logic, not by preference. A part with more features can satisfy a model taught on fewer features, but a part with fewer features can never satisfy a model that expects the missing ones. Search the nine-hole model first and it cannot misread a six-hole part. Search the six-hole model first and a nine-hole part will sometimes answer. You cannot reorder the chain for speed; the speed levers are a tight search region and an acceptance score that fails a wrong model fast.
| Variant | Taught on | Correctly identifies | Misidentifies if searched first |
|---|---|---|---|
| A, 9 holes | 9 features | A only | nothing |
| B, 6 holes | 6 features | B only | A |
| C, 4 holes | 4 features | C only | A and B |
Worked example, expected runs per cycle. Line mix: A is 60% of parts, B 30%, C 10%.
One and a half locate runs on average, three at worst. Take 1.5 s per locate run as an example number for the arithmetic and measure your own: the chain averages 1.5 × 1.5 s ≈ 2.3 s and worst case is 3 × 1.5 s = 4.5 s. A wrist-mounted camera pays more; the guide on where a wrist camera's 5 to 7 seconds of locate time go breaks that figure down and shows which parts of it you can cut.
What you need
- One clean sample of every variant, plus the worst parts the line will show: oily, dull and slightly damaged.
- A fixture that presents the same face up, flat, at a repeatable distance and angle to the camera.
- Light matched to the face finish: diffuse bright field for matte faces, coaxial diffuse for shiny machined tops.
- A locate tool that accepts several taught models, or a programmable camera you can script a blob count on.
- A stop or a nest: the ordered chain presumes the part is still while the image is taken.
Set up the ordered locate chain
-
List the variants and, for every pair, write down the feature that disappears or moves: the three extra holes, the second tab, the wider slot. That feature is what each model has to anchor on.
-
Lock the presentation before any teaching: same face up, part flat, camera square to the face, and ambient light under control so a cloud or a work lamp does not shift the scores.
-
Teach the most-featured variant first, and teach the discriminating feature rather than the whole outline. A model built on the full plate silhouette sees every variant as the same part; a model anchored on the hole pattern and the orientation tab separates them. The approach in teaching a long thin part by its feature carries straight over, and parametric teaching for geometric parts speeds the locate up further where the tool supports it.
-
Teach the remaining variants in descending feature order, each from its own sample, under the same light and exposure the line will run. A model taught under different lighting will not reproduce its score on the line.
-
Set the acceptance score from measurements. Run 20 known-good parts and 20 wrong-variant parts under each model, record both score distributions, and put the threshold in the gap between them.
-
Chain the searches: model A, then B, then C, stop at the first lock-on, and no lock-on anywhere raises the reject flag. If a model locks onto the wrong variant, narrow its teach region around the discriminating features, or add a second feature such as the tab with the polygon tool so a subset match fails.
-
Send the result out as a part-identity flag the PLC routes on, not as a locate fault that stops the cell; triggering the feeder on a flag instead of a fault is the pattern to copy when a wrong part should be diverted rather than raise an alarm.
The pixel budget: can the camera see every hole
Blob counting, and model teaching too, needs each discriminating hole to stand alone in the image. Working rule: keep at least 10 pixels across the smallest feature that differs between any two variants. Below roughly 8 to 10 pixels the blob merges into edge shading, the area statistic gets noisy and the count flips between variants.
Worked example. Example inputs: a 5 MP sensor in the common 2592 × 1944 array, one plate per image, field of view 120 mm across.
- Pixels per mm: 2592 / 120 = 21.6 px/mm. The 5 mm holes span 5 × 21.6 = 108 pixels each and count reliably.
- Two plates per image widen the field to 300 mm: 2592 / 300 = 8.6 px/mm. The 5 mm holes now span 43 pixels, still fine; a 2 mm dowel hole spans 17 pixels, workable; a 1 mm slot spans 8.6 pixels, under the line. That variant needs a longer focal length, a tighter field or a higher-resolution sensor before its model is trustworthy.
Contrast decides whether those pixels are usable. On a flat matte face, diffuse bright field makes the face read bright and the holes dark. On a shiny machined top, plain bright field glares back; coaxial diffuse light down the camera axis keeps the face bright and the hole interiors dark — the same physics that makes coaxial diffuse win when the part sits inside a metal can.
If the pixel budget will not close after those fixes, run the part through the vision locate feasibility checklist before spending another afternoon teaching models.
When ordered models stop scaling
Every extra variant adds a run to the worst case, and nothing in the chain hides it. The ordered chain stays the right tool at two to four variants presented in a nest. Past about five, or when the variants arrive loose and at random orientation, move the identity decision into one capture on a programmable camera: threshold, blob-label, count, then check the spacing pattern against the variant table. Identity becomes arithmetic instead of a search, and cycle time stops growing with the variant count.
For that job, a programmable 6 MP mono smart camera on GigE runs the threshold-blob-count script on board — the MV-SC5060XM-08M-WBN, with an 8 mm M12-mount lens and a 1/2.4" sensor, is built for exactly this kind of single-camera inspection.
- Interface
- GigE
- Resolution
- 6-10 MP
- Sensor format
- 1/2.4"
- Shutter
- Rolling
If the parts never stop under the camera, prefer a global shutter: it takes the whole frame at one instant, while a rolling sensor smears a moving part row by row. The MV-SC3050XC-16M-ATN-H is a 5 MP color vision sensor with a global shutter on Fast Ethernet and an M12 mount.
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
For a single-part nest at a fixed working distance, the same job fits the small end of the range. The HK-TD032-12-WBN is a 1.6 MP mono vision sensor with a global shutter, a 1/2.9" sensor format and an M12 lens mount, and the pixel-budget math above tells you whether the smallest hole clears the line in your field of view.
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
- Sensor format
- 1/2.9"
- Shutter
- Global
The three side by side:
| Specification | MV-SC5060XM-08M-WBN | MV-SC3050XC-16M-ATN-H | HK-TD032-12-WBN |
|---|---|---|---|
| Communication protocol | 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 | RS-232, TCP, UDP, FTP, PROFINET, Modbus, EtherNet/IP, MELSEC/SLMP, FINS, Keyence KV |
| Sensor type | CMOS, rolling shutter | CMOS, global shutter | CMOS, global shutter |
| Pixel size | 2 μm × 2 μm | 3.45 μm × 3.45 μm | 3.45 μm × 3.45 μm |
| Sensor size | 1/2.4" | 1/1.45" | 1/2.9" |
| Resolution | 3200 × 1920 | 2432 × 2048 | 1408 × 1024 |
| Max. frame rate | 15 fps | 40 fps | 60 fps |
| Gain | 0 dB to 34 dB | 0 dB ~ 15 dB | 0 ~ 15 dB |
| Exposure time | 72 μs to 150 ms | 6 μs ~ 1 sec | 16 μs ~ 1 sec |
| Pixel format | Mono 8 | RGB 8, Mono 8 | Mono 8 |
| Mono/color | Mono | Color | Mono |
| Data interface | Gigabit Ethernet (1000 Mbit/s) | Fast Ethernet (100 Mbit/s) | Fast Ethernet (100 Mbit/s) |
| Digital I/O | 12-pin M12 connector provides power and I/O, including opto-isolated input × 3 (Line 0/1/2), opto-isolated output × 3 (Line 3/4/5), RS-232 × 1 | 12-pin M12 connector for power and I/O: 3 opto-isolated inputs (LINE0/1/2 input), 3 opto-isolated outputs (LINE3/4/5 output), 1× RS-232 interface; Device trigger via top button supported | 17-pin M12 connector provides power, Ethernet, serial port, and digital I/O, including non-isolated input × 1 (Line 2), non-isolated output × 1 (Line 3), configurable non-isolated I/O × 2 (Line 0/1), RS-232 × 1, and external button input × 1 (BUTTON) |
| Price | $1,629.00 | $1,809.00 | $1,699.00 |
All 3 share: 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.
Checks before you let it route parts
- Run 20 mixed parts, every variant represented, through the full chain and expect 20 correct identities and no rejects on good parts.
- Rotate one part 90° and 180° in the nest: the chain must hold the identity, which is the same discipline as setting up vision locate to survive rotation.
- Plug one hole with a piece of tape on the most-featured variant and confirm the failure lands where the warning above says it will.
- Lock the focus before teaching and leave it alone: a model taught on sharp images scores low on soft ones, and the focus-drift fix for a wrist camera that turns blurry shows why and how.
- Re-measure both score distributions after any change to light, lens or exposure, and move the threshold back into the gap.
- Time the worst case with the cell connected: last variant in the mix, full chain, plus the PLC handshake.
Which route to take
- Two to four variants, parts presented flat and stopped: ordered locate models, taught most features first. It is an afternoon of work on hardware you already own.
- Five or more variants, or loose parts in random orientation: a programmable smart camera counting blobs in one capture.
- A belt that never stops: global shutter and the single-capture count; the ordered chain presumes a still part.
Set the camera side up in the camera finder, browse the smart cameras range, or start the system configurator at the camera step. More workflows like this sit on the applications topic page.
Questions
How many variants can an ordered locate chain handle before the cycle time breaks?
Budget it the way the worked example does: multiply each variant's share of the line mix by its position in the chain, then multiply by the measured time per locate run. Five variants of roughly equal mix average three runs, so at 1.5 s per run that is 4.5 s on average and 7.5 s worst case. Past about five variants the search dominates the cycle, and the identity decision belongs in a single-capture blob count instead.
What if two variants have the same number of holes but different spacing?
Hole count alone cannot separate them, so make the spacing the taught feature. Anchor one model on the pair of holes whose center distance differs, teaching the region that spans both holes, so it scores high only at the right spacing. If the variants also differ in tab position, anchor on the tab instead. Parametric teaching is the cleaner route here: describe the pattern by spacing and shape, and the differing parameter carries the identity.
Should I paint the part white to get contrast before teaching?
Treat paint as the last resort, because it adds a process step that wears, chips and must be re-specified for production. Get contrast from the light first: diffuse bright field for a matte face, coaxial diffuse for a shiny machined top, and a short exposure to hold ambient light off the image. If the face still teaches poorly after that, a matte white coating on the top face is the workable fallback for dark castings.
Do I still need ordered models if each variant sits in its own pocket of the tray?
No. If the fixture guarantees which variant lands where, the pocket itself is the identity: run one presence-and-orientation check per pocket and skip the chain entirely. Ordered models are only needed when variants share one presentation and the camera alone has to decide. Keep one model per pocket even then — a single generic outline model across all pockets invites exactly the subset mismatches the ordering rule exists to prevent.
How do I set the acceptance score so a wrong variant cannot slip through?
Measure the gap, never accept the default. Run 20 known-good parts of that model's own variant past it, then 20 parts of every other variant, and record both score distributions. Put the threshold inside the gap. If the two distributions overlap, no threshold is safe: the image has to improve first — more pixels on the feature, more contrast, or a tighter search region — before the model can be trusted on its own.


