Open autocomputer opened 9 months ago
I haven't used opencv python much, but the frame is a numpy array. You can get it as a PIL Image with
from PIL import Image img1 = Image.fromarray( frame )
and then if you are using a Jupyter notebook you can just view the image : img1
If you want to save it, you can just do: img1.save( filename )
Matplotlib may also be used to show the image from the numpy array directly: import matplotlib.pyplot as plt plt.imshow(frame)
For interactive display I've been using pygame so I used:
frameRGB = frame[:,:,::-1].copy()
SB = pygame.surfarray.make_surface( frameRGB.transpose(1,0,2) )
Hi, I run the frame, timestamp = c.read() successfully and I got the frame. Could anyone tell me how to display frame by opencv-python? Thanks.