首页 新闻 赞助 找找看

opencv-python VideoCapture获取笔记本内置摄像头失败

0
悬赏园豆:15 [待解决问题]

import cv2

def camera_capture():
cap = cv2.VideoCapture(0)#打开摄像头
while cap.isOpened():
ret, frame = cap.read()
cv2.isshow('img', frame)
if cv2.waitKey(1) == ord('q'):
break
cv2.destroyAllWindows()
cap.release()

Press the green button in the gutter to run the script.

if name == 'main':
camera_capture()

报错如下

小白兔有点裤的主页 小白兔有点裤 | 初学一级 | 园豆:155
提问于:2022-04-04 19:36
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册