R&D
CENTER

Photometric Stereo: Seeing Surface Relief with a 2D Camera

If you capture several images while changing the lighting direction, you can compute which way the surface faces at each pixel. This lesson explains how a curvature map reveals shallow dents that the eye and ordinary images cannot show.

Core4 min1 views
Key points
  1. The same surface has different brightness depending on the direction of the light. From this difference you work backward to the surface direction (normal) at each pixel.
  2. The outputs are albedo, a normal map and a mean-curvature map. Shallow dents show most clearly in the curvature map.
  3. You can inspect surface relief with only a 2D camera and lights, without a 3D camera.
  4. The part must stay still during capture, and mirror-like shiny surfaces need extra handling.

A shallow mark on a metal surface has the same color and brightness as its surroundings. So it is almost invisible in an image taken with ordinary lighting. But when light comes from the side, one wall of the mark gets brighter and the other gets darker. Photometric Stereo measures this effect systematically from several directions and computes the surface slope for each pixel.

Part Capture with 8 lights, one at a time AlbedoShading-free Normal mapSurface direction Mean curvatureHighlights dents DepthIntegrate normals
fineAi Viewer & Inspector computes Normal, Depth and curvature from 8-direction lighting. The output maps go directly into an anomaly detection model as input.

Principle: Brightness Depends on the Angle Between Surface and Light

On a matte (diffuse) surface, the brightness of a point is roughly:

brightness = albedo × cos(angle between surface normal and light direction)

When light hits the surface head-on it is bright, and the more oblique it is, the darker. The unknowns per pixel are 1 albedo value and 2 normal-direction values (slopes), 3 in all. If you know the light directions, 3 or more images let you solve for these unknowns. With 8 directions, even if shadows or highlights make some images useless, you can still solve stably from the rest.

Four Outputs

  • Albedo — The surface's own brightness with lighting shading removed. Stains, discoloration and printing defects show up.
  • Normal map — The direction each pixel's surface faces. The X, Y and Z components are usually shown as RGB colors.
  • Depth — Relative height obtained by integrating the normals. Use it to see overall warp or deformation.
  • Mean curvature — How sharply the surface bends. A flat surface is near 0, and the value spikes at the edges of dents and scratches. Shallow defects show best in the curvature map.

How to Use It in Inspection

In Multi-Inspector, the inspection mode type (modeN_type) selects which map to use.

Mode Input image
albedo, albedo-clahe Albedo map (with or without contrast correction)
mean-curvature, mean-curvature-clahe Curvature map
normal-map Normal map

These maps are already tidy images, so they go straight into an anomaly detection model with no extra rotation. If you train on curvature maps of normal parts only, the model finds places where curvature spikes differently from normal as anomalies.

Cautions

  • The part must stay still during capture. If the part moves while the 8 images are taken, the pixel correspondence breaks. Capture while it is stationary, or use a controller with fast lighting switching (such as IDGC).
  • Shiny surfaces break the principle. Mirror reflection does not follow the formula above and creates highlights. Compute without the images that have highlights, or soften the light with a diffuser.
  • You must know the light directions exactly. If a light position changes, recalibrate.

If you need true 3D shape (height in mm), use a 3D camera. The next lesson, 3D Vision and Point Clouds, covers it.