Pedestrian Detection in CSharp

From EMGU
Jump to navigation Jump to search

System Requirement

Component Requirement Detail
Emgu CV Version 2.0.1.0 Available from SVN only
Operation System Cross Platform


Source code

using (HOGDescriptor hog = new HOGDescriptor())
{
   float[] desc = HOGDescriptor.GetDefaultPeopleDetector();
   hog.SetSVMDetector(desc);
   Image<Bgr, Byte> image = new Image<Bgr, byte>("pedestrian.png");

   Rectangle[] rects = hog.DetectMultiScale(image);

   foreach (Rectangle rect in rects)
   {
      image.Draw(rect, new Bgr(Color.Red), 1);
   }
   ImageViewer.Show(image);
}

Result

Pedestrian Detection
Pedestrian Detection