python opencv:AttributeError: 'module' object has no attribute 'cv' FOURCC
2017-10-27 16:17
1041 查看
今天我在做视频读取的时候,碰到了一个代码错误,如下:
Traceback (most recent call last):
File "video_demo.py", line 31, in <module>
fourcc = cv2.cv.FOURCC(*'XVID')
AttributeError: 'module' object has no attribute 'cv'
这是因为我使用的是opencv 3而运行的代码是opencv2 版本的,所以代码换成opencv 3 版本就行了:
fourcc = cv2.VideoWriter_fourcc(*'XVID')
就行了
During Saving a video using python and opencv
[2]06-python opencv 读取视频文件并保存. http://blog.csdn.net/huanglu_thu13/article/details/52337234
Traceback (most recent call last):
File "video_demo.py", line 31, in <module>
fourcc = cv2.cv.FOURCC(*'XVID')
AttributeError: 'module' object has no attribute 'cv'
这是因为我使用的是opencv 3而运行的代码是opencv2 版本的,所以代码换成opencv 3 版本就行了:
fourcc = cv2.VideoWriter_fourcc(*'XVID')
就行了
参考文献
[1]ErrorDuring Saving a video using python and opencv
[2]06-python opencv 读取视频文件并保存. http://blog.csdn.net/huanglu_thu13/article/details/52337234
相关文章推荐
- opencv3:AttributeError: 'module' object has no attribute 'CV_LOAD_IMAGE_COLOR'
- [数字图像处理实验][python+opencv]'module' object has no attribute 'cv'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- Python:AttributeError: ‘module’ object has no attribute ‘ArgumentParser’
- Python错误AttributeError: 'module' object has no attribute 'copy'
- Python脚本报错AttributeError: ‘module’ object has no attribute ’urllibopen'(Python 2.7.11 )
- python3 报错: AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError: module object has no attribute “Series”. Code works in Python
- [Python]attributeError:'module' object has no attribute 'dump'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’
- python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法
- AttributeError: 'module' object has no attribute 'AF_INET'处理办法——python
- Python3.X识别混合编码,顺便解决“AttributeError: 'module' object has no attribute 'urlopen'”
- Python 使用sqlite3报错 AttributeError: 'module' object has no attribute 'connect'
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- [python错误]builtins.AttributeError: 'module' object has no attribute 'request'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法