Table of Contents

Class AFFaceDetectionEventArgs

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

Provides data for the OnFaceDetected event, containing information about detected faces in a video frame.

public class AFFaceDetectionEventArgs : EventArgs

Inheritance

Inherited Members

Remarks

This class is used to pass details about face detection results, including the bounding rectangles of faces, the raw video frame data, and its properties. It supports platform-specific rectangle and pixel format types. The VisioForge.Core.Types.Events.AFFaceDetectionEventArgs.UpdateData property allows the event handler to signal if the frame data has been modified and needs to be saved or re-rendered. FaceRectangles array contains bounding boxes for all detected faces in the current frame. Buffer provides direct access to raw video frame data for custom processing or rendering. BufferLen indicates buffer size in bytes, essential for safe memory operations. Width and Height define frame dimensions for coordinate mapping and rendering. PixelFormat identifies color space (RGB, RGBA, YUV, etc.) for proper data interpretation. Platform-specific types (System.Drawing on Windows, custom types on other platforms) ensure optimal integration. Applications can overlay visual feedback (rectangles, labels) or extract face regions for recognition processing. Face detection typically uses Cascade classifiers, HOG+SVM, or deep learning models (MTCNN, RetinaFace). Set UpdateData to true if you modify the buffer to ensure changes are propagated to output or display. Multiple faces generate multiple rectangles in the FaceRectangles array. Events are raised on processing threads, requiring thread-safe handling for UI updates.

Constructors

AFFaceDetectionEventArgs(Rect[], nint, int, int, int, PixelFormatX, TimeSpan, TimeSpan, ref bool)

Initializes a new instance of the VisioForge.Core.Types.Events.AFFaceDetectionEventArgs class.

public AFFaceDetectionEventArgs(Rect[] faceRectangles, nint buffer, int bufferLen, int width, int height, PixelFormatX pixelFormat, TimeSpan startTime, TimeSpan stopTime, ref bool updateData)

Parameters

faceRectangles Rect[]

An array of bounding rectangles for the detected faces.

buffer nint

A pointer to the raw video frame data.

bufferLen int

The length of the raw video frame data buffer in bytes.

width int

The width of the video frame.

height int

The height of the video frame.

pixelFormat PixelFormatX

The pixel format of the video frame.

startTime TimeSpan

The start time of the video frame.

stopTime TimeSpan

The stop time of the video frame.

updateData bool

A reference to a boolean flag indicating if the data has been updated.

Properties

Buffer

Gets a pointer to the raw video frame data buffer where faces were detected.

public nint Buffer { get; }

Property Value

nint

BufferLen

Gets the length of the raw video frame data buffer in bytes.

public int BufferLen { get; }

Property Value

int

FaceRectangles

Gets an array of VisioForge.Core.Types.Rect objects, each representing the bounding box of a detected face. This property is available on non-Windows platforms.

public Rect[] FaceRectangles { get; }

Property Value

Rect[]

Height

Gets the height of the video frame in pixels.

public int Height { get; }

Property Value

int

PixelFormat

Gets the pixel format of the video frame as a VisioForge.Core.Types.X.PixelFormatX. This property is available on non-Windows platforms.

public PixelFormatX PixelFormat { get; }

Property Value

PixelFormatX

StartTime

Gets the start time of the video frame within the media stream.

public TimeSpan StartTime { get; }

Property Value

TimeSpan

StopTime

Gets the stop time of the video frame within the media stream.

public TimeSpan StopTime { get; }

Property Value

TimeSpan

UpdateData

Gets or sets a value indicating whether the video frame data has been updated by the event handler. Set this to true if you modify the VisioForge.Core.Types.Events.AFFaceDetectionEventArgs.Buffer data and want the changes to be reflected (e.g., saved to a file or rendered).

public bool UpdateData { get; set; }

Property Value

bool

Width

Gets the width of the video frame in pixels.

public int Width { get; }

Property Value

int