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:
- Since the redundancy (from 8 to 9) of degrees of freedom is $i=1$ ?
- what is the $w$ and $w'$ ? are they parameters? how do i calculate them?
- 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:
and find matrix $M$
so I get back this image:
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);
imshow(I_projective)
title('unprojective - rectangular carpet')
taken from here