module 'cv2' has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'
来源:互联网 发布:手机淘宝怎么复制宝贝 编辑:程序博客网 时间:2024/05/29 17:37
简介
使用cv2.CV_LOAD_IMAGE_GRAYSCALE时报错:module ‘cv2’ has no attribute ‘CV_LOAD_IMAGE_GRAYSCALE’。Traceback (most recent call last):
File “/Users/n1/Desktop/FaceDetection/face.py”, line 8, in
gray = imread(fname, CV_LOAD_IMAGE_GRAYSCALE )
NameError: name ‘CV_LOAD_IMAGE_GRAYSCALE’ is not defined原来是 CV_LOAD_IMAGE_GRAYSCALE is from the outdated [and now removed] cv api
In OpenCV 3.1 for C++ you have to use cv::ImreadModes::IMREAD_GRAYSCALE which is located on
解决方法
应该用:
cv2.IMREAD_GRAYSCALE
参考
【1】opencv - ‘CV_LOAD_IMAGE_GRAYSCALE’ is not defined{PY} - Stack Overflow
https://stackoverflow.com/questions/27424285/cv-load-image-grayscale-is-not-definedpy
阅读全文
0 0
- module 'cv2' has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'
- module 'cv2' has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'
- AttributeError: module 'cv2' has no attribute 'SIFT'
- AttributeError: module 'cv2.face' has no attribute 'createEigenFaceRecognizer' 解决办法
- AttributeError: 'module' object has no attribute 'getpass'
- 'module' object has no attribute 'basicConfig'
- AttributeError: 'module' object has no attribute 'Serial'
- 'module' object has no attribute 'rindex'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- Django: 'module' object has no attribute 'index'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- python-module 'pymysql' has no attribute 'connect'
- AttributeError: 'module' object has no attribute 'XXX'
- AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError:'module' object has no attribute 'classify'
- Git命令详解
- 关于Java中面向对象章节、IO 流中的重点基础知识。
- DNA Consensus String UVA
- gfoj_704 数组操作
- python的几种数据结构
- module 'cv2' has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'
- canvas学习小记
- DAY64 Django基础1
- Life is too short to be ordinary!
- Cookie学习杂记
- 惯性导航-加速度计
- 猴子下山摘桃
- hadoop词频统计报错,没解决
- react-native导入他人项目