import cv2
img = cv2.imread('G:/py/i/666.jpg')
# 图像缩放
img1 = cv2.resize(img, (300,300))
# img1 = cv2.resize(img, None,fx=0.5,fy=0.5)
# 图像旋转
# rows,cols,depth = img.shape
# M = cv2.getRotationMatrix2D((rows // 2, cols // 2), 180, 1)
# img2 = cv2.warpAffine(img,M,(cols,rows))
# ROTATE_90_CLOCKWISE顺时针旋转90度,ROTATE_90_COUNTERCLOCKWISE:逆时针旋转90度,ROTATE_180旋转180度
img2=cv2.rotate(img,cv2.ROTATE_180)
# 图像反转(1左右,-1上下)
img3=cv2.flip(img,1)
# img3=cv2.flip(img,-1)
# 图像模糊
img4 = cv2.GaussianBlur(img, (11, 11), 0)
cv2.imshow('img', img2)
cv2.waitKey()
还没有评论,来说两句吧...