Table of Contents

Class FaceRecognitionCore

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

Provides core functionality for face recognition, including adding known persons and detecting faces.

public class FaceRecognitionCore

Inheritance

Inherited Members

Constructors

FaceRecognitionCore(string)

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

public FaceRecognitionCore(string modelDir)

Parameters

modelDir string

The directory containing the face recognition models.

Exceptions

Exception

Thrown if the application is not running in x64 mode.

Properties

KnownPersons

Gets the list of known persons for recognition.

public List<Person> KnownPersons { get; }

Property Value

List<Person>

Methods

AddKnownPerson(string)

Adds a known person from an image file.

public bool AddKnownPerson(string imageFile)

Parameters

imageFile string

The path to the image file.

Returns

bool

true if the person was added successfully; otherwise, false.

AddKnownPersonAsync(string)

Asynchronously adds a known person from an image file.

public Task<bool> AddKnownPersonAsync(string imageFile)

Parameters

imageFile string

The path to the image file.

Returns

Task<bool>

A task that represents the asynchronous operation. The task result contains true if successful; otherwise, false.

AddKnownPersons(string[])

Adds multiple known persons from image files.

public void AddKnownPersons(string[] imageFiles)

Parameters

imageFiles string[]

The array of image file paths.

AddKnownPersonsAsync(string[])

Asynchronously adds multiple known persons from image files.

public Task AddKnownPersonsAsync(string[] imageFiles)

Parameters

imageFiles string[]

The array of image file paths.

Returns

Task

A task that represents the asynchronous operation.

Clear()

Clears the list of known persons.

public void Clear()

Detect(Person)

Detects if the specified person matches any known person.

public Person Detect(Person person)

Parameters

person Person

The person to detect.

Returns

Person

The matched VisioForge.Core.FaceAI.Person if found; otherwise, null.

Detect(VideoFrameX)

Detects persons in the specified video frame.

public Person[] Detect(VideoFrameX frame)

Parameters

frame VideoFrameX

The video frame.

Returns

Person[]

An array of detected VisioForge.Core.FaceAI.Person objects.

DetectAsync(Person)

Asynchronously detects if the specified person matches any known person.

public Task<Person> DetectAsync(Person person)

Parameters

person Person

The person to detect.

Returns

Task<Person>

A task that represents the asynchronous operation. The task result contains the matched VisioForge.Core.FaceAI.Person if found; otherwise, null.

DetectAsync(VideoFrameX)

Asynchronously detects persons in the specified video frame.

public Task<Person[]> DetectAsync(VideoFrameX person)

Parameters

person VideoFrameX

The video frame containing the person.

Returns

Task<Person[]>

A task that represents the asynchronous operation. The task result contains an array of detected VisioForge.Core.FaceAI.Person objects.

GetFacesInfo(string, int)

Gets face information from an image file.

public List<FaceInfo> GetFacesInfo(string imageFile, int maxWidthOrHeight = 320)

Parameters

imageFile string

The path to the image file.

maxWidthOrHeight int

The maximum width or height for resizing the image. Default is 320.

Returns

List<FaceInfo>

A list of VisioForge.Core.FaceAI.FaceInfo objects containing face details.

GetFacesInfo(VideoFrameX, int)

Gets face information from a video frame.

public List<FaceInfo> GetFacesInfo(VideoFrameX frame, int maxWidthOrHeight = 320)

Parameters

frame VideoFrameX

The video frame.

maxWidthOrHeight int

The maximum width or height for resizing the image. Default is 320.

Returns

List<FaceInfo>

A list of VisioForge.Core.FaceAI.FaceInfo objects containing face details.

GetFacesInfo(Image, int)

Gets face information from a Dlib image object.

public List<FaceInfo> GetFacesInfo(Image imageSrc, int maxWidthOrHeight = 320)

Parameters

imageSrc Image

The source image.

maxWidthOrHeight int

The maximum width or height for resizing the image. Default is 320.

Returns

List<FaceInfo>

A list of VisioForge.Core.FaceAI.FaceInfo objects containing face details.