Difference between revisions of "Pedestrian Detection in CSharp"

From Emgu CV: OpenCV in .NET (C#, VB, C++ and more)
Jump to: navigation, search
m (Source code)
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ozoqemuvo.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 +
----
 +
=[http://ozoqemuvo.co.cc CLICK HERE]=
 +
----
 +
</div>
 
== System Requirement ==
 
== System Requirement ==
 
{| style="text-align:center" border="1px" cellpadding="10" cellspacing="0"
 
{| style="text-align:center" border="1px" cellpadding="10" cellspacing="0"
Line 10: Line 18:
  
 
== Source code ==
 
== Source code ==
<source lang="csharp">
+
&lt;source lang="csharp">
 
using (HOGDescriptor hog = new HOGDescriptor())
 
using (HOGDescriptor hog = new HOGDescriptor())
 
{
 
{
 
   float[] desc = HOGDescriptor.GetDefaultPeopleDetector();
 
   float[] desc = HOGDescriptor.GetDefaultPeopleDetector();
 
   hog.SetSVMDetector(desc);
 
   hog.SetSVMDetector(desc);
   Image<Bgr, Byte> image = new Image<Bgr, byte>("pedestrian.png");
+
   Image&lt;Bgr, Byte> image = new Image&lt;Bgr, byte>("pedestrian.png");
  
 
   Rectangle[] rects = hog.DetectMultiScale(image);
 
   Rectangle[] rects = hog.DetectMultiScale(image);
Line 25: Line 33:
 
   ImageViewer.Show(image);
 
   ImageViewer.Show(image);
 
}
 
}
</source>
+
&lt;/source>
  
 
== Result ==
 
== Result ==
 
[[image:PedestrianDetectionExample1.png |center|Pedestrian Detection]]
 
[[image:PedestrianDetectionExample1.png |center|Pedestrian Detection]]

Revision as of 03:31, 24 November 2010



UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY


CLICK HERE


System Requirement

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


Source code

<source lang="csharp"> 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);

} </source>

Result

Pedestrian Detection