Image Warping and Mosaicing
Roth Yin | rothyin@berkeley.edu
Shoot the Pictures
Recover Homographies
Homography transformation:
- Given the original image p, the transformed image p', and the transformation matrix H, we have p' = Hp as follows, with h33 = 1.
- Because za is unknown, reduce the linear system to cancel za. Then the linear system becomes:
shown as example of 4 points
- Use least square regression np.linalg.lstsq to solve the matrix for robustness.
Use cpselect
in Control Point Selection tool from MATLAB to define corresponding keypoints of the two images.
The above matrices are from Homography Estimation by Yalda Zadeh.
Warp the Images
Warp the right image to match the left image.
- Use inverse warping for better color.
- Use
scipy.interpolate.RectBivariateSpline
to interpolate the color in the case of not landing right on pixel grid.
Image Rectification
original |
warped to left |
warped to right |
|
|
|
|
|
|
Blend the Images into a Mosaic