我试图从一个USB摄像头初始化pygame的,并显示视频的摄像头模块。 这是我的代码:
import pygame
import pygame.camera
from pygame.camera import *
from pygame.locals import *
pygame.init()
pygame.camera.init()
cam = pygame.camera.Camera("/dev/video0",(640,480))
cam.start()
image = cam.get_image()
然而,我得到这个错误:
Traceback (most recent call last):
File "C:/Users/Freddie/Desktop/CAMERA/Test1.py", line 7, in <module>
pygame.camera.init()
File "C:\Python27\lib\site-packages\pygame\camera.py", line 67, in init
_camera_vidcapture.init()
File "C:\Python27\lib\site-packages\pygame\_camera_vidcapture.py", line 21, in init
import vidcap as vc
ImportError: No module named vidcap
请帮助! 林在Windows