January 2018
Intermediate to advanced
268 pages
6h 20m
English
We can choose four control points in the source image and map them to the destination image. Parallel lines will not remain parallel lines after the transformation. We use a function called getPerspectiveTransform to get the transformation matrix.
Let's apply a couple of fun effects using projective transformation, and see what they look like. All we need to do is change the control points to get different effects.
Here's an example:

The control points are as follows:
src_points = np.float32([[0,0], [0,rows-1], [cols/2,0],[cols/2,rows-1]])dst_points = np.float32([[0,100], [0,rows-101], [cols/2,0],[cols/2,rows-1]])
As an ...
Read now
Unlock full access