Skip to content

Perspective-n-point pose

Estimate a camera-relative object pose from known 3D points and their 2D image observations.

Try it on your image ↓

VISUAL WALKTHROUGH3D vision
REFERENCE INPUTKnown 3D object geometry

The shape is known in object coordinates. One calibrated camera sees it at an unknown pose.

RESULTReproject using the recovered pose

The final illustrative pose projects the model onto the observed points. A native PnP result must still be checked for depth and reprojection error.

STEP 03 / 03

Refine and inspect reprojection errors; use robust sampling when correspondences contain outliers.

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 ↗

Solve camera pose from four coplanar object corners and their image positions. Edit normalized image points to match a planar square in your photo; orange points show reprojection.

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

Place an overlay on a calibrated marker or measure the pose of known geometry.

How it works

  1. 01Match 3D object coordinates to image points.
  2. 02Solve a rotation and translation consistent with the camera model.
  3. 03Refine and inspect reprojection errors; use robust sampling when correspondences contain outliers.

camera point = R · object point + t

What to tune

flags select the solver with its minimum point count and geometry requirements. RANSAC thresholds use image coordinates.

Where it breaks down

Some configurations have multiple pose solutions. Units, point order, camera calibration and coordinate conventions must agree.

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.