3D visionExplainer

3D surface pattern matching: locate parts from height data

How surface pattern matching works on 3D height data, the pixel size and anchor math that make it repeatable, what breaks it, and which sensor to use.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01What does 3D surface pattern matching actually do?
  2. 02How is matching height data different from matching 2D contrast?
  3. 03How many pixels does your height map need across the feature?
  4. 04How do you anchor downstream tools to a part that moves?
  5. 05What match score should pass a good part?
  6. 06Which sensor gives you the height map?
  7. 07What breaks a height-map match, and how do you fix it?
  8. 08When is a plain 2D match still the right tool?
  9. 09What should you check before you commit the recipe?
  10. 10Questions

A contour model can find a part in a height map even when the part lands somewhere different every cycle. That is the practical promise of 3D surface pattern matching: train once on a known-good part, then let the tool return each instance's position and rotation in every scan that follows. This guide explains how the matching works, how many pixels the height map needs, and how to anchor the rest of your tool chain to the result. It also covers which sensor type suits which part. The worked examples use millimetres and micrometres, so you can drop your own numbers straight in.

What does 3D surface pattern matching actually do?

It takes one contour model you trained on a known-good part and searches the height map for every place that shape occurs. Each instance comes back with X position, Y position and rotation, so every later measurement or inspection tool starts from where the part actually is.

The model is a small region you draw around a distinctive feature on one good scan. The tool extracts its contours — height step edges and slope breaks — and stores them as a shape signature. On each new scan it compares that signature with the contours found across the search region.

A match returns three values, X, Y and rotation, plus a score of how closely the found contours compare with the model; many vendor docs call this Match Quality. One tool instance can also report several finds in a single scan, which matters when a feature repeats: keys on a keyboard panel, connectors on a board.

Treat the match as the opening step of the recipe; everything downstream anchors to its pose. Keep the search region tight around where the part can physically be, because match time grows with search area. The same move that shrinks a 2D matcher's update time works here too.

How is matching height data different from matching 2D contrast?

The contours come from height steps and slopes rather than gray-level edges. The match therefore survives contrast reversal, shadows and reflections that break a 2D grayscale match, and it still finds the shape when a feature is recessed instead of raised.

A 2D matcher follows gray-level edges. Dim the light, move the illumination or change surface finish, and the 2D contour weakens or inverts — a dark marking on a light panel against the same marking polished bright. Height contours ignore all of that: a 0.4 mm step is the same contour whether its two sides are black, white or mirror-bright.

Shape reversal works the same way. A logo molded proud of the panel and the same logo sunk 0.2 mm below it carry one outline, so a single model often finds both. What height data cannot rescue is geometry the sensor never resolved: a step smaller than the height noise, or a slope too steep to return cleanly. If the contour is not in the map, no matcher will find it.

How many pixels does your height map need across the feature?

Plan on a pixel size no more than five times finer than your required locate accuracy. For a ±0.03 mm anchor you want pixels of 0.15 mm or less, because a clean contour match locates to about one fifth of a pixel.

The fraction is the whole sizing decision. With sharp height steps and low noise, a contour match interpolates along the found edge to roughly one fifth of a pixel; on soft, rounded or noisy contours budget one third to one half.

p_max = required accuracy / 0.2 N = field width / p_max

Worked example. A 60 mm cover must be located to ±0.03 mm so a downstream step-height tool reads true. It can shift ±10 mm either way and you keep 5 mm of margin at each edge, so the field is 60 + 2 × 10 + 2 × 5 = 90 mm across. Then p_max = 0.03 / 0.2 = 0.15 mm and N = 90 / 0.15 = 600 pixels. A 5 MP sensor with 2448 pixels across gives 90 / 2448 = 0.037 mm per pixel; one fifth of that is 0.007 mm, about four times tighter than the ±0.03 mm target. Even a 1.6 MP sensor at 1440 pixels lands at 0.0625 mm per pixel, or 12.5 µm of expected match error — still inside budget.

Set the height map's XY grid to the same pitch without adding distortion: the point cloud X, Y, Z resolution guide covers the settings. On a profiler the across-scan pitch is fixed by the sensor and the along-travel pitch comes from the encoder, so size the field in both directions.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

How do you anchor downstream tools to a part that moves?

Wire each later tool's origin to the match result every frame: the match returns X, Y and rotation, and a height or width tool pinned to that pose moves with the part, so its readings describe the part rather than the fixture.

Anchoring means the downstream frame is rebuilt from the match pose each scan instead of from a fixture position taught once. A step-height tool anchored this way reads the same whether the part sits centred or at the field corner; the height difference from a point cloud workflow is a typical downstream consumer.

Rotation needs its own budget, and it is the one engineers forget:

lever-arm error = radius × sin(rotation error)

At 0.1° of rotation error, a feature 40 mm from the match origin drifts 40 × sin(0.1°) = 40 × 0.00175 = 0.07 mm. A match that finds position to 10 µm can still cost seven times that at the feature if its rotation is loose. That is why the model should carry contours spread across the part rather than clustered at one end. It is also why the anchored frame must be set the same way every time — the reference coordinate system guide shows how to fix the origin so anchored tools inherit the pose cleanly.

What match score should pass a good part?

Set the pass line from trials: record the score on 20 known-good parts and on every reject type. Then place the threshold midway between the lowest good and highest bad score — 75 here, with good parts at 85–99 and the nearest reject at 60.

The score compares found contours with model contours; vendor docs call it Match Quality, match score or confidence. Its absolute scale is not portable between tools, so calibrate on your own line. In that example the threshold leaves 10 points of margin to the weakest good part and 20 to the strongest reject, so ordinary drift in illumination or resin moves the score without tripping the gate.

A known-good part that suddenly scores low usually means occlusion or missing height data rather than a bad part — the failure list below covers both.

Which sensor gives you the height map?

Laser profilers build the height map line by line and suit parts moving on a belt. Projected structured-light cameras capture the whole field in one shot and fit stationary parts with several instances. Time-of-flight cameras resolve millimetres, not micrometres, so they fit volume checks, not fine contours.

Sensor type How the map is built Best for Watch out
Laser profiler one profile per trigger, stitched along travel moving parts, tall relief, micrometre-scale steps encoder timing and mount alignment
Projected structured light full-field projection in one shot stationary parts, several instances per capture ambient light, shiny surfaces
Time-of-flight depth camera coarse depth frame presence, volume, logistics millimetre-scale depth, too coarse for small contours

Position matters as much as type: mount the sensor so the steepest contour you need stays inside its working envelope, and re-shoot the height map after any bracket change. The working distance and positioning guide walks through that geometry. Shortlist in the 3D sensors category or the camera finder; two profilers from the current line:

3D sensorsHikrobot MIS-DP3850-01P 3D laser profile sensorMIS-DP3850-01P
Type
Laser profiler
$12,379.00 · quotedView and quote
3D sensorsHikrobot MV-DP4180-03P 3D Laser Profile SensorMV-DP4180-03P
Type
Laser profiler
$12,389.00 · quotedView and quote

For a stationary part, a projected structured-light camera returns the whole field at once:

3D sensorsHikrobot MV-DPS200P-02 Projected structured-light 3D cameraMV-DPS200P-02
Type
Stereo / structured light
$8,829.00 · quotedView and quote

What breaks a height-map match, and how do you fix it?

Most failures come from the model, not the matcher: contours that move between parts, missing height data on steep or shiny slopes, and scale change. Many matchers lose lock near 5% size difference, so train on the real part family, not one champion part.

  • Contours that move. A neighbour's edge, a date code or a chamfer that shifts with each cavity trains straight into the model. Open the model editor and delete every contour you cannot find on a second good part.
  • Missing height data. Steep walls and glassy slopes return no height, leaving holes where the contour should be. Mask low-confidence pixels before matching — the confidence image bitflag guide decodes the flags — and keep the slope the model relies on exposed to the sensor.
  • Scale change. Near a 5% size difference many matchers lose lock; the scale invariance guide explains why and what fixes it. Teach one model per part size instead of stretching one model over a family.
  • Overlapping and occluded parts. Build the model from the portion that stays visible and expect the score to dip. Where partial data is the norm, a whole-cloud shape score such as the Hausdorff distance method tolerates it better.

When is a plain 2D match still the right tool?

When the feature is flat and its contrast is stable, a 2D grayscale match costs less data and runs faster. If the part gives you a crisp printed or molded edge that never flips dark-to-light, match in 2D and keep the 3D scan for the measurements that need height.

Height data costs scan time and bandwidth; grayscale costs a snapshot. A flat legend or molded inset under fixed illumination anchors just as well on a smart camera, leaving the 3D scan free for the tools that measure height. Where the region of interest should live is its own decision: the 2D vs 3D ROI guide sets out where each wins. And when the question is only 'is this surface dented or proud', skip matching entirely — 3D surface blob analysis runs on the height map directly.

What should you check before you commit the recipe?

Before you freeze the recipe, confirm three things on 20 mixed parts — different cavities, different positions in the field. Check that the match pose holds within tolerance, that the score separates good from bad with a gap, and that every anchored tool returns the same reading wherever the part lands.

Run the list with the part deliberately placed at each field corner and rotated ±10°:

  • Model hygiene. Every contour in the model reappears on all 20 parts; none belongs to a neighbour or a label.
  • Spread. The kept contours sit across the part, so rotation is constrained at the radius your lever-arm budget assumes.
  • Pose hold. Anchored tools return the same reading at every corner position and both rotation extremes.
  • Score gap. Good and bad scores leave room for the threshold; re-check after any lighting, resin or revision change.
  • Map quality. Dropout and low-confidence pixels are masked, and the XY grid matches the pixel pitch you sized the field for.
  • Search box. No larger than the part plus its shift envelope, so cycle time holds at rate.

Then wire the chain together:

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

Pick the sensor first and let the configurator walk the mount, controller and trigger chain in order. Send the part drawing and the anchor tolerance with your enquiry and the applications team will pre-check the numbers with you — expert support comes with every order.

Questions

Does a height-map match still work if the feature is recessed instead of raised?

Yes for shape reversal: the contour geometry is the same and the sign of the height step does not change the outline, which is why one model often finds both embossed and debossed versions. A true mirror-image part is different: left and right hands do not match each other, so teach a second model for the opposite hand or constrain orientation first.

How much of the part should the pattern model cover?

Cover roughly half the part with contours spread across it rather than a tight corner box. Contours at a larger radius from the centre constrain rotation better: two contours 15 mm apart give about three times the angular conditioning of two 5 mm apart, so a wide, sparse contour set beats a small dense one. Leave out anything that shifts: neighbour edges, labels, weld spatter.

Does the match give the part's height (Z) as well as X, Y and rotation?

No: the pose is in-plane, X, Y and rotation. Read Z from the height map itself after the match: take the mean height in a small patch at the matched origin, or run a height-difference tool anchored to the match pose. That keeps the Z reading tied to the part even when the part rides at a different belt height between frames.

How do I keep the match from slowing the cycle?

Search only where the part can be. Build the search region as part size plus twice the sum of maximum shift and conveyor jitter: a 40 mm part with ±15 mm of shift and ±2 mm of jitter needs a 74 mm square, not the whole frame. Match time grows with search area, so quartering the area makes the tool roughly four times cheaper — shrink the box before you shorten the model.