With the Transformation Matrix given from the last step, we now have to apply it in real time.
In this project was used a bilinear interpolation to reconstruct the rectified images.
The implementation required is simple, consisting of the following steps:
- For each coordinate [0-639;0-479], multiply it by the thransformation matrix. The result is an homogenous coordinate of the point to interpolate from the images.
- Transform the homogeneous coordinates into cartesians. This is done by dividing U and V by W, obtaining X and Y respectively.
- Read the 4 pixels surrounding the calculated coordinates, and perform a bilinear interpolation.
- Send images to the monitor, memory, or other output.