3D visionGuide

Surface defect detection with a 3D laser line profiler

How a 3D laser line profiler finds and measures surface defects from height, not contrast — detection thresholds, profile-rate math, a worked example.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01Measure height, not contrast
  2. 02How the laser line becomes a height map
  3. 03The three numbers that size the head
  4. 04From height map to defect list
  5. 05Worked example: 300 mm web at 0.5 m/s
  6. 06Profiler, snapshot 3D or 2D: choosing the route
  7. 07Checks before you order
  8. 08When the profiler is the wrong answer
  9. 09Field checklist
  10. 10Questions

You have a surface, defects of unknown number and size, and a three-part job: find every defect, localize it, report its area. Morphology on a 2D image looks like the obvious start, but it inherits every weakness of the lighting — the same dent can disappear under a slightly different sheen, and subtraction against a golden image calls every alignment ripple a defect. The reliable route is to stop imaging contrast and start measuring geometry. A 3D laser line profiler sweeps a calibrated height map over the surface, and a defect is simply material above or below a fitted reference plane. This guide gives you the numbers to size the head, the algorithm that turns the height map into a defect list, and the decision for each hardware route.

Measure height, not contrast

The defect you photographed is geometry: a pit, dent or groove that deviates from the surface around it. A 2D camera sees it only through changed scattering, and scattering moves with finish, sheen, gain and ambient light — which is why a morphology chain works one day and fails the next. Golden-image subtraction adds a second failure mode: every sub-pixel position drift of the part becomes a defect call. How those false calls behave, and what tempers them, is covered in image subtraction false defects: reduce contour artifacts.

A laser line profiler measures the surface itself: every point comes out as a calibrated height. Detection then reduces to one question — which points sit further from a fitted reference plane than three times the noise? That test does not care about finish or lighting, and its output is exactly your deliverable: x-y position, area and depth. When a defect has any depth at all, this is the route. The head classes are in 3D sensors.

How the laser line becomes a height map

A triangulation head throws a laser line across the part and images it from an angle inside the same housing. Height moves the line sideways in the image; the head converts that shift to millimetres per profile point and outputs one calibrated profile — an array of N heights — per trigger. Scan the part under the head, stack profiles against encoder counts, and you have the height map. The capture chain end to end, including turning profiles into an image, is in how to create a 2D image from laser triangulation.

Across commercial heads you will see roughly 800 to 3,200 points per profile, profile rates from 1 kHz to beyond 10 kHz, and height repeatability from about 2 μm on short-range heads to about 25 μm on wide-field 300 mm-class heads. Laser triangulation is standard shop-floor metrology: micrometre-level height accuracy over ranges of tens of millimetres, non-contact. Choose the exact head with the three numbers below, not with the headline on the data sheet.

The three numbers that size the head

Three formulas decide the hardware:

pitch_x = FOV / N_points (mm per point, across the part) pitch_y = v / f_profile (mm per profile, along travel) D_min ≈ 3 × σ_z (smallest reliably detected depth)

Across the part. A defect needs at least three points across it to survive as a shape, so pitch_x must come to smallest defect width ÷ 3 or less. A 300 mm field with 3,000 points gives 0.1 mm pitch and finds defects from about 0.3 mm wide; below that, add a second head or accept a narrower field.

Along travel. pitch_y is speed ÷ profile rate. At 500 mm/s and 5,000 profiles/s the spacing is 0.1 mm, matching pitch_x. Set pitch_y equal to pitch_x or features stretch along travel — the classic symptom in laser triangulation scan spacing: prevent stretched clouds. Trigger from an encoder, never a free-running clock; the wiring is in encoder-triggered line scan capture: wiring quadrature inputs, and the rate arithmetic is the same as in how to set the line rate of a line scan camera.

In depth. The detection floor is three times the height noise: D_min ≈ 3σ_z. A head repeating to 5 μm finds 15 μm dents and deeper. To catch 50 μm dents you need σ_z at or below about 17 μm — comfortably inside most heads' spec, but confirm it on your own part, not on a lab flat.

From height map to defect list

Five steps turn the height map into the list you were asked for.

  1. Flatten. Fit a reference plane to a tile of the map — 25 mm tiles keep part form out of the residuals — by least squares:
z = a·x + b·y + c d_i = z_i − (a·x_i + b·y_i + c)
  1. Threshold. Flag points where |d_i| > 3σ_z, with σ_z measured on your installation.
  2. Clean. Close single-point speckle with a small morphological close; skip it and every noise spike becomes a defect.
  3. Connect. Run 8-connected component labelling; keep blobs of five points or more.
  4. Report. Centroid gives localization, N_blob × pitch_x × pitch_y gives area, max |d_i| gives depth.

For curved or wavy stock, swap the plane for a robust fit: sample three points, define the candidate plane, count inliers, repeat, keep the plane with the most inliers. That family of fits ignores the defects themselves, so the reference stays clean. The labelling stage is worked through for dents in 3D surface blob analysis for dents on tilted parts, and measuring area and perimeter without background bias is in measuring wafer defect area and perimeter without background.

If σ_z lands far above the head's rating, the line extraction is the suspect — see laser line extraction noise: get a clean height line.

Worked example: 300 mm web at 0.5 m/s

The task: an aluminium web 300 mm wide runs at 0.5 m/s; find dents 50 μm deep and 1 mm across, localize to ±1 mm, measure area to ±25 %.

The head: 300 mm field, 3,000 points per profile, 5 μm repeatability, 5 kHz profile rate, encoder-triggered.

  • Across: 300 mm ÷ 3,000 points = 0.1 mm pitch; a 1 mm dent spans 10 points.
  • Along: 500 mm/s ÷ 5,000 profiles/s = 0.1 mm; the encoder gives 0.1 mm per pulse, 5 kHz at speed.
  • Threshold: 3 × 5 μm = 15 μm; the dent peaks at 50 ÷ 15 ≈ 3.3× threshold, safe against a 30 % noise swing.
  • Area: a 1 mm dent is a disc of radius 5 points, π × 5² ≈ 79 points → 79 × 0.1 × 0.1 = 0.79 mm². Boundary uncertainty of ±½ point over ~31 boundary points gives ±0.16 mm², about ±20 % — inside the ±25 % requirement.
  • Localization: centroid to ±1 pitch = ±0.1 mm, ten times inside spec.
  • Throughput: 3,000 × 5,000 = 15 million points/s to process or decimate outside the region of interest.

Run your own speed and spacing through the line rate calculator:

Line-scan camera line rate
Units
Pixel on the part
– mm
Line rate needed
– kHz
Longest exposure
– µs
Data rate
– MB/s
Lines per metre
–
Encoder setting
–

Square pixels: line rate = speed / pixel on the part; the exposure must end within one line period. Encoder: lines per pulse = (π × roller diameter / pulses per revolution) / pixel on the part.

Find line scan cameras Open the full calculator

If the web runs 1.0 m/s and the head stays at 5 kHz, spacing opens to 0.2 mm, the 1 mm dent spans only 5 points and the area error climbs past ±25 %. Double the rate or halve the speed requirement.

Profiler, snapshot 3D or 2D: choosing the route

Pick with one question: does the defect have height, and does the part move?

Route Measures Height noise Speed Choose when
Laser line profiler height 2–25 μm webs, several m/s defect has depth, part moves
Snapshot structured light height 0.05–0.5 mm one shot per part static part, seconds of cycle
2D area scan, diffuse light contrast — fast stain, colour, print only
Line scan, line light contrast — webs fine print and texture on webs

The same decision worked through for holes in woven fabric: laser profiler versus 2D vision for fabric hole detection.

Moving part, defect with depth: laser profiler. Start here:

3D sensorsHikrobot MIS-DP3850-01P 3D laser profile sensorMIS-DP3850-01P
Type
Laser profiler
$12,379.00 · quotedView and quote

Static part, no motion axis, seconds of cycle time: a projected structured-light snapshot camera takes the full field in a single exposure:

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

The do-it-yourself route — a line scan camera looking at a laser sheet at 25–35°, encoder-triggered, with your own plane fit — makes sense when you must own the image pipeline. Wider triangulation angles give finer height steps but deeper occlusion shadows.

A line scan camera building an image line by line The camera images one thin line of the moving web per exposure, lit by a line light. An encoder on the conveyor triggers each line so the pixels stay square at any speed.one line per exposureLine scanline lightweb speed vencoderline rate = v / object pixelexposure < 1 / line rate
A line scan camera building an image line by line. The camera images one thin line of the moving web per exposure, lit by a line light. An encoder on the conveyor triggers each line so the pixels stay square at any speed.

Camera for it: the MV-CL042-91GC-V2 is a color line scan camera — 4K line, 7 μm pixels, 29 mm image circle, M42 mount. For the paired 2D channel, a line scan light such as the LS-LSC-0527 covers a 300 × 17 mm strip with 108 W white; sizing that light is its own calculation in line scan light: how much power a fast line really needs. The wider method trade-offs are in 3D scanning method selection for inspection. The two building blocks:

Line scan camerasHikrobot MV-CL042-91GC-V2 4k GigE line scan, Color, Isolated versionMV-CL042-91GC-V2
Lens mount
M42
Interface
GigE
$1,459.00View part
Line scan lights300 x 17 mm Line light source, 87 W red / 108 W white (LS-LSC-0527)LS-LSC-0527
Size
200-400 mm
Connector
16M-6J
$1,009.00View part

For slow webs — under roughly 100 mm/s — an ordinary camera in line-scan mode can stand in: area scan camera line scan mode for moving-web inspection.

Checks before you order

  1. Standoff and mounting. Measure the space above the surface; a profiler needs its rated standoff plus bracket room. The positioning rules are in 3D camera working distance and positioning guide.
  2. Known-step scan. Tape a 50 μm shim across the surface and scan it: the step must read 50 μm within 10 % and peak at three times your measured noise or more.
  3. Noise floor. 100 static profiles over a good region: σ_z must come to D_min ÷ 3 or less. For 50 μm dents, that is 17 μm.
  4. Stop-start test. Jog, stop and restart the conveyor across a known mark: no stretching along travel means the encoder owns the axis.
  5. Flatness sanity. Scan a machined flat; a tilted or bowl-shaped cloud points at mounting or calibration — why a laser triangulation point cloud is tilted: calibration checks.
  6. Pipeline budget. 15 million points/s outruns a naive CPU loop; decimate outside the region of interest or process on the head's SDK. The failure pattern is in acquisition faster than processing: fix the frame rate gap.

When the profiler is the wrong answer

  • Zero-height defects. Stains, colour shifts and misprints carry no depth, so the deviation map never sees them. Use 2D with a wavelength chosen for contrast — which LED colour gives the best contrast in machine vision and lighting for fabric defect detection on webs and parts. When both defect families exist, run the 2D channel beside the profiler on the same gantry.
  • Dark, wet or transparent stock. Height accuracy survives finish changes, but the head's camera must still see the line; black rubber and glass can swallow or mirror it. Where a red line disappears into black stock, a blue 405 nm line usually keeps a usable signal — scan a production sample before you commit.
  • Large static parts. No conveyor, no encoder, seconds of cycle: the snapshot structured-light camera from the table above is simpler and covers the full field in one exposure.

Field checklist

  • Smallest defect depth ≥ 3σ_z of the measured noise floor
  • Points across the width: FOV ÷ N_points ≤ smallest defect width ÷ 3
  • Profile rate ≥ speed ÷ pitch_x, with 20 % headroom
  • One encoder pulse per pitch_x, wired to the trigger input
  • Reference plane fitted per ~25 mm tile; robust plane fit where stock is curved
  • Threshold 3σ_z, blobs ≥ 5 points, area = N_blob × pitch_x × pitch_y
  • Second head from the mirror angle if defect walls are steep
  • Laser class known and signed off before first power-up

Next step: filter the 3D sensor finder by type and profile points at the camera finder, or open the system configurator to size the camera, lens, light and trigger for the full station.

Questions

Can a laser profiler find stains or colour defects?

No. A profiler reports height, and a stain carries none, so it never appears in the deviation map. Keep a 2D channel for those: a line scan camera with a line light beside the profiler on the same gantry delivers both maps in one pass. Route each defect family to the sensor that can actually see it, or stains will pass a spotless height inspection.

What height repeatability do I need for 50 μm dents?

Work from the 3-sigma rule: the smallest depth you must find should be at least three times the height noise, so 50 μm dents call for σ of about 17 μm or better. Measure σ yourself from 100 profiles over a good region of your part — mounting vibration on a real gantry often doubles the figure printed for a lab flat.

How fast can the surface move under the sensor?

Set it by spacing, not by the head's maximum rate. Spacing equals speed divided by profile rate: 5,000 profiles/s at 0.5 m/s gives 0.1 mm; the same head at 1.0 m/s gives 0.2 mm and starts losing 1 mm dents. Most industrial heads run 1–10 kHz, so several metres per second are reachable if you accept coarser spacing.

Do I need an encoder for the second axis?

Yes, whenever speed varies or the line stops mid-part. A free-running clock stamps profiles by time, so every speed change stretches or compresses the map along travel and defect areas go wrong. One encoder pulse per target spacing — 0.1 mm in the worked example — keeps the map metric; wire it to the trigger input.

How do I measure defect area from the point cloud?

Threshold the deviation map, run connected-component labelling, and multiply the point count by pitch_x × pitch_y: a 79-point blob at 0.1 mm pitch is 0.79 mm². Interpolate the blob boundary to sub-point accuracy when you need better than about ±20 % on small defects, and report maximum deviation as depth next to the area.

Does a shiny or dark surface break laser triangulation?

Height accuracy survives finish changes, but the camera inside the head must still see the line. Black rubber, wet or transparent stock can swallow it, and mirrors can bounce it away from the sensor. A 405 nm blue line holds where 660 nm red drops out on dark substrates; scan a production sample before committing the budget.