Perform the following steps to apply a projective transformation to an image using the transform module from scikit-image:
- First, read the source image and create a destination image with the np.zeros() function:
im_src = (imread('images/humming2.png'))height, width, dim = im_src.shapeim_dst = np.zeros((height, width, dim))
- Create an instance of the ProjectiveTransform class:
pt = ProjectiveTransform()
- You just need to provide four pairs of matching points between the source and destination images to estimate the homography matrix, H, automatically for you. Here, the four corners of the destination image and the four corners of the input hummingbird are provided as matching points, as shown in the following code block: ...