Skip to main content

Overview

Camera pose estimation determines the position and orientation of a camera relative to a scene or object:
  • Camera Calibration: Determine intrinsic camera parameters
  • PnP (Perspective-n-Point): Estimate pose from 2D-3D correspondences
  • Homography-based: Estimate pose from planar objects
  • Augmented Reality: Overlay 3D graphics on video
  • Visual Odometry: Track camera motion over time

Camera Calibration

Calibrate camera to obtain intrinsic parameters needed for accurate pose estimation.

Pose Estimation with solvePnP

Estimate camera pose from known 3D-2D point correspondences.

Augmented Reality Application

Overlay 3D graphics on tracked planar objects.

Pose from Homography

Extract pose information from planar object homography.

Visual Odometry

Track camera motion over time using feature tracking.

PnP Algorithms Comparison

AlgorithmSpeedAccuracyMin PointsUse Case
ITERATIVEMediumGood4General purpose
P3PFastGood3Minimal case
EPNPFastGood4+Many points
DLSMediumVery Good4+High accuracy
UPNPFastGood4+Fast processing
IPPEFastGood4 (planar)Planar objects
SQPNPMediumExcellent3+Best accuracy

Best Practices

1

Calibrate Your Camera

Always calibrate for accurate pose estimation:
2

Use Enough Points

More points = better accuracy:
  • Minimum: 4 points for general case
  • Recommended: 10+ points
  • Use RANSAC for outlier rejection
3

Handle Ambiguities

Some configurations have multiple solutions:
4

Validate Results

Check reprojection error:
Coordinate Systems: OpenCV uses right-handed coordinate system:
  • X-axis: right
  • Y-axis: down
  • Z-axis: forward (into scene)
Rotation vectors use Rodrigues representation, convertible to matrices with cv.Rodrigues().
Calibration Quality: Poor calibration leads to inaccurate pose estimation. Always:
  • Use at least 10-20 calibration images
  • Vary target orientation and position
  • Check RMS error (should be < 1.0 pixel)
  • Test on held-out validation images

Troubleshooting

Unstable Pose

Incorrect Pose

Next Steps