简体   繁体   English

OpenCV:如何使用cv2.CascadeClassifier获得功能?

[英]OpenCV: How to get features with cv2.CascadeClassifier?

I know that haarcascade.xml describes some features of some object we want to detect. 我知道haarcascade.xml描述了我们要检测的某些对象的某些功能。 Eg face has a nose, eyes and it is ellipse or auto-plates has a line of digits and letters with specific size and proportion. 例如,脸部有鼻子,眼睛和椭圆形,或者自动印版具有特定大小和比例的数字和字母的行。

If we use: 如果我们使用:

cascade = cv2.CascadeClassifier('haarcascade.xml')
objects = cascade.detectMultiScale(gray, 1.1, 3)

we will get a list of box parameters (x,y,w,h) 我们将获得一个框参数列表(x,y,w,h)

Is there any way to get all features parameters? 有没有办法获取所有功能参数?

eg if haarcascade describes face I want to get nose coordinates (without using additional haarcascade) or if haarcascade describes auto-plates I want to get coordinates of each symbol. 例如,如果haarcascade描述我想要获得鼻子坐标(不使用其他haarcascade)的脸,或者haarcascade描述自动铭牌我想要获得每个符号的坐标。

Have a look at this paper Rapid Object Detection using a Boosted Cascade of Simple Features . 看一下本文中使用简单特征的增强级联进行快速目标检测 It explains the implementation of the cascade. 它说明了级联的实现。 As you can see they use Haar Features , so you won't be able to extract that information. 如您所见,他们使用Haar Features ,因此您将无法提取该信息。 But there is a special cascade for detecting eyes . 但是有一个特殊的级联可以检测眼睛 Maybe this helps you. 也许这对您有帮助。 You can find all other pretrained cascades here . 您可以在这里找到所有其他预训练的级联。 If you want to extract the nose position you may need to train your own cascade or search for an .xml file for that. 如果要提取鼻子位置,则可能需要训练自己的级联或为此搜索.xml文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 &#39;cv2.CascadeClassifier&#39; 对象没有属性 &#39;detectMultiscale&#39; - 'cv2.CascadeClassifier' object has no attribute 'detectMultiscale' OpenCV 4.0.0 系统错误:<class 'cv2.CascadeClassifier'> 返回带有错误集的结果 - OpenCV 4.0.0 SystemError: <class 'cv2.CascadeClassifier'> returned a result with an error set OpenCV 错误:无法使用 cv2.CascadeClassifier 在读取模式下打开 xml 文件 - OpenCV Error: Can't open xml file in read mode using cv2.CascadeClassifier 无法在 cv2.CascadeClassifier() 上读取从 AWS S3 获取的 xml 文件 - Can't read xml file get from AWS S3 on cv2.CascadeClassifier() “detectMultiScale”需要一个“cv2.CascadeClassifier”object,但收到一个“numpy.ndarray” - 'detectMultiScale' requires a 'cv2.CascadeClassifier' object but received a 'numpy.ndarray' "如何获得 cv2.CascadeClassifier.detectMultiScale() 的分数?" - How to get a score for cv2.CascadeClassifier.detectMultiScale()? 实时使用 cv2.CascadeClassifier() 时显示图像的延迟 - delay of shown images when using cv2.CascadeClassifier() in real-time Assertion failed error in cv::CascadeClassifier::detectMultiScale in openCV - Assertion failed error in cv::CascadeClassifier::detectMultiScale in openCV 如何修复“cv2”没有属性“CascadeClassifier”? - How to fix 'cv2' has no attribute 'CascadeClassifier'? cv2 CascadeClassifier参数 - cv2 CascadeClassifier parameters
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM