opencv教程CV2模块——翻转图片并保存
import cv2
img = cv2.imread('./imgg/1.jpeg',cv2.IMREAD_COLOR)
'''
使用函数cv2.flip(img,flipcode)翻转图像,flipcode控制翻转效果。
flipcode = 0:沿x轴翻转
flipcode > 0:沿y轴翻转
flipcode < 0:x,y轴同时翻转
'''
imgflip = cv2.flip(img, -1)
cv2.imshow('image',imgflip)
cv2.imwrite('./out/1_3.jpg',imgflip, [int(cv2.IMWRITE_PNG_COMPRESSION), 5])
# cv2.destroyAllWindows()