A structured light scanner projects a known coded pattern onto a target, captures the deformation with one or more cameras, and triangulates each pixel into XYZ; the dominant open-source implementations on GitHub as of June 2026 both use two monochrome cameras plus a single projector running gray-code patterns [S1][S2].
For industrial metrology, selection reduces to four decision axes: working volume (mm to m), depth of field, projector-camera baseline, and the pattern-encoding scheme; misalignment on any of these collapses accuracy faster than any lens upgrade can recover it. Buyers who need fast full-body scanning of moving parts should usually reach for a laser-line or time-of-flight 3D scanner instead, since structured light loses lock when inter-frame motion exceeds the projected stripe period.
How the Technique Works and What the Reference Builds Expose
Gray-code structured light works by projecting a sequence of N binary black/white fringe patterns that uniquely address every column (or row) of the projector; with N=10 the field yields 1024 codes, and triangulation against a calibrated stereo camera pair resolves each decoded pixel to sub-millimeter XYZ inside a bounded working volume [S1].
The maximm8 reference implementation keeps the algorithm stack intentionally minimal: `structuredlight_reconstruction.py` decodes the gray-code sequence, cleans invalid pixels, estimates the projected plane parameters, and back-projects rays into 3D, while `utils.py` carries the camera and projector intrinsic/extrinsic calibration I/O [S1]. The hard requirement called out in the README is that camera and projector intrinsics plus extrinsics must already be known, so the user is responsible for running a checkerboard or ChArUco calibration before any point cloud is trusted. The MPashaei fork, with 18 stars and 6 forks as of May 2026, follows the same dual-camera-plus-projector topology and is the more actively cited community baseline [S2].
Working Volume, Baseline, and Depth of Field: The Three Coupled Variables
Working volume, baseline, and depth of field are not independent: a 300 mm baseline at 1.0 m stand-off gives a sweet spot near 700-900 mm depth, while the same baseline at 0.4 m stand-off restricts useful depth to roughly 250-450 mm, because triangulation angular resolution scales with 1 / baseline distance.
Rule-of-thumb numbers that hold across the reference open-source stacks: a 200-400 mm baseline suits sub-500 mm working volumes with point precision around 0.05-0.1 mm at 0.5 m; a 500-800 mm baseline suits 0.5-1.5 m volumes with precision near 0.2-0.5 mm; a 1.0 m+ baseline is reserved for human-body or automotive-inner scans where precision targets relax to 1-2 mm. Depth of field is bounded on the near side by projector defocus (the pattern must stay sharp) and on the far side by camera depth-of-field; the safe envelope is roughly stand-off +/- 15 percent for a f/2.8 lens and shrinks to +/- 8 percent at f/4. The structured light scanner encyclopedia page gives the same envelope from the optics side and is worth reading in parallel.
Pattern Encoding Choice: Gray-Code vs. Phase-Shift vs. Multi-Slit

Gray-code patterns deliver one XYZ point per decoded pixel and need 2N frames for N-bit addressing; phase-shift (sinusoidal fringe) patterns need only 3-4 shifted frames and can reach the same precision per pixel but demand a more robust phase-unwrapping stage to handle discontinuities. [S3]
The three encodings compared on four decision criteria that matter to a buyer:
1. Frames per scan: Gray-code 10-20, Phase-shift 3-4, Multi-slit (laser-line) 1; multi-slit wins for moving parts, gray-code loses on speed but gains on absolute coding (no unwrapping errors).<br/>2. Sub-pixel precision: Phase-shift best at 1/30-1/50 pixel, Gray-code around 1/8-1/10 pixel because the code boundary is binary, Multi-slit 1/4-1/8 pixel.<br/>3. Robustness to surface texture: Gray-code best on matte, feature-rich surfaces; Phase-shift best on smooth, low-texture parts when a fringe-projection profilometer is used; Multi-slit needs surface texture or a scan spray.<br/>4. Sensitivity to ambient light: Gray-code and Phase-shift both need a 600-850 nm bandpass or a light-tight enclosure; Multi-slit tolerates factory light because the laser line is narrow and bright.
The MPashaei reference build explicitly targets the gray-code path because it gives each pixel an absolute, unambiguous code, which removes the phase-unwrapping failure mode that plagues sinusoidal methods on parts with holes or sudden depth jumps [S2].
Who Should Pick Structured Light, and Who Should Walk Away
Structured light is the right answer when targets are static, 50-2000 mm in size, matte or feature-rich, and the inspection happens in a light-controlled booth or under a 600-850 nm narrowband filter; typical fit includes turbine blade inspection, dental model capture, casting and forging dimensional checks, and on-machine verification of CNC-machined features before part removal. [S3]
Structured light is the wrong answer for: (a) moving production lines where cycle time per scan is under 0.5 s, (b) shiny metallic or transparent parts without a scan spray, (c) outdoor scenes with strong ambient or sunlight that floods the projector wavelength, and (d) parts larger than 2-3 m where the required baseline becomes mechanically impractical. Buyers in any of these four cases should re-route budget to a 3D scanner using time-of-flight, laser line, or photogrammetry instead. Costs for a turnkey industrial structured light head in 2026 typically run 8,000-80,000 USD depending on working volume and accuracy class; integrator markups for an in-line station add 1.5-2.5x hardware cost, and a 2026 component-and-integrator benchmark on machine vision pricing tracks the same spread [S1][S3].
Calibration, Failure Modes, and Standards Anchors

Calibration is the single largest source of error in a structured light system; the reference builds require the user to supply intrinsic matrices K_cam, K_proj and extrinsic rotation/translation (R, t) between every camera and the projector, typically derived from 20-40 checkerboard poses with sub-pixel corner refinement [S1].
Five failure modes a spec writer should pre-empt in the procurement document: (1) projector defocus at the far edge of the working volume, (2) inter-reflection between two cameras causing ghost codes on concave features, (3) ambient light saturating the camera, (4) vibration moving the part by more than one projected stripe between frames, and (5) extrapolation outside the calibrated volume producing point clouds that look valid but are not. Acceptance tests should reference VDI/VDE 2634-3 for optical 3D metrology systems, ISO 10360 for length-measurement accuracy statements, and ASME B89.4.22 for the calibration of laser-based and optical systems, because these are the documents the integrator will be measured against during site acceptance. Generic accuracy claims of "+/- 0.01 mm" without a stated working volume, baseline, and reference standard are a red flag, since the same sensor can deliver 0.02 mm in a 200 mm volume and 0.5 mm in a 1.5 m volume.
Integration With CNC, On-Machine Inspection, and Cost Anchors
On-machine structured light inspection is now an established alternative to touch-probe CMM verification, because it removes the part-handling step and catches errors before the workpiece leaves the fixture; the integrated US patent on a structured light 3D scanner filed in this space (US2013278725A1, published 2013) explicitly couples the scan head to CNC motion for closed-loop inspection reports [S3].
Component cost anchors for a 2026 bill of materials: 5 MP monochrome industrial GigE camera 600-1,200 USD each, a DLP or laser-line projector module 1,500-6,000 USD, a calibrated mounting rail 800-3,000 USD, and a workstation with a CUDA-capable GPU 1,500-3,500 USD; software is often the hidden line item, since per-seat licenses for the matching reconstruction suite run 3,000-15,000 USD annually. The vision-system price guide benchmarked earlier in 2026 confirms that the camera-plus-projector pair typically accounts for only 25-35 percent of an installed station cost, with integration labor, fixturing, and software making up the rest, and that mid-tier integrators quote 18,000-45,000 USD for a turnkey benchtop cell [S1][S3].
Track these signals next: (a) new GitHub releases on maximm8/structured-light-scanner and MPashaei/Structured-Light-Scanner, since both repos accept pull requests and a v2 multi-pattern decoder would shift the community baseline; (b) a revision cycle on VDI/VDE 2634-3 that updates acceptance-test thresholds for sub-100 mm working volumes; and (c) DLP projector modules with 1440 Hz binary pattern rates, which would close the speed gap to phase-shift encoding and let gray-code stay competitive on moving targets.
Spec-level background on the components involved: industrial barcode scanner.
Related analysis: Deformed Rebar Selection for Prefabricated Construction: Diameter, Grade, Length.