You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
436 B

3 years ago
import sys
import cv2
import numpy as np
import matplotlib.pyplot as plt
def mirror_flip(img_path, type):
img = cv2.imread(img_path, 1)
result = cv2.flip(img, type)
cv2.imwrite('./output/mirror_flip.jpg', result)
'''
输入图片地址镜像类型(1,0,-1)
输出type=1 水平镜像
type=0 垂直镜像
type=-1 对角镜像
'''
if __name__ == '__main__':
mirror_flip(sys.argv[1], eval(sys.argv[2]))