Is there a way to make images vertical from left facing or right facing?

Viewed 21

I have input images that are either right-oriented i.e (90 degrees from the center clockwise) or left-oriented i.e (270 or -90 degrees from the center clockwise). I need to convert either of these images to vertical orientation. I have tried to do it using the Pillow library but nothing seems to be working.

I need to know the orientation first. If it's right facing, I rotate by 270 clockwise; if it's left facing, I turn by just 90 clockwise.

This is my input image here

I need to make it vertical

This is how I want the image

Any orientation, be it left or right needs to be verticallly alligned.

1 Answers

You can use cv2.flip(src, dst, flipCode)

Related