How to get the number of Results that returns through Find method in EMGU CV Pedestrian Detection C#
<p>I'm implementing a Pedestrian detection system using emgu cv library. The find method Returns number of results that detecting through the method. </p>

<pre><code>public static Rectangle[] findPedestrian(Image&lt;Bgr, Byte&gt; image)
{
    Stopwatch stopwatch;
    Rectangle[] regions;
    if (CudaInvoke.HasCuda)
    {
        using (CudaHOG des = new CudaHOG(new Size(64, 128), new Size(16, 16), new Size(8, 8), new Size(8, 8)))
        {
            des.SetSVMDetector(des.GetDefaultPeopleDetector());
            stopwatch = Stopwatch.StartNew();
            using (GpuMat cudaBgr = new GpuMat(image))
            using (GpuMat cudaBgra = new GpuMat())
            using (VectorOfRect vr = new VectorOfRect())
            {
                CudaInvoke.CvtColor(cudaBgr, cudaBgra, ColorConversion.Bgr2Bgra);
                des.DetectMultiScale(cudaBgra, vr);
                regions = vr.ToArray();
            }
        }
    }
    else
    {
        using (HOGDescriptor des = new HOGDescriptor())
        {
            des.SetSVMDetector(HOGDescriptor.GetDefaultPeopleDetector());
            stopwatch = Stopwatch.StartNew();
            MCvObjectDetection[] results = des.DetectMultiScale(image);
            regions = new Rectangle[results.Length];
            for (int i = 0; i &lt; results.Length; i++)
                regions[i] = results[i].Rect;
            stopwatch.Stop();
        }
    }
    //processingTime = stopwatch.ElapsedMilliseconds;
    return regions;
}
</code></pre>

<p>And here it's generating the rectangles according to the results that sending through the process. What i want is to count the number of results that returning through the method. I thought to get it from the number of iterations of this foreach loop. </p>

<pre><code>private Image&lt;Bgr, Byte&gt; imagingPedestrian(Image&lt;Bgr, Byte&gt; image)
{
    System.Drawing.Rectangle[] results = pedestrianDetection.findPedestrian(image);
    foreach (Rectangle rect in results)
    {
        CvInvoke.Rectangle(image, rect, new Bgr(Color.Red).MCvScalar);
    }
    return image;
}
</code></pre>

<p>Can i know a way to get that result. Thanks in advance.</p>