You have a cloud of XYZ points and one question: how much higher is this surface than that one? The measurement itself is a reference plane and a subtraction, and any 3D tool that reads a PLY file can do it. The hard part is capture: a stereo rig that calibrates perfectly will still return a shattered disparity image on a flat, textureless part, because there is nothing for the two cameras to match. Below are the plane-fit method with the arithmetic, the reason passive stereo fails on flat surfaces, where a cloud's coordinates come from, and a height-resolution budget — about 1/1000 of the working distance — for committing to hardware.
The measurement: fit a plane, subtract a mean
Do not read the height difference as max Z minus min Z. Raw Z carries every tilt between part and sensor: one degree of tilt across a 100 mm face moves Z by about 1.75 mm (tan 1° ≈ 0.0175), more than most steps you chase. Fit a datum instead.
The fit absorbs mounting tilt; the mean over the raised region suppresses point noise, falling by √N for N points averaged. Use a robust fit if your library offers one, so edge points and scratches do not drag the plane. Measure perpendicular to the plane, not along the sensor Z axis: at 5° of tilt a Z difference overstates true height by 0.4% (1/cos 5° ≈ 1.004). Small, but free to avoid.
If the plane-fit residual shows smooth curvature rather than noise, the part or the scan geometry is bowed — point cloud plane curvature: diagnosing a bowed flat surface separates the two cases.
Why calibrated stereo still shatters on flat parts
Stereo depth is correspondence plus arithmetic: find the same physical point in both images, then convert disparity to depth with the calibration. Calibration maps disparity to millimetres; it cannot create matches. A flat matte metal, plastic or painted face offers the matcher no texture to lock onto, so the disparity image comes back in fragments — the exact failure of a rig whose calibration checked out. The part is the problem, not your calibration plate.
Two cures, chosen by part motion:
- Give the surface texture: project a speckle or line grating from a structured light so both cameras see the same artificial features. On a moving conveyor, pulse the projector to freeze the pattern — overdrive limits and timing are covered in strobe machine vision light: overdrive, duty cycle and timing.
- Replace correspondence with geometry: a laser profiler throws a line at a known angle and extracts height directly; nothing on the part needs to match.
Building the projection route yourself? Two mono cameras from the area scan cameras finder plus a pattern projector get you there, and the baseline that sets depth precision is chosen in choose stereo camera baseline distance for 3D vision. The wider sensor-type decision is walked through in industrial 3D camera selection: stereo, ToF or structured light.
Where the cloud and its origin come from
A laser profiler does not hand you a file of points from the head alone. Each exposure returns one profile — a row of heights across the laser line, usually with an intensity row beside it. An encoder advances the scan axis, the sensor SDK stitches profiles into a surface, and the export step writes a PLY: a standard container holding x, y, z (and often intensity) per point, readable by every serious vision and mesh tool. So a .ply from a laser triangulation capture is normal output — the SDK or your stitching code writes it.
The origin is whatever frame the writer used. Profilers typically emit sensor-frame coordinates — origin at the sensor reference, height along its Z axis, in millimetres — and stereo SDKs differ on whether Z starts at the camera or the calibration target. Check the export unit before anything else: a cloud written in metres opens 1000× too small in a millimetre tool, and that mistake reads as a scaling bug rather than a unit bug.
For the height measurement you do not need the sensor's origin at all. The datum plane from the first section is your origin, defined on the part and immune to remounts. The stereo equivalent — which reference Z is measured from — is untangled in stereo triangulation world origin: choosing where Z is measured from. One capture-side trap remains: encoder spacing sets lateral sampling, and a mismatched ratio stretches the cloud, as laser triangulation scan spacing: prevent stretched clouds shows.
The height resolution budget: 1/1000 of working distance
Commit to a planning number before comparing sensors: height resolution ≈ working distance ÷ 1000 for laser-triangulation and structured-light capture.
| Working distance | Height budget (WD ÷ 1000) |
|---|---|
| 100 mm | 0.1 mm |
| 200 mm | 0.2 mm |
| 300 mm | 0.3 mm |
| 500 mm | 0.5 mm |
The basis: datasheet repeatability is measured on a calibration target under fixed conditions. On a real part, subpixel line extraction, surface finish and calibration drift each take a bite; a 1000:1 distance-to-height ratio is the budget that survives the factory floor, not the lab number.
What moves it: a larger triangulation angle or stereo baseline buys height precision and pays in occlusion shadows beside steep walls; averaging over the region cuts only the random part, by √N; dark or specular finishes hurt extraction for laser and projected patterns alike — the extraction-side fixes are in laser line extraction noise: get a clean height line. Holding the sensor inside its distance window is its own discipline, covered in 3D camera working distance and positioning guide.
Worked example: a 1.0 mm pad step at 500 mm working distance
The case: a machined pad stands 1.0 mm off the surrounding face, drawing callout 1.0 ± 0.2 mm on the step, and the station offers 500 mm of mounting height above the conveyor. The inputs come from the drawing (step, tolerance) and the mechanical layout (mounting height).
The rule: budget = WD ÷ 1000, and go only when the step is at least 5× the budget — margin that leaves room for plane-fit residual and finish on top of the budget itself.
The arithmetic:
- At 500 mm: budget = 500 ÷ 1000 = 0.5 mm. Margin = 1.0 ÷ 0.5 = 2×. Two resolution elements across the step cannot support a ±0.2 mm callout. No-go.
- Averaging does not rescue it: the pad mean removes random noise, but calibration error and drift are systematic and stay put; at that distance the 0.5 mm budget is mostly systematic.
- Lower the sensor: at 100 mm, budget = 100 ÷ 1000 = 0.1 mm. Margin = 1.0 ÷ 0.1 = 10×. Pass, with room.
Decision: mount the profiler at 100 mm. Fit the datum plane on the surrounding face inside a fixture region, take the mean signed height over the pad, screen against 1.0 ± 0.2 mm, and confirm with 30 repeats on a machined master step before release.
Choosing the capture hardware
Three routes, matched to how the part arrives.
Laser profiler, part or sensor moving. The first choice for tight steps and conveyor flow, because the height axis lives in the sensor's geometry. For wide flat panels in one pass, a line-scan 2.5D system such as the MV-HLVS-16K100-L60 covers a 600 mm emitting area length at a 120 kHz sampling rate with 16K resolution. The intensity row beside the height row also feeds ordinary 2D checks — see how to create a 2D image from laser triangulation — and an end-to-end set-up appears in surface defect detection with a 3D laser line profiler.
Laser profile sensors for the moving-part route:
- Type
- Laser profiler
- Type
- Laser profiler
Projected structured light, part stationary. One shot captures the whole raised region with no encoder stitching:
- Type
- Stereo / structured light
Your own stereo pair plus a projector. Two mono area scan cameras and a 200 x 150 mm structured light supplying the matches the bare surface cannot:
- Size
- 200-400 mm
- Voltage
- 24 V
- Type
- Structured
The full sensor range is in the 3D sensors category, cameras for the stereo route come from the camera finder, and pattern projectors from the lighting finder.
Laser profilers and stereo 3D cameras
170 models · from $699.00Checks before you trust the number
- Flat-plate residual: scan a known-flat plate and fit the plane. The RMS residual should land under a third of your height budget; if it does not, the capture — not the part — is the limit.
- Repeatability: seat the same part 30 times. The spread of the step result must stay under a tenth of the tolerance band, the classic ten-to-one rule of measurement systems analysis.
- Region discipline: keep the datum region and the pad region 2-3 profile lines clear of the step edge, or both the plane and the mean pick up edge artifacts.
- Re-run both checks after any remount, working-distance change or sensor swap.
When a point cloud is the wrong tool
Steps below the budget: at 300 mm the budget is 0.3 mm, and finish or roughness callouts sit two to three orders of magnitude finer. That is stylus and profilometer work, approached from the machining side in measuring surface roughness on short machined parts.
Transparent and mirror parts defeat the method too: the line or pattern passes through or reflects away, and no budget survives that; change the wavelength, the angle, or the sensing physics. And when the question is presence, colour or print rather than a height, a 2D camera with the right lighting answers it for less.
Run your own numbers through the system configurator, or bring the callout, the part and the cycle time to the contact page and we will size the capture geometry and the margin with you.
Questions
How do I measure a height difference in a point cloud without a CAD model?
Fit a least-squares plane to the flat face around the feature and take the mean signed perpendicular distance of the raised region's points from it. Use a robust fit so edge points and scratches stay out of the datum, and keep both regions clear of the step edge. Report the mean together with the spread over repeat scans; a mean without a spread is an opinion, not a measurement.
Why does my calibrated stereo pair still give a shattered disparity image?
Because calibration converts disparity to depth but cannot create matches. A flat matte or shiny face carries no texture for the matcher, so correspondences fail and the disparity map fragments — the expected behaviour of a healthy rig on such a part. Project a speckle or grating pattern onto the surface so both cameras see the same artificial features, or switch to a laser profiler whose line gives the height geometry outright.
What height resolution can I plan on for laser triangulation or structured light?
Budget one thousandth of the working distance: 0.2 mm at 200 mm, 0.5 mm at 500 mm. A closer working distance and a larger triangulation angle tighten it; averaging N points on the region cuts only the random share, by √N. Treat the datasheet repeatability figure, measured on a calibration target, as the best case rather than the production number.
Where is the origin of a PLY point cloud, and what units is it in?
Whatever frame the writer used: profilers usually export their own sensor frame — origin at the sensor reference, height along its Z axis — in millimetres, while stereo SDKs pick their own Z reference. A file exported in metres opens 1000× too small in a millimetre tool. Fit your datum plane on the part and the sensor's origin stops mattering for the measurement.
Does a laser triangulation sensor write PLY files by itself?
The SDK streams one profile per trigger or encoder tick — a row of heights, usually with an intensity row beside it — and stitches the profiles into a surface as the encoder advances. The export step, in the SDK or in your own code, writes the PLY with x, y, z and often intensity per point. The sensor head alone never writes the file.
Can I measure a 0.05 mm step at 200 mm working distance?
No. The budget at 200 mm is 0.2 mm — four times coarser than the step itself, before tolerances even enter. With the same 1/1000 rule you would need the sensor within 10 mm of the surface for a 5× margin, which conveyor geometry does not offer. Commit to a close-range 3D geometry or a contact method for a step that fine.



