title: How to get stats from ConnectedComponentsWithStats in EmguCv
body: <p>I'm working on pedestrians detection algorithm and got stuck on using <code>ConnectedComponentsWithStats()</code> method. I can't get to the values of stats. Here is what I wrote so far:</p>
  
  <pre><code>var labels = new Mat();
  var stats = new Mat();
  var centroids = new Mat();
  var nLabels = CvInvoke.ConnectedComponentsWithStats(greyImage, labels, stats, centroids);
  
  var centroidPoints = new MCvPoint2D64f[nLabels];
  centroids.CopyTo(centroidPoints);
  
  foreach (MCvPoint2D64f point in centroidPoints)
  {
     var x = point.X;
     var y = point.Y;
  }
  </code></pre>