opencv 3.0.0-dev python 绑定不能正常工作 [英] opencv 3.0.0-dev python bindings not working properly
问题描述
我在 ubuntu 14.04.02,我安装并更新了 python、cython 和 numpy.我从 http://github.com/itseez/opencv 中提取了最新的 open cv 源,根据编译到文档...在尝试运行我从 https://github.com/shantnu/FaceDetect/ 中提取的 python 源代码时它给了我以下错误:
I am on ubuntu 14.04.02, i have python, cython and numpy installed and updated. i pulled the latest sources of open cv from http://github.com/itseez/opencv, compiled according to the documentation... when trying to run the python source i pulled from https://github.com/shantnu/FaceDetect/ it's giving me the following error :
modprobe:致命:未找到模块 nvidia.回溯(最近一次调用最后一次):文件face_detect.py",第 21 行,在标志 = cv2.cv.CV_HAAR_SCALE_IMAGEAttributeError: 'module' 对象没有属性 'cv'
modprobe: FATAL: Module nvidia not found. Traceback (most recent call last): File "face_detect.py", line 21, in flags = cv2.cv.CV_HAAR_SCALE_IMAGE AttributeError: 'module' object has no attribute 'cv'
为了确保我有 python 绑定,我在终端中输入了以下内容:蟒蛇
to make sure i have the python bindings i typed the following in the terminal: python
import cv2
cv2.__version__
它返回了以下内容'3.0.0-开发'
it returned the following '3.0.0-dev'
它可能有什么问题?
推荐答案
在opencv3.0中去掉了cv2.cv子模块,也修改了一些常量.
the cv2.cv submodule got removed in opencv3.0, also some constants were changed.
请改用 cv2.CASCADE_SCALE_IMAGE
please use cv2.CASCADE_SCALE_IMAGE instead
(做一个 help(cv2)
来查看更新的常量)
(do a help(cv2)
to see the updated constants)
这篇关于opencv 3.0.0-dev python 绑定不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!