Pedestrian Detection in CSharp

From Emgu CV: OpenCV in .NET (C#, VB, C++ and more)
Revision as of 04:29, 8 August 2009 by Canming (talk | contribs) (Created page with '== System Requirement == {| style="text-align:center" border="1px" cellpadding="10" cellspacing="0" !Component || Requirement || Detail |- |Emgu CV || [[Version_History#Emgu.CV-…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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");
   Stopwatch watch = Stopwatch.StartNew();
   Rectangle[] rects = hog.DetectMultiScale(image);
   watch.Stop();
   foreach (Rectangle rect in rects)
   {
      image.Draw(rect, new Bgr(Color.Red), 1);
   }
   ImageViewer.Show(image);
}

Result

Pedestrian Detection