I am trying to understand the formalism of the projective transform of 2D image. it has 9 parameters (a-i) which the 9th is redundant since we use houmogenous coordinates. this transformation preserves only straight lines.

$\pmatrix{x'\\ y' \\ w'}$ = $\pmatrix{ a& b& c\\\ d& e& f \\\ g& h& i}$ $\pmatrix{x\\ y \\ w}$

I have three questions according this formalism:

  1. Since the redundancy (from 8 to 9) of degrees of freedom is $i=1$ ?
  2. what is the $w$ and $w'$ ? are they parameters? how do i calculate them?
  3. How can I find the parameters so I can transform the image to its original(from the black background image to the square one).

what I want to do is build the matrix to transform this image:

input image

and find matrix $M$

so I get back this image:

enter image description here

All the images above taken from here

What I want finally do is to find the

M = [a  b c; 
     d  e f;
     g  h i];

t_proj = maketform('projective',T);   
I_projective = imtransform(I,t_proj,'FillValues',.3);
title('unprojective - rectangular carpet')

taken from here


1 Answer 1


You have to understand that projective transformation is not linear. It's $(x,y) -> (X(x, y)/Z(x,y) , Y(x, y)/Z(x,y))$, where X, Y, Z - linear functions.

$w$ and $w'$ are essential here - they help represent this non-linear transformation as linear - matrix multiplication - and that way this linear representation is a homomorphism (preserve "chaining" of operations).$w$ for input image is usually taken as $1$; You get $w'$ from matrix multiplication ($w' = gx + hy + iw$ ) and the end result of transform is $(x'/w', y'/w')$

Generally speaking you can't just assign $i=1$, but due to homogeneity you can divide all the matrix by $i$ and get new matrix, representing the same transform with right-left element $1$

I would advise you to read some textbook on projective geometry for computer vision to better understand this subject. Those questions have some deep implications.

  • 3
    $\begingroup$ good reference: Multiple View Geometry $\endgroup$
    – Maurits
    Feb 22, 2012 at 10:33
  • $\begingroup$ It would be nice you someone can add more details and answers all the questions above thanks. $\endgroup$
    – 0x90
    Mar 6, 2012 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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