You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-backend/camera.py

15 lines
283 B

import pygame
import pygame.camera
def capture():
pygame.camera.init()
pygame.camera.list_cameras()
cam = pygame.camera.Camera('/dev/video4', (640, 480))
cam.start()
img = cam.get_image()
pygame.image.save(img, './capture.jpg')
return './capture.jpg'