Iterative closest point
Refine the relative pose of two 3D surfaces by alternating correspondences and alignment.
Compare the same structure before and after a coordinate transformation.
Associate source points with nearby target surface points.
Solve a pose update that reduces the correspondence residual.
The mint structure now coincides with the reference in this illustrative convergence. Real alignment can stop at a local optimum.
Transform and repeat until improvement or iteration limits stop the process.
Illustrative example. The stages explain the method; they are not a live OpenCV execution.
Try it on an image
Experiment at pixel level
Convert both grayscale images to sampled height fields, then align them as 3D point clouds with ICP. This is an intensity-surface experiment, not depth recovered from photos.
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
Align point clouds that already have a reasonable initial pose.
How it works
- 01Associate source points with nearby target surface points.
- 02Solve a pose update that reduces the correspondence residual.
- 03Transform and repeat until improvement or iteration limits stop the process.
correspond → fit pose → transform → repeat
What to tune
Sampling, rejection scale, iteration count and tolerance trade detail against cost and robustness.
Where it breaks down
ICP is a local optimizer. Symmetry, partial overlap, outliers and a poor initialization can lead to the wrong alignment.
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.