# Fitting projective transformation

Given set of points in $3D$ ( $X = (x_1, x_2, x_3)$, $Y = (y_1, y_2, y_3)$ ), how can I fit transformation from $X$ to $Y$?

As far as I know this is called projective transformation. Here is example of $X$ and $Y$. Blue and red lines in $X$ are parallel, but they are not parallel in $Y$.

-
Why do you use the term "projective"? Are the output coordinates constrained in some way? –  Tpofofn Dec 26 '10 at 21:17
@Commodore64: At first, I thought it's possible to find appropriate transformation matrix from X to Y. But this transformation is non-linear and it's not possible to represent non-linear transformation matrix in general. There are some tricks, such as using homogenous coordinates or Jacobian matrix, but they make things more complicated. –  qutron Dec 27 '10 at 12:34
have you looked at least squares techniques? –  Tpofofn Dec 27 '10 at 13:59