Skip to content

Polar and log-polar warps

Re-express an image using angle and radius around a chosen centre.

Try it on your image ↓

VISUAL WALKTHROUGHGeometry
REFERENCE INPUTCartesian radius and angle

A bright sector occupies a range of angles and radii around the selected centre.

RESULTUnroll into radius / angle space

The sector crosses angle zero, so its unwrapped samples appear at both ends of the angle axis. A rotation becomes a shift along that axis.

STEP 03 / 03

Sample the corresponding Cartesian coordinate in the source.

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 ↗

Unroll distances and angles around the image centre. The output coordinate system is polar.

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

Turn rotation into a shift and, with logarithmic radius, scale change into another shift.

How it works

  1. 01Choose the common centre of the transformation.
  2. 02Map each output row to an angle and each column to a radius.
  3. 03Sample the corresponding Cartesian coordinate in the source.

x = cx + r cos θ; y = cy + r sin θ

What to tune

WARP_POLAR_LOG uses log radius; maxRadius and dsize set the covered region and sampling density.

Where it breaks down

The centre must be meaningful and stable. Sampling near the centre and the angular seam can distort detail.

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.