[英]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.