Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a 2D projection of a flat, rectangular object in 3D space, like this one:

enter image description here

I know all sorts of information about this shape—its opposite sides have the same length, the sides meet at right angles, the ratio of one side length to another. However, I don't know the details of the projection or the vertices coordinates in 3D space.

I'd like to compute the perspective transformation I'd use to, e.g., paint text over the 2D image so that it matches the camera's perspective as if it existed on the 3D model.

share|cite|improve this question

Given the four points of the transformed rectangle, you can compute 2D perspective transform by solving system of eight linear equations.

The stability of the solution depends on coordinate system, precision of point locations and distance from nearest degenerate configuration.

A method proposed by Hartley & Zisserman (Multiple-View Geometry) is thus a Normalized Direct Linear Transformation, which does preconditioning prior to solving the linear equations (the preconditioner is basically an affine transform that maps coordinates of two quadrilaterals into common frame and scale).

Note that linear solution of the problem minimizes only algebraic distance and has little geometrical meaning. Iterative solution with geometric cost function (e.g. symmetric transfer error) should be considered in presence of noise. This essay may be helpful.

You can find more under the keywords "homography estimation".

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.