Shapes & spaces

Projective camera matrix calculator from 3D to 2D point correspondences

Estimate a projective camera matrix from paired spatial and image observations using normalized direct linear transformation.

Your numbers

One spatial point per row. At least six noncoplanar correspondences.
Matching image row for every world point; coordinates use one consistent image convention.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Estimate a projective camera matrix from paired spatial and image observations using normalized direct linear transformation.

THE FORMULAλ[u,v,1]ᵀ=P[X,Y,Z,1]ᵀ; minimize ||A p|| subject to ||p||=1.

A worked example

The default observations follow u=(X+0.2Z)/(Z+4),v=(Y−0.1Z)/(Z+4). Normalized DLT recovers this projective mapping with rounding-scale reprojection errors.

Good to know

6–30 matching3D/2D rows; nondegenerate spatial configuration and resolved DLT rank. Finite numeric coordinates; fitted finite projections only. Frobenius scale convention; no lens distortion, metric intrinsic calibration or nonlinear reprojection refinement.

A spatial projective mapping

A camera matrix maps homogeneous coordinates in three-dimensional space to homogeneous coordinates in an image. Dividing the first two mapped components by the third gives the visible image point. A general projective camera uses a three-by-four matrix defined only up to a nonzero scale.

This is more general than a homography between two planes. Correspondences confined to one plane do not determine every spatial camera coefficient. The input therefore needs a genuinely three-dimensional configuration rather than a flat calibration pattern treated as if it supplied full spatial information.

Spatial observations projected into an imageWorld pointsImage pointsP: 3 × 4
Scroll across to see the full diagram.
A3×4 matrix maps homogeneous world points to image rays before division by the last coordinate.

Compare this with the Projective homography calculator from four point pairs. Estimate a 3 by 4 perspective mapping from spatial correspondences; a planar homography cannot reconstruct a general spatial camera.

Entering corresponding observations

Each world row contains X, Y and Z. The image row at the same position contains its corresponding u and v. A mistaken row pairing changes the estimated mapping; the calculator cannot infer which observations refer to the same physical feature from their coordinate values alone.

Use one image-coordinate convention consistently. Pixel axes that increase downward are acceptable if all observations use that convention. Mixing normalized coordinates with pixel coordinates or changing units in only some world rows produces a different numerical problem and should not be interpreted as lens calibration.

The default camera can be reconstructed

For the example, image u equals X plus zero-point-two Z, divided by Z plus four. Image v equals Y minus zero-point-one Z, divided by that same denominator. A representative camera matrix has rows one-zero-zero-point-two-zero, zero-one-minus-zero-point-one-zero and zero-zero-one-four.

The returned matrix is scaled to Frobenius norm one and may have the opposite overall sign. Neither change affects finite projected image coordinates. Compare ratios after projection, not literal equality of raw matrix entries, when verifying this known example against the displayed result.

Why coordinates are normalized first

World and image coordinates are separately centered and scaled so their typical distances have comparable normalized magnitudes. Each correspondence then contributes two homogeneous linear equations. Stacking them forms the DLT design matrix, whose smallest singular direction represents the fitted camera coefficients.

Normalization reduces avoidable conditioning problems caused by large offsets or unit differences, but cannot repair a fundamentally degenerate configuration. After solving the normalized problem, the coordinate transformations are removed to obtain a matrix in the original world and image coordinate systems.

Rank checks and the projective scale

Six correspondences provide twelve scalar image equations, but one camera scale is arbitrary. The design must therefore isolate a single coefficient direction rather than a higher-dimensional nullspace. The calculator checks the separation of the smallest directions before accepting the estimate.

An eigenvalue gap is a numerical identifiability diagnostic, not a universal calibration-quality score. Nearly coplanar world samples, repeated observations or weak depth variation can make a camera unstable even when a finite answer exists. Add spatially diverse correspondences instead of increasing decimal precision in the same degenerate layout.

Reprojection error is the visible residual

Each world point is projected with the recovered matrix and compared with its entered image location. The root-mean-square reprojection error uses the image-coordinate unit. If those coordinates are pixels, the headline error is in pixels, not meters or an angular unit.

Normalized DLT minimizes an algebraic homogeneous residual, not the final nonlinear sum of squared image reprojection errors. Those objectives coincide for exact compatible data but differ with noise. The returned residual describes the actual projected fit; it does not claim a nonlinear maximum-likelihood calibration or an uncertainty interval.

Limits of an uncalibrated camera model

A projective matrix does not by itself establish a focal length, physical sensor size or uniquely metric camera pose. Lens distortion is outside the model, and an observation projected to infinity is rejected. Internal camera decomposition requires additional assumptions about the image and world coordinate systems.

Use the matrix to inspect a small correspondence problem or initialize a dedicated calibration workflow. Check held-out spatial points when possible: fitting the input correspondences closely is not evidence of accurate extrapolation throughout a whole scene. Unexpected residual structure should prompt a review of pairings, geometry and distortion assumptions.

A few questions, answered

Is this a planar homography?

No. It estimates a3×4 mapping of general spatial points; a planar homography has a different domain.

Why are matrix entries scaled differently?

Projective matrices are equivalent up to any nonzero common scale, including an overall sign.

Can it estimate lens distortion?

No. The model contains a projective matrix only and has no distortion parameters.

Are six points always enough?

No. Their geometric configuration must also determine a unique, numerically resolved camera direction.

Find your calculator

Start typing to explore the library.