带有 Python 3.5 的 OpenCV 3.1.0 中的 `CV_HAAR_SCALE_IMAGE` 在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41341409/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 00:51:02  来源:igfitidea点击:

Where is `CV_HAAR_SCALE_IMAGE` in OpenCV 3.1.0 with Python 3.5?

pythonopencv

提问by notalentgeek

I get this error.

我收到这个错误。

AttributeError: module 'cv2' has no attribute 'CV_HAAR_SCALE_IMAGE'

After upgrading my OpenCV to 3.1.0. I have tried these.

将我的 OpenCV 升级到 3.1.0 后。这些我都试过了。

cv2.cv.CV_HAAR_SCALE_IMAGE

And also this.

还有这个。

cv2.CV_HAAR_SCALE_IMAGE

But still same error. I go here, http://docs.opencv.org/3.1.0/d9/d31/group__objdetect__c.html#ga812f46d031349fa2ee78a5e7240f5016but I could not find any information of to which object the constants stored in.

但还是同样的错误。我去这里,http://docs.opencv.org/3.1.0/d9/d31/group__objdetect__c.html#ga812f46d031349fa2ee78a5e7240f5016但我找不到任何关于常量存储在哪个对象的信息。

回答by Rahul K P

The sub module cvhas been removed from opencv 3.0,

子模块cv已从opencv 3.0

You can use an alternative cv2.CASCADE_SCALE_IMAGE

您可以使用替代方法 cv2.CASCADE_SCALE_IMAGE

[Edit]

[编辑]

For further details check this.

有关更多详细信息,请检查