module 'cv2.cv2' has no attribute 'cv'
程序员文章站
2024-03-25 10:58:52
...
错误原因:opencv版本问题,改为opencv 3的代码就可以了
碰到的代码错误:
cap = cv2.VideoCapture(0)
fourcc = cv2.cv.FOURCC(*'XVID')
out = cv2.VideoWriter('output.avi', fourcc, 20.0, (640, 480))
修改:
fourcc = cv2.VideoWriter_fourcc(*'XVID')
上一篇: animate.css使用
下一篇: C语言概述
推荐阅读
-
解决报错 module ‘cv2.cv2‘ has no attribute ‘xfeatures2d‘
-
图像拼接遇到module 'cv2.cv2' has no attribute 'xfeatures2d'
-
Module ‘cv2.cv2‘ has no attribute ‘ximgproc‘
-
报错:AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
-
编程报错:module 'cv2.cv2' has no attribute 'xfeatures2d'
-
module 'cv2.cv2' has no attribute 'cv'
-
module ‘cv2.cv2‘ has no attribute ‘face‘
-
OpenCV报错module 'cv2.cv2' has no attribute 'xfeatures2d'
-
module ‘yaml‘ has no attribute ‘FullLoader‘
-
python错误:AttributeError: 'module' object has no attribute 's