3

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?

user2718964
  • 35
  • 1
  • 7

1 Answers1

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.

GPPK
  • 6,546
  • 4
  • 32
  • 57