Table of Contents

Class Person

Namespace
VisioForge.Core.FaceAI
Assembly
VisioForge.Core.FaceAI.dll

Represents a person in the face recognition system with their associated face encodings.

[Serializable]
public class Person

Inheritance

Inherited Members

Remarks

The VisioForge.Core.FaceAI.Person class stores one or more face encodings for an individual, allowing for face recognition across multiple photos or angles. It supports loading face data from images or video frames and maintains the biometric encodings needed for face matching operations. This class requires x64 architecture.

Constructors

Person(string)

Initializes a new instance of the VisioForge.Core.FaceAI.Person class with the specified name.

public Person(string name)

Parameters

name string

The name of the person.

Exceptions

Exception

Thrown if the application is not running in x64 mode.

Person()

Initializes a new instance of the VisioForge.Core.FaceAI.Person class.

public Person()

Exceptions

Exception

Thrown if the application is not running in x64 mode.

Properties

Name

Gets or sets the name of the person.

public string Name { get; set; }

Property Value

string

Methods

AddData(FaceInfo)

Adds face information to this person's profile.

public void AddData(FaceInfo info)

Parameters

info FaceInfo

The face information to add.

Remarks

This method adds both the full VisioForge.Core.FaceAI.FaceInfo object and extracts its encoding array for use in recognition operations.

GetDataImages()

Gets the list of encoded face images for this person.

public List<double[]> GetDataImages()

Returns

List<double[]>

A list of 128-dimension face descriptor arrays used for recognition.

GetFaceInfos()

Gets the list of face information objects for this person.

public List<FaceInfo> GetFaceInfos()

Returns

List<FaceInfo>

A list of VisioForge.Core.FaceAI.FaceInfo objects containing detailed face detection data.

LoadFromImageFile(FaceRecognitionCore, string)

Loads person data from an image file by detecting and encoding all faces.

public static List<Person> LoadFromImageFile(FaceRecognitionCore core, string imageFile)

Parameters

core FaceRecognitionCore

The face recognition core engine.

imageFile string

The path to the image file to process.

Returns

List<Person>

A list of VisioForge.Core.FaceAI.Person objects, one for each detected face. Returns null if the file doesn't exist or no faces are found.

Remarks

The person's name is derived from the image filename (without extension).

If one face is detected, uses the filename as the person's name.

If multiple faces are detected, appends indices like "filename_0", "filename_1", etc.

This method is ideal for batch enrollment from photo directories.

Exceptions

Exception

Thrown when the application is not running as an x64 process.

LoadFromImageFileAsync(FaceRecognitionCore, string)

Asynchronously loads person data from an image file.

public static Task<List<Person>> LoadFromImageFileAsync(FaceRecognitionCore core, string imageFile)

Parameters

core FaceRecognitionCore

The face recognition core engine.

imageFile string

The path to the image file to process.

Returns

Task<List<Person>>

A task representing the asynchronous operation with a list of VisioForge.Core.FaceAI.Person objects.

Remarks

This method runs VisioForge.Core.FaceAI.Person.LoadFromImageFile(VisioForge.Core.FaceAI.FaceRecognitionCore,System.String) on a background thread to avoid blocking the UI.

LoadFromVideoFrame(FaceRecognitionCore, VideoFrameX, string)

Loads person data from a video frame by detecting and encoding all faces.

public static List<Person> LoadFromVideoFrame(FaceRecognitionCore core, VideoFrameX frame, string name)

Parameters

core FaceRecognitionCore

The face recognition core engine.

frame VideoFrameX

The video frame to process.

name string

The name to assign to the detected person(s).

Returns

List<Person>

A list of VisioForge.Core.FaceAI.Person objects, one for each detected face. Returns null if no faces are found.

Remarks

If one face is detected, it creates a person with the given name.

If multiple faces are detected, creates multiple persons with names like "name_0", "name_1", etc.

This method is useful for enrolling persons from live video streams or recorded video files.

Exceptions

Exception

Thrown when the application is not running as an x64 process.

ToString()

Returns a String that represents this instance.

public override string ToString()

Returns

string

A String that represents this instance.