Stores a generic 2D homography transform. More...
#include <vpi/Types.h>
Collaboration diagram for VPIHomographyTransform2D:Data Fields | |
| float | mat3 [3][3] |
| 3x3 homogeneous matrix that defines the homography. | |
Stores a generic 2D homography transform.
When only scale and translation transformation is needed, these parameters must be arranged in the matrix as follows:
\[ \begin{bmatrix} s_x & 0 & p_x \\ 0 & s_y & p_y \\ 0 & 0 & 1 \end{bmatrix} \]
Scaling \((s_x,s_y)\) is relative to the center of the patch, position \((p_x,p_y)\) is relative to the top-left of the image.
In the general case, given an homogeneous 2D point \(P(x,y,1)\) and the matrix \(M^{3x3}\), the Euclidean 2D point \(O(x,y)\) is defined as
\begin{align} T &= M \cdot P \\ O &= (T_x/T_z, T_y/T_z) \end{align}