Table of Contents

Class CVPedestrianDetectedEventArgs

Namespace
VisioForge.Core.Types.Events
Assembly
VisioForge.Core.dll

Provides data for events that indicate the detection of pedestrians in a video frame. This class encapsulates an array of VisioForge.Core.Types.Rect objects, each representing the bounding box of a detected pedestrian, along with the time elapsed during the detection process.

public class CVPedestrianDetectedEventArgs : EventArgs

Inheritance

Inherited Members

Examples

// Assume an event handler is registered for a pedestrian detection event.
public void OnPedestrianDetected(object sender, CVPedestrianDetectedEventArgs e)
{
    Console.WriteLine($"Detected {e.Items.Length} pedestrians in {e.ElapsedTime.TotalMilliseconds} ms.");

    foreach (var rect in e.Items)
    {
        Console.WriteLine($"  Pedestrian at: Left={rect.Left}, Top={rect.Top}, Right={rect.Right}, Bottom={rect.Bottom}");
        // Further process pedestrian data, e.g., track movements, count entries/exits.
    }
}

Remarks

This event argument is typically used in computer vision applications for surveillance, crowd analysis, or autonomous systems. Pedestrian detection uses trained machine learning models (HOG+SVM, R-CNN, YOLO, or similar) to identify human figures in video frames. Each Rect in the Items array defines the bounding box coordinates of a detected pedestrian. The ElapsedTime property indicates processing duration, useful for performance monitoring and optimization. Detection works best with upright pedestrians; accuracy decreases with unusual poses, occlusion, or distance from camera. Applications include people counting, crowd density analysis, security monitoring, traffic safety, and retail analytics. Multiple pedestrians in the same frame generate multiple bounding boxes in the Items array. Consider implementing tracking algorithms to maintain pedestrian identity across frames and reduce redundant processing. False positives can be reduced by applying size filters, confidence thresholds, or temporal consistency checks. Lighting conditions, camera angle, resolution, and pedestrian clothing affect detection reliability. Privacy considerations apply when processing pedestrian data - ensure compliance with applicable regulations. Events are raised on background processing threads, requiring thread-safe handling and UI marshaling.

Constructors

CVPedestrianDetectedEventArgs(Rect[], TimeSpan)

Initializes a new instance of the VisioForge.Core.Types.Events.CVPedestrianDetectedEventArgs class with detected items and elapsed time.

public CVPedestrianDetectedEventArgs(Rect[] items, TimeSpan elapsedTime)

Parameters

items Rect[]

An array of VisioForge.Core.Types.Rect objects representing the detected pedestrians.

elapsedTime TimeSpan

The time taken for detection.

CVPedestrianDetectedEventArgs(Rect[])

Initializes a new instance of the VisioForge.Core.Types.Events.CVPedestrianDetectedEventArgs class with detected items. The VisioForge.Core.Types.Events.CVPedestrianDetectedEventArgs.ElapsedTime will be initialized to Zero.

public CVPedestrianDetectedEventArgs(Rect[] items)

Parameters

items Rect[]

An array of VisioForge.Core.Types.Rect objects representing the detected pedestrians.

Properties

ElapsedTime

Gets the time elapsed to perform the pedestrian detection operation for the current frame.

public TimeSpan ElapsedTime { get; }

Property Value

TimeSpan

Items

Gets an array of VisioForge.Core.Types.Rect objects, each representing the bounding box of a detected pedestrian.

public Rect[] Items { get; }

Property Value

Rect[]