成功解决AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'和 'CV_CAP_PROP_FRAME_WIDTH'

简介: 成功解决AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'和 'CV_CAP_PROP_FRAME_WIDTH'

目录

解决问题

解决方法


 

 

解决问题

AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'和 no attribute 'CV_CAP_PROP_FRAME_WIDTH'

 

 

解决方法

版本升级导致方法名称有所改变!

videoCapture.get(cv2.CV_CAP_PROP_FPS)

videoCapture.get(cv2.CV_CAP_PROP_FRAME_WIDTH)

改为

videoCapture.get(cv2.CAP_PROP_FPS)

videoCapture.get(cv2.CAP_PROP_FRAME_WIDTH)

 

哈哈,大功告成!

 

 


相关文章
|
4月前
|
计算机视觉 Python
AttributeError: module ‘cv2‘ has no attribute ‘face‘
AttributeError: module ‘cv2‘ has no attribute ‘face‘
|
6月前
|
机器学习/深度学习
RuntimeError mat1 and mat2 shapes cannot be multiplied
RuntimeError mat1 and mat2 shapes cannot be multiplied
477 0
|
存储 API
sws_scale():bad dst image pointers
sws_scale():bad dst image pointers
300 0
sws_scale():bad dst image pointers
|
计算机视觉 Python
cv2 resize 与reshape的区别
cv2 resize 与reshape的区别
|
计算机视觉
图像拼接遇到module ‘cv2.cv2‘ has no attribute ‘xfeatures2d‘
图像拼接遇到module ‘cv2.cv2‘ has no attribute ‘xfeatures2d‘
131 0
|
算法 计算机视觉 Python
【完美解决方案】module ‘cv2.cv2‘ has no attribute ‘xfeatures2d‘
【完美解决方案】module ‘cv2.cv2‘ has no attribute ‘xfeatures2d‘
1181 0
|
计算机视觉
cv2.error: OpenCV(4.5.2) : -1 : error: (-5:Bad argument) in function ‘rectangle‘
cv2.error: OpenCV(4.5.2) : -1 : error: (-5:Bad argument) in function ‘rectangle‘
445 0
|
计算机视觉
【opencv】cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function ‘imshow‘
【opencv】cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function ‘imshow‘
813 0
【opencv】cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function ‘imshow‘
|
Python
完美解决 TypeError: Invalid shape (3, 224, 224) for image data
完美解决 TypeError: Invalid shape (3, 224, 224) for image data
918 0
error: ‘VPX_IMG_FMT_RGB32’ undeclared (first use in this function); did you mean ‘VPX_IMG_FMT_NV12’?
error: ‘VPX_IMG_FMT_RGB32’ undeclared (first use in this function); did you mean ‘VPX_IMG_FMT_NV12’?
104 0