working model
This commit is contained in:
14
camera.py
Normal file
14
camera.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user