In [1]:
import cv2
In [2]:
img = cv2.imread('data/src/lena.jpg')
print(type(img))
In [3]:
print(img.shape)
In [4]:
img_flip_ud = cv2.flip(img, 0)
cv2.imwrite('data/dst/lena_cv_flip_ud.jpg', img_flip_ud)
Out[4]:
In [5]:
img_flip_lr = cv2.flip(img, 1)
cv2.imwrite('data/dst/lena_cv_flip_lr.jpg', img_flip_lr)
Out[5]:
In [6]:
img_flip_ud_lr = cv2.flip(img, -1)
cv2.imwrite('data/dst/lena_cv_flip_ud_lr.jpg', img_flip_ud_lr)
Out[6]: