[英]Visual studio code doesn't import opencv library into python
I was trying to write a python file that opens the camera,only that when I write import cv2
it gives me an error我试图编写一个打开相机的 python 文件,只是当我写import cv2
时它给了我一个错误
Try the following:尝试以下操作:
import cv2
vc = cv2.VideoCapture(0)
while True:
_, frame = vc.read()
cv2.imshow('frame', frame)
vc.release()
cv2.destroyAllWindows()
If this does not work, can you specify your error?如果这不起作用,你能指定你的错误吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.