Skip to content

Phase unwrapping

Recover a continuous phase field from measurements wrapped into a fixed angular interval.

Try it on your image ↓

VISUAL WALKTHROUGHSignal
REFERENCE INPUTWrapped phase observations

Phase is reported modulo a full cycle, so a smooth ramp appears to jump.

RESULTRecover a continuous phase ramp

Adding the cycle offsets removes the discontinuities in this noise-free 1D example. Two-dimensional reliability and discontinuities require additional care.

STEP 03 / 03

Propagate consistent cycle offsets through reliable regions.

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 ↗

Interpret grayscale intensity as phase in [-π, π], then unwrap discontinuities. Real measurements must first be encoded as a wrapped phase map; ordinary photos are only illustrative.

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

Process structured-light phase or other periodic measurements when a suitable quality map is available.

How it works

  1. 01Estimate local phase reliability.
  2. 02Resolve neighbouring differences modulo a full cycle.
  3. 03Propagate consistent cycle offsets through reliable regions.

unwrapped phase = wrapped phase + 2π·integer offset

What to tune

Set the image dimensions and reliability histogram parameters to match the input phase map.

Where it breaks down

Discontinuities, holes and noise can make the absolute cycle assignment ambiguous. Unwrapping does not supply an external absolute phase reference.

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.