March 2019
Intermediate to advanced
532 pages
13h 2m
English
In order to rotate the image, we make use of the cv.getRotationMatrix2D() function to build the 2 x 3 transformation matrix. This matrix rotates the image at the desired angle (in degrees), where positive values indicate a counterclockwise rotation. Both the center of rotation and the scale factor can also be adjusted. Using these elements in our example, the following transformation matrix is calculated:

This expression has the following values:

The following example builds the M transformation matrix to rotate 180 degrees ...