Perspective transformation is the most general transformation. Its matrix form is:

  • Its upper left corner is an invertible matrix .
  • The upper right corner is the translation
  • The lower left corner is the scale .

Since the homogeneous coordinates are used, when , we can divide the entire matrix by to get a matrix with a bottom right corner of . Otherwise, we get a matrix with a bottom right corner of . Therefore, the 2D perspective transformation has a total of 8 degrees of freedom, and 3D has a total of 15 degrees of freedom.

The transformation from the real world to a camera photo can be seen as a perspective transformation. The reader can imagine what a square tile would look like in a photo. First, it is no longer square. Second, since the close part is larger than the far-away part, it is not even a parallelogram but an irregular quadrilateral.