Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

According to image processing literature, it is valid to compose multiple affine transformation matrices in order to apply just one transformation matrix to an image instead of subsequently applying all of the matrices.

Is it also valid to compose two different types of transformation matrices, for example an affine transformation matrix $A$ and a perspective transformation matrix $P$ (which is non-linear) $A \cdot P$?

If not, is there another way to merge these transformation into one matrix?

share|improve this question

1 Answer 1

It is a basic fact of mathematics that given $r$ maps $f_i: X_{i-1}\to X_i$ $\ (1\leq i\leq r)$ one can apply these maps in turn to arbitrary points $x\in X_0$ and gets as output a point $y\in X_r$ which is defined by $$y=f_r\Bigl(f_{r-1}\bigl(\ldots f_2(f_1(x))\ldots\bigr)\Bigr)\ .$$ In this way a map $$\phi:\quad X_0\to X_r, \quad x\mapsto y$$ is generated, and one writes $\phi:=f_r\circ f_{r-1}\circ\ldots\circ f_1$.

This $\phi$ is a well-defined mathematical object by itself. As it leads directly from $x\in X_0$ to $y\in X_r$ the individual $f_i$ will no longer be visible in its expression (and can in fact be discarded). The actual expression of $\phi$ depends on circumstances. When, e.g., all $f_i$ are linear (or affine) maps then $\phi$ is such a map as well and can be expressed by a matrix (plus a constant vector). When the $f_i$ are defined in more complicated ways the resulting expression for $\phi$ will be more complicated, too. But in any case the expression of $\phi$, taking the encoding of an arbitrary $x\in X_0$ as input (e.g., $x=(x_1,x_2,x_3)$) and giving the encoding of the image point $y:=\phi(x)$ as output, can be computed once and for all.

share|improve this answer
Thanks a lot, Christian. Can summarize your detailed answer to: Yes, combining an affine and a perspective map is valid, but the resulting map is no longer linear? –  philllies Mar 25 '12 at 9:19
@philllies: Yes. –  Christian Blatter Mar 25 '12 at 9:34
Brilliant, thanks again. –  philllies Mar 25 '12 at 9:40

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.