I am trying to build a GUI using pygame but when I try to stream a camera using opencv and show it on the screen, pygame rotates the picture 90 degrees to the right. How do I prevent pygame from rotating the picture?
image = self.cam.read() # getting the picture
if image is not None:
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # transforming the picture from BGR to RGB
image = pygame.surfarray.make_surface(image) # making the picture a pygame surface
self.snapshot = image
# blit it to the display surface. simple!
self.display.blit(self.snapshot, (0, 0)) # displaying the picture
pygame.display.update() # updating the screen