In the image flipping operation, we can flip the input images horizontally, vertically, horizontal, and vertically.
Image flipping
How to do it...
- Import the Computer Vision package - cv2:
import cv2
- Read the image using the built-in imread function:
image = cv2.imread('image_2.jpg')
- Display the original image using the built-in imshow function:
cv2.imshow("Original", image)
- Wait until any key is pressed:
cv2.waitKey(0)
- Perform the required operation on the test image:
# cv2.flip is used to flip images # Horizontal flipping of images using value '1' flipping = cv2.flip(image, 1)
- Display the horizontally flipped image:
# Display horizontally flipped image cv2.imshow("Horizontal...