[英]AttributeError: module 'cv2.cv2' has no attribute 'nameWindow'
I've install opencv-python but it still have this problem.我已经安装了 opencv-python 但它仍然有这个问题。
python version:3.7.7 python 版本:3.7.7
opencv-python version:4.4.0.46 opencv-python 版本:4.4.0.46
opencv-contrib-python version:4.4.0.46 opencv-contrib-python 版本:4.4.0.46
and here's my code这是我的代码
import cv2 as cv
def GetPicture():
cv.namedWindow('camera', 1)
cap = cv.VideoCapture(0)
ret, frame = cap.read()
cv.imwrite('C:/person.jpg', frame)
cap.release()
I've tried different version of opencv, this problem can't be solved.我试过不同版本的opencv,这个问题不能解决。
nameWindow
doesn't exist. nameWindow
不存在。 namedWindow
does. namedWindow
可以。
your code as you posted it could not have thrown that error.您发布的代码不可能引发该错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.