I am trying to display my Webcam's (a GoPro 8) video onto the computer with OpenCV, but I do not want the autorotation feature -- by that I mean when I shift from holding the GoPro from landscape to portrait (say rotated 90degree), I want the displayed image on my computer to show the rotated view in landscape.
Image displayed on computer when held on Landscape
Image displayed on computer when held on Portrait
So the above two photo shows what is does right now, but I want it to look like the below. Ideal image displayed on computer when held on Portrait
Here is my code:
video = cv2.VideoCapture(1)
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
while(True):
ret, frame = video.read()
if ret == True:
flipped = cv2.flip(frame, 1) #flip frame vertically, I want it flipped for other reasons
cv2.imshow('window', flipped)
if cv2.waitKey(1) & 0xFF == ord('q') :
break
cv2.destroyAllWindows()
Is there any way I can ignore the orientation of the external webcam? I tried rotating the images with cv2.rotate() but it is not what I want.