November 2018
Intermediate to advanced
492 pages
12h 19m
English
The scikit-image transform module's warp() function can be used for inverse warping for the geometric transformation of an image (discussed in a previous section), as demonstrated in the following examples.
Applying an Affine transformation on an image
We can use the SimilarityTransform() function to compute the transformation matrix, followed by warp() function, to carry out the transformation, as shown in the next code block:
im = imread("../images/parrot.png")tform = SimilarityTransform(scale=0.9, rotation=np.pi/4,translation=(im.shape[0]/2, -100))warped = warp(im, tform)import matplotlib.pyplot as pltplt.imshow(warped), plt.axis('off'), plt.show()
The following figure ...
Read now
Unlock full access