def cvimage_to_pygame(image):
"""Convert cvimage into a pygame image"""
return pygame.image.frombuffer(image.tostring(), image.shape[:2],
"RGB")
The function accepts a numpy array taken from cv2 camera. When I show the returned pyGame image in the pyGame window, it appears in three broken images. I do not know why this is so!
Any help would be greatly appreciated.
Here's what happens:
(Pygame on the left)

source
share