3D visionHow-to

Weld seam defect detection from a height map: isolate the ripple

Defect detection from a weld height map: fit a zero plane, flatten the bead crown, band-pass along the seam and threshold the fish-scale ripple residual.

LumaSpec Vision12 min read Share on LinkedIn

On this page 12 sections
  1. 01What fish-scale ripple looks like in height data
  2. 02What you need
  3. 03The pipeline at a glance
  4. 04Fit the zero plane on the base metal
  5. 05Flatten the bead crown
  6. 06Band-pass along the seam
  7. 07Worked example: 0.01 mm ripple on a map with 0.0085 mm Z steps
  8. 08Threshold, count and classify
  9. 09Verify it worked
  10. 10Common mistakes
  11. 11When a height map is the wrong tool
  12. 12Questions

Fish-scale ripple is the regular scalloping a weld bead leaves as the pool solidifies, and it is one of the most informative features you can inspect on a seam. Even ripple means stable travel and sound fusion; flat stretches, wandering pitch and humping mark real defects. If you already hold the seam as a 16-bit height map, you can extract that ripple with deterministic arithmetic — no training set, no colour tricks. This walkthrough gives the full pipeline, the noise budget that decides whether your map can see the ripple at all, and the thresholds that follow from it. You finish able to fit the reference surfaces, close the noise budget for your own pitches, and set a pass/fail rule per seam section.

What fish-scale ripple looks like in height data

Ripples are transverse ridges stacked along the bead at the pool's solidification rhythm. Two numbers describe them: crest-to-crest spacing along the seam, commonly 0.5-2 mm on arc welds, and amplitude, how far a crest stands above the trough line — from roughly 0.01 mm up to a few tenths of a millimetre. Reviews of weld bead thermal science describe ripples as slight elevations above the nominal surface, and humping as an irregular, unpredictable contour. That contrast is your defect model: a regular periodic residual means healthy ripple, a flat stretch means missing ripple, and large irregular excursions mean humping.

A height map stores the seam as signed Z per pixel. Three scales decide what you can see: the across-bead pixel pitch, the along-seam pitch, and the Z resolution, the smallest height step the map can express. The along-seam pitch is travel speed divided by profile rate, so it is yours to choose; the other two come from the sensor, and how to set them without distorting the map is covered in 3D point cloud x y z resolution settings. The worked example below uses 0.1 mm across-bead pitch, 0.056 mm along-seam pitch and 0.0085 mm Z steps — a typical laser-profiler pass over a plate seam.

What you need

A calibrated height source. A 3D laser profiler delivers one measured profile per trigger and builds the map as the part or sensor travels, which makes it the natural tool for a seam. For long plate or pipe seams, a line-scan 2.5D system covers more travel per pass at production speed. Before ordering anything, size the pixels with the usual rule from camera resolution for defect detection: keep at least 3-5 pixels across the smallest feature you must resolve, which here is one ripple crest. Filter profilers by type in the camera finder.

Profilers that deliver calibrated per-trigger profiles for exactly this job:

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
3D sensorsHikrobot MV-HLVS-16K100-L60 Line-scan 2.5D, 16K resolution, Sampling rate 120 kHz, Emitting area length 600 mmMV-HLVS-16K100-L60
Type
2.5D inspection
Price on requestView and quote

Along-seam pitch is a budget of travel speed and profile rate:

p = v / f

with p in millimetres per profile, v the travel speed in mm/s and f the profile rate in profiles per second. The MV-HLVS-16K100-L60 samples profiles at up to 120 kHz. At that rate, the 0.056 mm pitch of the example corresponds to 6720 mm/s of travel, so pitch is rarely the limiting scale and slower travel only oversamples the ripple.

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

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.

A processing target that holds the whole map. Several GigE ports and built-in light channels let one machine take the profiler, the encoder and the strobe; the vision controllers category is that line:

Vision controllersHikrobot MV-VC5525-256G70-NN VC5000 Vision Controller, 12th-I5, 32GB+256G SSD, Supported PCIEMV-VC5525-256G70-NN
LAN ports
5+ LAN ports
USB 3 ports
3-4 USB 3 ports
PoE
PoE camera ports
Light outputs
8 built-in channels
$4,479.00 · quotedView and quoteBuild a system with it

The MV-VC5525-256G70-NN pairs a 12th-gen Intel Core i5 with 32 GB of memory, PoE camera ports and eight built-in light channels.

Working large-diameter pipe rather than plate? The sensing hardware differs as much as the processing does; this selection guide for weld seam detection sensors for steel pipe testing covers the hardware side.

The pipeline at a glance

The extraction is six moves, all deterministic:

  1. Work in 16-bit or float; convert to 8-bit or colour only for display.
  2. Fit a plane, or a smooth surface on curved parts, to the base metal and subtract it: the seam now sits on zero.
  3. Fit a smooth crown curve to the bead and subtract it: bead body and base metal both sit near zero.
  4. Smooth across the bead, then high-pass along the seam with a window several times the ripple spacing.
  5. Threshold the residual at half the measured ripple amplitude and pair each crest with a trough.
  6. Count paired ripples per unit length and flag missing ripple, irregular pitch or humping.

Steps 2-4 decide the outcome. Get the reference surface wrong and the ripple is buried under millimetre-scale geometry before any threshold can help.

Fit the zero plane on the base metal

Mask the bead out and fit a plane to what remains. Take strips of base metal flanking the seam, 2-5 mm wide on each side, and least-squares fit a plane to those pixels only. Subtract it from the whole map:

z_plane = a·x + b·y + c r = z - z_plane

Trim and refit once: drop pixels whose residual exceeds three standard deviations — spatter, scale — and fit again, so a few bright specks cannot tilt your zero. On a curved part a plane is not enough: fit a low-order surface instead, second order across and a smoothing spline along, to the same masked pixels. The method in fit a plane to regions of a point cloud with least squares carries over directly; the only change is fitting on the base-metal mask rather than the whole cloud. If the map still holds raw sensor counts, apply the per-axis scale factors first — see depth image to point cloud: apply per-axis scale factors.

Flatten the bead crown

After plane subtraction the bead itself remains: a smooth dome from a few tenths of a millimetre to a few millimetres tall, tens of times the ripple. Remove it with a second, smoother fit. On a straight seam, fit a quadratic to each across-bead profile to take out the dome shape, then a cubic smoothing spline to the per-column mean along the seam to take out slow drift of the bead height. Fit both to medians so the ripple cannot bias them, and keep the along-seam window at 5-10 ripple spacings or longer; a shorter window follows the ripple and subtracts it away.

The residual after both fits:

r(x, y) = z(x, y) - P(x, y) - C(x)

where P is the base-metal plane and C(x) the crown curve across the bead. Base metal and bead body now sit near zero, and the fish-scale ripple is the only periodic structure left in the map.

Band-pass along the seam

Filter directionally, never isotropically. Across the bead, each ridge spans the bead width, so a low-pass there cuts noise without touching ridge tops: a Gaussian kernel of 3-6 pixels, 0.3-0.6 mm at the example pitch, is a start, and the noise budget sets how much more you need. Along the seam, subtract a running mean whose window is 6-10 spacings long; the remainder is the periodic band around the spacing — a band-pass in effect. Both steps are linear, so their order does not matter.

If the bead also drifts faster than that window can track, threshold the local slope instead of the height. A sinusoidal ripple of amplitude A and spacing s has a maximum along-seam slope of:

|dz/dy|max ≈ π·A / s

With A = 0.01 mm and s = 1 mm that is about 0.03 mm per mm — a gradient threshold that rejects slow drift by construction, at the cost of amplifying noise, so keep the across-bead smoothing. Noise that survives the smoothing usually entered at the laser line itself; the fixes in laser line extraction noise belong upstream of this pipeline.

Worked example: 0.01 mm ripple on a map with 0.0085 mm Z steps

Inputs: a 16-bit height map with 0.1 mm across-bead pitch, 0.056 mm along-seam pitch and 0.0085 mm Z steps, typical of a profiler pass over a plate seam. A section cut shows crests standing A = 0.01 mm above the trough line, spaced s = 1.0 mm apart — mid-range for arc weld ripple.

Rule: a feature survives thresholding when its amplitude is at least three times the smoothed noise, and averaging M independent pixels divides the noise by √M.

  • Single pixel: 0.01 / 0.0085 ≈ 1.2, below 3 — no per-pixel threshold can work.
  • Smooth across the bead over M = 9 pixels, a 9 × 0.1 = 0.9 mm strip: smoothed noise = 0.0085 / √9 = 0.0085 / 3 = 0.0028 mm.
  • Margin: 0.01 / 0.0028 ≈ 3.5, which passes.
  • Thresholds: crests at +0.005 mm, troughs at −0.005 mm, half the amplitude. Noise sits 0.005 / 0.0028 ≈ 1.8 standard deviations below the crest threshold, so isolated spikes do occur; accept a ripple only when a trough pairs with a crest within 1.5 × 1.0 = 1.5 mm.
  • Floor: the smallest amplitude this map detects is 3 × 0.0028 ≈ 0.009 mm. Smaller ripple needs lower per-pixel noise or wider averaging.
  • Sampling: 1.0 / 0.056 ≈ 18 profiles per ripple, well above the 4 needed to represent the wave.

Decision: threshold at ±0.005 mm after a 9-pixel across-bead smoothing, accept a ripple on a crest-trough pair within 1.5 mm, and fail a section when the paired count leaves the band measured on known-good coupons or when excursions exceed 0.02-0.03 mm with irregular spacing — the first is missing ripple, the second humping.

What moves the answer: the 0.0085 mm step is a best case, and oxidized or spattered beads raise the real noise. Measure it — take the standard deviation of the residual on a known-flat base-metal patch — and rerun. Doubling the noise to 0.017 mm needs (0.017 / 0.0028)² ≈ 37 pixels of averaging, a 3.7 mm strip at the 0.1 mm pitch, wider than half of many bead crowns; at that point fix the capture, not the filter.

Threshold, count and classify

Classify from paired residuals in physical millimetres, never grey levels — grey thresholds silently shift when exposure, laser power or the colour mapping changes.

  • Healthy ripple: paired crest-trough counts per 10 mm stay inside a band set from known-good coupons, about ±20% around their median.
  • Missing ripple: the residual stays inside ±A/2 for a stretch longer than 2-3 spacings — the pool ran cold or travel stalled.
  • Humping: excursions beyond 2-3× A with irregular spacing and no stable pair rhythm.
  • Report per section, not per map: ripple count, mean crest amplitude and spacing spread. A map-level verdict hides where along the seam the process drifted.

Verify it worked

Prove the extractor on parts with a known answer before it judges production. Run three known-good and three seeded-defect coupons — a ground-flat stretch for missing ripple, an overheated pass for humping — and require clean separation of all six. Then check repeatability: run one part ten times and require an identical ripple count in all ten; the pipeline is deterministic, so any spread points to capture instability, most often motion during the scan, which is why mounting stillness during capture decides image quality. Check amplitude trueness too: compare measured crest height on a coupon against a physical reference such as a replica or stylus trace, and remove any systematic offset with the pass described in 3D camera infield correction. The full cell, trigger to verdict, is set out in line scan weld seam inspection.

Common mistakes

  • Smoothing along the seam. A moving average along the seam with a window near the spacing filters the ripple out with the noise. Smooth across only; along the seam use the wide-window high-pass.
  • Thresholding the raw map. The bead crown stands tens of times taller than the ripple; without plane and crown subtraction, every height threshold flags geometry, not defects.
  • Timer-based triggering. Travel-speed wander changes the along-seam pitch and mimics irregular spacing. Trigger profiles from encoder distance; the scale set-up is in encoder ticks per pixel for line scan.
  • Stale scale factors. Binning or decimation changes the pixel pitch, and a cached pitch value then mislabels every height; depth image resolution smaller than expected is the tell-tale sign.
  • Trusting the datasheet noise. The step a datasheet prints assumes a cooperative surface. Measure the residual noise on your bead and feed that number into the budget.

When a height map is the wrong tool

Height sees geometry. Porosity mouths, spatter balls and temper colours are primarily intensity features and can sit nearly invisible in a height map at these resolutions. The strong default is both streams from one trigger: the 3D map for ripple, crown height and undercut depth; the 2D image for colour and spatter — the division of labour is laid out in 2D and 3D capture strategy. If the defect of interest lives in broader cloud structure rather than the seam's periodic ripple, the methods in 3D surface defect detection from point cloud height maps extend this pipeline, and the profiler-side specifics are in surface defect detection with a 3D laser line profiler. The rest of the point-cloud toolkit is collected on the 3D topic hub.

When a section fails and the map is clean, the defect is usually process, not vision: ripple follows heat input and travel, so hand the spacing and amplitude trends to the welding engineer — they read like a chart recorder of the pool's behaviour.

That is the whole method: measure A and s from a section cut, close the noise budget, and let the residual, not the raw map, carry the verdict. To have the budget rerun against a map from your own seam, send the pitches, the Z step and a section cut through the contact page.

Questions

How much per-pixel noise can I afford for a given ripple amplitude?

Require the smoothed noise to stay under a third of the measured crest amplitude: the 3:1 rule rearranges to at least (3 × per-pixel noise / amplitude)² pixels of across-bead averaging. Take the noise from the standard deviation of the residual on a flat base-metal patch, not from the datasheet. If that many pixels need a strip wider than the bead crown, lower the noise at capture — exposure, laser power, focus — before touching thresholds.

How many samples do I need along the seam per ripple?

At least four profiles per crest-to-crest spacing, so keep the along-seam pitch under a quarter of the spacing: for 1.0 mm spacing, finer than 0.25 mm. The example map's 0.056 mm pitch delivers about 18 profiles per ripple, enough to also measure spacing spread statistically. Timer-based travel wastes that margin the moment speed wanders, so trigger profiles from encoder distance.

Can I detect fish-scale ripple from the 2D image instead?

Sometimes: under hard raking light the ridges shade visibly, and a high-pass on the intensity image can show the pattern. It fails on shiny, oxidized or stained beads where contrast follows reflectivity rather than geometry, and it cannot size height. Use the 2D stream for colour-class defects and spatter, and let the height map own ripple, undercut and crown height.

Why does my ripple disappear when I smooth the map?

Almost always the smoothing direction: a moving average along the seam with a window comparable to the spacing filters the ripple out together with the noise. Smooth across the bead only, and along the seam subtract a running mean whose window is 5-10 spacings or longer. If the ripple still vanishes, the crown-fit window is too short and is following the ripple.

Do I need deep learning to classify weld seam defects?

Not for ripple-class defects: plane subtraction, crown flattening, directional filtering and paired-crest counting are deterministic and auditable, and every threshold traces back to a physical amplitude in millimetres. Deep learning earns its place when the defect set is open-ended — porosity clusters, spatter patterns, irregular start-stop marks — or when classical thresholds call too many marginal sections. Start classical; add learning only where the false-call log says so.