flipping the images by calling the flip function from the cv2 module
OpenCV-Python is a library of programming functions mainly aimed at real-time computer vision. cv2.flip() method is used to flip a 2D array. The function cv::flip flips a 2D array around vertical, horizontal, or both axes. The OpenCV function that flips the image (= ndarray ) vertically and horizontally is cv2. flip()
The image is flipped according to the value of flipCode as follows:
flipcode = 0 : flip vertically.
flipcode > 0 : flip horizontally.
flipcode < 0 : flip vertically and horizontally