How to load a CascadeClassifier using Emgu c#

≯℡__Kan透↙ 提交于 2019-12-24 04:30:32

问题


I have created my own cascade classifier using opencv_traincascade, i am trying to use it in my C# emgu project but it does not work using HaarCascade. I did some reading and found that CascadeClassifier is required to load xml files obtained through opencv_traincascade, But i could not find the namespace where the class is located. How to use CascadeClassifier in emgu c# project?


回答1:


You are correct, you need to use the CascadeClassifier class, the API for this can be found here

I shall give you an example using the included HAAR classifier

First, we need to construct a classifier using some of the built in training files. These can be found under the HaarCascades directory in the EmguCV installation directory. We make a new classifier like this:

private static readonly CascadeClassifier Classifier = new CascadeClassifier("haarcascade_frontalface_alt_tree.xml");

This example was taken from here which shows how to perform Face Detection in EmguCV.



来源:https://stackoverflow.com/questions/28415161/how-to-load-a-cascadeclassifier-using-emgu-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!