I want to access my Webcam via python. Unfortunately openCV is not working because of the webcam. Pygame.camera works like a charm with this code:
from pygame import camera,display
camera.init()
webcam = camera.Camera(camera.list_cameras()[0])
webcam.start()
img = webcam.get_image()
screen = display.set_mode((img.get_width(), img.get_height()))
display.set_caption("cam")
while True:
screen.blit(img, (0,0))
display.flip()
img = webcam.get_image()
My question is now, how can I get a numpy array from the webcam?