Luxand FaceSDK – Facial Feature Detection

FaceSDK provides the FSDK_DetectFacialFeatures function to detect facial features in an image and the FSDK_DetectEyes function to detect just eye centers in an image. First, these functions detect a frontal face in an image, and then detect its facial features or only eye centers. The FSDK_DetectFacialFeaturesInRegion and FSDK_DetectEyesInRegion functions do not perform the face detection step and detect facial features or eye centers in a region returned by FSDK_DetectFace or FSDK_DetectMultipleFaces.

The FSDK_DetectEyes function works much faster than FSDK_DetectFacialFeatures and is recommended for real-time applications.

The facial features are stored in the FSDK_Features data structure. FSDK_Features is an array data type containing FSDK_FACIAL_FEATURE_COUNT points. The list of facial features recognized by FaceSDK is available in the Detected Facial Features chapter.

Eye centers are saved to FSDK_Features[0] and FSDK_Features[1]. The FSDK_DetectEyes and FSDK_DetectEyesInRegion functions do not change other elements of the FSDK_Features array.

C++ Declaration:

typedef struct { int x,y; } TPoint;
typedef TPoint FSDK_Features [FSDK_FACIAL_FEATURE_COUNT];

 C# Declaration:

public struct TPoint {
    public int x, y;
}

Delphi Declaration:

TPoint = record
    x, y: integer;
end;
FSDK_Features = array[0..FSDK_FACIAL_FEATURE_COUNT - 1] of TPoint;
PFSDK_Features = ^FSDK_Features;

VB Declaration:

Type TPoint
    x As Long
    y As Long
End Type

FSDK_DetectFacialFeatures Function

Detects a frontal face in an image and detects its facial features.

C++ Syntax:

int FSDK_DetectFacialFeatures(HImage Image, FSDK_Features* FacialFeatures);

Delphi Syntax:

function FSDK_DetectFacialFeatures(Image: HImage; FacialFeatures: PFSDK_Features): integer;

C# Syntax:

int FSDK.DetectFacialFeatures(UInt32 Image, FSDK.TPoint[] FacialFeatures);

VB Syntax:

Function FSDKVB_DetectFacialFeatures(ByVal Image As Long, ByRef FacialFeatures As TPoint) As Long

Parameters:

Image– handle of the image facial features should be detected in.

FacialFeatures– pointer to the FSDK_Features array for receiving the detected facial features.

Return Value:

Returns FSDKE_OK if successful.

Example

int img1;
FSDK_Features Features;

FSDK_Initialize("");
FSDK_LoadImageFromFile(&img1, "test.jpg");
FSDK_DetectFacialFeatures(img1, Features);

printf("Left eye location: (%d, %d)\n", Features[FSDKP_LEFT_EYE].x, Features[FSDKP_LEFT_EYE].y);
printf("Right eye location: (%d, %d)\n", Features[FSDKP_RIGHT_EYE].y, Features[FSDKP_RIGHT_EYE].y);

FSDK_DetectFacialFeaturesInRegion Function

Detects facial features in an image region returned by FSDK_DetectFace or FSDK_DetectMultipleFaces. This function can be useful if an approximate face size is known, or to detect facial features of a specific face returned by FSDK_DetectMultipleFaces.

C++ Syntax:

int FSDK_DetectFacialFeaturesInRegion(HImage Image, TFacePosition* FacePosition, FSDK_Features* FacialFeatures);

Delphi Syntax:

function FSDK_DetectFacialFeaturesInRegion(Image: HImage; FacePosition: PFacePosition; FacialFeatures: PFSDK_Features): integer;

C# Syntax:

int FSDK.DetectFacialFeaturesInRegion(UInt32 Image, ref FSDK.TFacePosition FacePosition, FSDK.TPoint[] FacialFeatures);

VB Syntax:

Function FSDKVB_DetectFacialFeaturesInRegion(ByVal Image As Long, ByRef FacePosition As TFacePosition, ByRef FacialFeatures As TPoint) As Long

Parameters:

Image– handle of the image facial features should be detected in.

FacePosition– pointer to the face position structure.

FacialFeatures– pointer to the FSDK_Features array for receiving the detected facial features.

Return Value:

Returns FSDKE_OK if successful.

Example

int i, DetectedCount, img1;
FSDK_Features Features;
TFacePosition FaceArray[50];

FSDK_Initialize("");
FSDK_LoadImageFromFile(&img1, "test.jpg");

FSDK_DetectMultipleFaces(img1, &DetectedCount , FaceArray, sizeof(FaceArray));

for (i = 0; i < DetectedCount; i++) {
    FSDK_DetectFacialFeaturesInRegion(img1, FaceArray[i], Features);
    printf("Left eye location: (%d, %d)\n", Features[FSDKP_LEFT_EYE].x, Features[FSDKP_LEFT_EYE].y);
    printf("Right eye location: (%d, %d)\n", Features[FSDKP_RIGHT_EYE].x, Features[FSDKP_RIGHT_EYE].y);
}

FSDK_DetectEyes Function

Detects a frontal face in an image and detects its eye centers.

C++ Syntax:

int FSDK_DetectEyes(HImage Image, FSDK_Features* FacialFeatures);

Delphi Syntax:

function FSDK_DetectEyes(Image: HImage; FacialFeatures: PFSDK_Features): integer;

C# Syntax:

int FSDK.DetectEyes(UInt32 Image, FSDK.TPoint[] FacialFeatures);

VB Syntax:

Function FSDKVB_DetectEyes (ByVal Image As Long, ByRef FacialFeatures As TPoint) As Long

Parameters:

Image– handle of the image eye centers should be detected in.

FacialFeatures– pointer to the FSDK_Features array for receiving the detected eye centers.

Return Value:

Returns FSDKE_OK if successful.

FSDK_DetectEyesInRegion Function

Detects eye centers in an image region returned by FSDK_DetectFace or FSDK_DetectMultipleFaces.

C++ Syntax:

int FSDK_DetectEyesInRegion(HImage Image, TFacePosition* FacePosition, FSDK_Features* FacialFeatures);

Delphi Syntax:

function FSDK_DetectEyesInRegion(Image: HImage; FacePosition: PFacePosition; FacialFeatures: PFSDK_Features): integer;

C# Syntax:

int FSDK.DetectEyesInRegion(UInt32 Image, ref FSDK.TFacePosition FacePosition, FSDK.TPoint[] FacialFeatures);

VB Syntax:

Function FSDKVB_DetectEyesInRegion(ByVal Image As Long, ByRef FacePosition As TFacePosition, ByRef FacialFeatures As TPoint) As Long

Parameters:

Image– handle of the image eye centers should be detected in.

FacePosition– pointer to the face position structure.

FacialFeatures– pointer to the FSDK_Features array for receiving the detected eye centers.

Return Value:

Returns FSDKE_OK if successful.

 

Next chapterFace Matching

Contents

Top Downloads

Glamourizer
Turn ordinary photos into glamour portraits, hundreds at a time
Blink!
Log into your PC by simply looking at it
Echo FX
Enhance your videos with stunning video FX for Adobe® After Effects
BabyMaker
Don't wait nine months to see your baby! All you need is two pictures

Latest News

22.07.2010 Blink! 2.1 Released!
Blink! 2.1 Released! Securely login to Windows Vista/7, for both the 32- and 64-bit editions!

25.03.2010 FaceSDK 3 Released!
FaceSDK 3 goes gold! The updated release of FaceSDK vastly improves face recognition speed and accuracy over the previous version.

10.02.2010 Blink! 2.0 Automates Windows Login and Boosts Recognition Rate
Luxand updates Blink!, an innovative face-based biometric login system, with better and faster face recognition algorithms.

Solutions  |  Products  |  Download  |  Support  |  Development  |  Press  |  About Luxand
© 2005-2010 Luxand, Inc.