Welcome to Rider Pi Robot repository
6. Image Rotation
6. Image Rotation
6.1. Image rotation
cv2.getRotationMatrix2D(center, angle, scale)
Parameter explanation:
center: the center point of rotation
angle: the angle of rotation. Positive numbers are counterclockwise; negative numbers are clockwise.
scale: transformation scale (scaling). 1 means no change, less than 1 means shrinking, and greater than 1 means enlarging.
6.2. Actual effect display
Code path:
/home/pi/Rider-pi_class/4.Open Source CV/B.Geometric_Transformations/06_Image_Rotation.ipynb
import cv2import numpy as npimg = cv2.imread('yahboom.jpg',1)#cv2.imshow('src',img)