Structured-light decoding
Recover projector-camera correspondences from a sequence of known projected patterns.
A calibrated projector illuminates the scene with known patterns.
A surface changes where projected stripes appear in the camera image.
Decode intensity changes into projector coordinates or phase.
The calibrated geometry converts correspondences to surface depth. This curved grid illustrates the reconstruction.
Use calibration to turn correspondences into 3D geometry.
Illustrative example. The stages explain the method; they are not a live OpenCV execution.
Try it on an image
Experiment at pixel level
Generate Gray-code projector patterns. These do not transform the input photo; decoding physical depth requires a synchronized camera capture for every projected pattern.
The engine loads on your first run. Your images stay in this browser.
Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.
Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Select a pixel
Select a pixel
When to use it
Measure scene shape with a calibrated projector and camera under controlled capture.
How it works
- 01Project and capture the required pattern sequence.
- 02Decode intensity changes into projector coordinates or phase.
- 03Use calibration to turn correspondences into 3D geometry.
projected codes → decoded correspondences → triangulation
What to tune
Gray-code and sinusoidal methods have different sequences and calibration requirements. Thresholds govern accepted illumination evidence.
Where it breaks down
Motion between captures, shadows and reflections invalidate codes. Pattern generation alone is not a complete reconstruction.
TypeScript API
Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.
All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.
Related methods
Camera calibration
Estimate a camera’s intrinsic parameters and lens distortion from known target geometry.
Lens undistortion
Invert a calibrated lens model to map distorted observations onto an idealized camera image.
Perspective-n-point pose
Estimate a camera-relative object pose from known 3D points and their 2D image observations.
Fundamental and essential matrices
Constrain where a point from one camera view can appear in another.