def __init__(self, resolution = (160, 120), framerate = 20):
import pygame
import pygame.camera
super().__init__()
pygame.init()
pygame.camera.init()
l = pygame.camera.list_cameras()
self.cam = pygame.camera.Camera(l[0], resolution, "RGB")
self.resolution = resolution
self.cam.start()
self.framerate = framerate
# initialize variable used to indicate
# if the thread should be stopped
self.frame = None
self.on = True
print('WebcamVideoStream loaded.. .warming camera')
time.sleep(2)
评论列表
文章目录