A simple C# face detection from EmguCV library. Using the classifier is "haarcascade_frontalface_alt2.xml"
Find all faces that appear in realtime viedo stream by fast performance technical.
- Reduce the size of frame by gaussian pyramid down to 320x240 and keep resize ratio.
- Detect the faces in some frame and keep face output to next frame.
- Interpolate the faces result by increase size to original frame.
- Visual Studio 2017
- Nuget Emgu.CV 3.4.3.3016 and dependency ZedGraph 5.1.7
The core of Engine class can be set the camera usb port in index (0 base index have the default value).
int cameraUSBPort = 0;
var engine = new Engine(cameraUSBPort);
To run the engine use the Run() method with set the FaceDetection class object. The FaceDetection class must have to set classifier xml file (Default value we use haarcascade_frontalface_alt2.xml).
engine.Run(new FaceDetection());
To exit program use Esc key.