简体   繁体   English

如何在openCV中使用cascade.xml进行对象识别

[英]How to use cascade.xml for object recognition in openCV

I've generated cascade xml in openCV using haar training module.. Now how can I use it for Object recognition.? 我已经使用haar训练模块在openCV中生成了层叠XML。现在如何将其用于对象识别。

Please help.!! 请帮忙。!! _/_ _ / _

Following opencv doc on Object Detection, you have to create the cascade detector object and ::load the cascade you want to apply (the xml file you have generated). 遵循有关对象检测的opencv doc之后,您必须创建级联检测器对象并::load要应用的级联(已生成的xml文件)。 ::detectMultiScale is used to fill a std::vector<cv::Rect> of detected object from current frame by sliding windows of different scales and sizes and merging high confident close samples. ::detectMultiScale用于通过滑动不同比例和大小的窗口并合并高置信度封闭样本来填充当前帧中被检测对象的std::vector<cv::Rect>

Code here ! 在这里编码!

If you use haartraining you can use "opencv_performance.exe". 如果您使用haartraining,则可以使用“ opencv_performance.exe”。 You can find it in "opencv\\bin...\\" But if you have cascade.xml it's mean you used traincascade. 您可以在“ opencv \\ bin ... \\”中找到它,但是,如果您拥有cascade.xml,则意味着您使用了traincascade。 There are no already build bin to check your cascade. 还没有构建bin来检查级联。 You can find example in "opencv\\samples\\cpp\\tutorial_code\\objectDetection". 您可以在“ opencv \\ samples \\ cpp \\ tutorial_code \\ objectDetection”中找到示例。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM