import numpy
import cv2
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(20) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
这是我的代码,我得到了这个错误
1.Module 'cv2' 没有'VideoCapture' 成员
2.模块'cv2'没有'imshow'成员
3.Module 'cv2' 没有'waitKey' 成员
4.Module 'cv2' 没有'destroyAllWindows' 成员
enter image description here
最佳答案
如果您使用 VSCode,您可以尝试使用以下代码:
from cv2 import cv2
关于python - 模块 'cv2' 没有 'VideoCapture' 成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61817354/