Dents, press marks and deep scratches are geometry faults: they change surface height, not colour. A greyscale camera sees them only while the lighting cooperates, and finish variation breaks that cooperation. A 3D sensor measures height directly, and detection is a computation you can run on any controller: fit a reference plane to a defect-free patch of the point cloud, compute every point's signed distance to that plane, threshold the residual against sensor noise, and segment what survives with ordinary blob analysis. This guide gives the formulas, the threshold rule, a worked example with the arithmetic shown, and the sensor choices that feed it, so you can size a station for a specific dent depth and defend the threshold.
The decision, up front
Fit one least-squares plane to a patch of surface you know is good, then flag every point whose perpendicular distance from that plane reaches five times the sensor's single-frame height repeatability. Keep only groups spanning at least three samples in each direction. That is the whole method.
The five-times rule comes from shot-to-shot scatter: repeatability is the height spread you get capturing the same flat patch again and again, so a residual five times larger is not scatter by any reasonable odds, and the three-sample width rule removes the speckle that survives. Dents present as compact blobs; deep scratches present as long, thin blobs under the same depth rule. Marks shallower than the rule detects belong in a 2D reflectance channel, covered later.
Where X1, Y1 and Z1 come from
A point-to-plane distance call needs one point and one plane. The point is never typed in: it is one element of the array your sensor exports. An area 3D camera returns a grid of rows and columns with a calibrated height at each cell, its factory calibration turning raw geometry into millimetres — the conversion walked through in depth map to real distance calibration for XYZ point clouds. A 2.5D system hands you that grid directly as a height map, the relationship 2.5D height map to 3D point cloud formalises.
A laser profile sensor returns one line of height per trigger; the encoder count supplies the second axis, and stacking profiles builds the grid. Export the cloud in a structured form that keeps grid order, as exporting a structured point cloud as XYZ and PNG shows, and the X1, Y1, Z1 triple a distance formula asks for is simply one cell of that grid. The units are millimetres because the sensor was calibrated that way; keep the plane coefficients in the same unit or the residual means nothing.
Fit the reference plane on good surface only
Least squares chooses the plane that minimises the sum of squared residuals over the points you give it:
Give it only defect-free surface. A dent inside the fit region drags the plane toward itself: a dent covering a tenth of the patch at 0.40 mm depth biases the fitted plane by roughly a tenth of that, 40 µm, and every residual shrinks with it. Fit on a border ring, a known-good lane or a masked patch away from the inspection zone.
For near-flat surfaces the vertical residual and the perpendicular distance differ only at second order: at a combined slope under 1 in 20 the correction is about 0.1 %, so use the simpler vertical residual. When the patch cannot be kept clean — edges, fixtures or welds sharing the view — a voting fit such as RANSAC finds the dominant plane instead, a trade-off examined in plane fitting on 3D point clouds: least squares vs RANSAC. The same fit powers 3D flatness inspection by plane fitting and measuring height difference from a 3D point cloud; defect detection reads the same arithmetic against a threshold instead of reporting it.
Residuals to a height map, then blobs
Compute the residual for every point, bin it back onto the sensor grid, and map the signed residual to greyscale — the mapping is shown in grayscale pixels to a signed height map. Threshold at the five-times rule, then run standard blob analysis over the survivors with three filters: area in samples, mean depth and aspect ratio. Length over width above about 5 marks a scratch; below that, a compact blob reads as a dent or press mark.
The lateral rule is the pixel arithmetic you already know from 2D cameras: samples across equals defect width divided by point spacing, and three is the floor for calling a shape at all.
Fit the plane on every capture, not once at commissioning: a fresh fit absorbs the tilt the part came in with, so the residual still isolates the dent — 3D surface blob analysis for dents on tilted parts works the same geometry. When a dark or shiny patch punches holes in the cloud, close them by merging depth frames into one gap-free point cloud rather than lowering the threshold, which admits noise everywhere to fix one hole.
Worked example: a 0.30 mm dent limit on a 60 × 60 mm steel panel
Inputs, each with its source:
- Reject limit from the drawing: any dent deeper than 0.30 mm rejects the panel. Where a drawing is silent, published steel plate surface defect acceptance criteria give a defensible starting depth.
- Sensor single-frame height repeatability: 20 µm, from the sensor's data sheet.
- Lateral point spacing: 0.10 mm across the panel.
- Reference plane fitted on a defect-free border: z = 0.010·x − 0.005·y + 0.400, in millimetres.
- Point under test, read from the exported grid: x = 7.9315 mm, y = 25.000 mm, z = 0.700655 mm.
Rule in words: flag the point when its perpendicular distance to the fitted plane reaches five times the repeatability, then confirm with the blob width rule.
- Plane height at the point: 0.010 × 7.9315 − 0.005 × 25.000 + 0.400 = 0.079315 − 0.125 + 0.400 = 0.354315 mm.
- Signed residual: 0.700655 − 0.354315 = 0.346340 mm.
- Perpendicular distance: 0.346340 / √(1 + 0.010² + 0.005²) = 0.346340 / 1.00006 = 0.3463 mm, about 346 µm.
- Threshold: 5 × 20 µm = 100 µm.
- Margin: 346 / 100 = 3.5 times the threshold, or 17 times the repeatability.
- Width check: the dent spans 1.0 mm, and 1.0 / 0.10 = 10 samples across, well past the three-sample floor.
Decision: the point clears the threshold 3.5 times over, so the panel rejects, and the blob confirms a real dent rather than speckle. At this setting the detection floor is 100 µm of depth and 0.30 mm of width: dents between 0.10 mm and 0.30 mm measure but pass, and anything deeper rejects.
The sensors that feed the method
The arithmetic does not care where the cloud came from; the sensor sets repeatability, point spacing and cycle time. Compare 3D sensors on those three numbers in the camera finder.
| Set-up | Part motion | Choose it when | Watch for |
|---|---|---|---|
| Laser profiler over a conveyor | Continuous, encoder-clocked | Parts stream past inline at belt speed | Encoder jitter; spikes on shiny patches |
| Galvanometer stereo camera | Still for one exposure | Stationary part, no motion hardware to add | One field of view per capture |
| Dome 2.5D station | Still, flat side up | Height and appearance from one capture | Flat parts sized to the dome |
A laser profiler returns one calibrated profile per trigger and the belt supplies the second axis. The MIS-DP3850-01P is a 3D laser profile sensor of this type, at home over a conveyor.
- Type
- Laser profiler
A galvanometer stereo camera sweeps its own beam across a stationary part, so one exposure yields a full area cloud — the answer in a cell with no conveyor. The MV-DLS300P-04 is a laser galvanometer stereo camera of this kind.
- Type
- Stereo / structured light
For flat parts, a dome-based 2.5D station adds the appearance channel to the height channel in one capture:
- Type
- 2.5D inspection
The 12 MP camera inside the 300 mm white-light dome catches shallow cosmetic marks while the height channel carries everything with depth, giving two defect lists from one trigger.
Run the pipeline where the data lands. A vision controller such as the MV-VC3301H-128G66 takes the sensor stream over GigE, fires the 2D channel's strobes from its 4 built-in light channels, and holds the compute budget for the plane fit and blob analysis inside the cycle.
When one plane is the wrong reference
Compare the surface's own height change with the dent depth before fitting anything. A panel that crowns millimetres across the field buries a sub-millimetre dent in form error, so fit local windows — one plane per small patch — or register each capture to the CAD mesh and threshold the distance to the mesh instead.
A bow that grows smoothly toward the panel edges is stock form, not damage: point cloud plane curvature tells the two apart by shape. A dent is local and steep-sided; bow is wide and smooth.
Scratches only a few micrometres deep carry no height signature next to the repeatability number above; catch them by reflectance instead. Light them with in-line illumination for specular parts, and where the 2D camera must also measure scratch length, a telecentric lens with a coaxial port such as the LS-TCL-2194 holds magnification constant across the field.
On mirror finishes, a specular return can spike isolated single points to heights no real dent reaches. Reject single-point blobs on the width rule; the bowl of a true dent spans many samples.
Checks before you order
- Height repeatability at least five times finer than the reject depth — divide the reject depth by five for the maximum, by ten for margin to trend below the limit.
- Point spacing no wider than the narrowest reportable defect divided by three.
- Scan time inside the takt: a profiler's capture time is part length divided by belt speed, so 300 mm at 150 mm/s takes 2.0 s.
- Height measuring range covering part tilt and fixture variation, not only flat-part height.
- A 2D reflectance channel planned for marks below the noise floor.
- The laser class and its enclosure or interlock designed into the station, with bracket stiffness that holds stillness during each capture — 3D camera mounting and capture stillness sets the requirement.
- One GigE link and controller budget per sensor.
- Handling damage found every shift is a process signal: surface protection that reduces assembly scratches costs less than the rejects it causes.
Start in the system configurator once the sensor class is clear, or send the reject depth, defect width and takt through the contact page — with those three numbers the choice narrows to two or three sensors quickly.
問題
Can a 2D camera find these defects instead of a 3D sensor?
Only the ones with no measurable depth. A mark deeper than five times your height repeatability belongs in the point cloud channel; anything shallower often shows no reliable height at all. Catch those by reflectance instead: coaxial or dark-field lighting on an area camera, reported as appearance defects rather than dimensions. Lines that reject on both cosmetic and functional grounds run the two channels side by side and merge the defect lists by position on the part.
Why does the fitted plane bend toward the dent?
Least squares weights every point equally, so dent points pull the plane down and shrink the residuals you are hunting. Fit on a masked defect-free patch, or fit twice: compute residuals, drop points beyond two sigma, refit once. When edges, fixtures or welds occupy more of the view than good surface does, switch to RANSAC, which votes for the dominant plane and ignores the outliers instead of averaging them in.
What height repeatability do I need to catch a 0.1 mm dent?
Divide the dent limit by five. A 0.1 mm limit needs 0.1 / 5 = 0.02 mm, so 20 µm single-frame repeatability; target 15 µm to leave budget for the fit itself. At 50 µm repeatability the five-times floor sits at 0.25 mm, and anything shallower reads as noise no matter how the plane is fitted. Buy repeatability for the defect you must catch, not the ones you would like to.
Do I need to average several captures?
Average when a residual lands between one and three times the threshold; capture once when it clears five. Averaging n frames cuts random height noise by about 1/√n, so four captures halve the scatter at the cost of four captures of cycle time. Merging frames also fills dropouts on dark or shiny patches, removing pinholes that blob analysis would otherwise count as small dents.
How do I tell a specular spike from a real dent?
Geometry tells them apart. A specular spike is one to three points tall, narrower than any tool mark, and it moves or vanishes when you tilt the part a degree. A dent is a smooth bowl many samples wide with consistent depth across neighbouring rows. A 3 × 3 median filter on the height map removes isolated spikes, and a width filter catches the rest.


