Skip to content

Iterative closest point

Refine the relative pose of two 3D surfaces by alternating correspondences and alignment.

Try it on your image ↓

VISUAL WALKTHROUGH3D vision
REFERENCE INPUTInitial misalignment

Compare the same structure before and after a coordinate transformation.

RESULTAligned structure

The mint structure now coincides with the reference in this illustrative convergence. Real alignment can stop at a local optimum.

STEP 03 / 03

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

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

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.

Input448 × 320
OutputWaiting for a result

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
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Align point clouds that already have a reasonable initial pose.

How it works

  1. 01Associate source points with nearby target surface points.
  2. 02Solve a pose update that reduces the correspondence residual.
  3. 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.