Luxand FaceCrop SDK – Face Cropping Functions
You can use the fcFaceCrop to detect a frontal face in an image and crop it. Also you can use the fcGetFacePosition to just get the coordinates of the detected face in an image.

fcFaceCrop Function

Crops the detected face from an image file and saves it to another image file.

C++ Syntax:

int fcFaceCrop(char* inFileName, char* outFileName, int width, int height);

Delphi Syntax:

function fcFaceCrop(inFileName: PChar; outFileName: PChar; width: integer; height: integer): integer;

C# Syntax:

int fc.FaceCrop(string inFileName, string outFileName, int width, int height);

PHP Syntax:

int fcFaceCrop(string $inFileName, string $outFileName, int $width, int $height, int $ContextID);

VB Syntax:

Function fcVBFaceCrop(ByVal inFileName As String, ByVal outFileName As String, ByVal width As Long, ByVal height As Long) As Long

Parameters:

inFileName – path to the image file to crop the face from.

outFileName – path to the image file to save face to.

width – width of the cropped face image.

height – height of the cropped face image.

Return Value:

Returns fcErrorOk if successful.

fcFaceCrop_FileToHBITMAP Function

Crops the detected face from an image file and saves it to the HBITMAP handle. The function is available only on the Windows platform.

C++ Syntax:

int fcFaceCrop_FileToHBITMAP(char* inFileName, HBITMAP* outHBITMAP, int width, int height);

Delphi Syntax:

function fcFaceCrop_FileToHBITMAP(inFileName: PChar; outHBITMAP: PHBITMAP; width: integer; height: integer): integer;

C# Syntax:

int fc.FaceCrop_FileToHBITMAP(string inFileName, ref IntPtr outHBITMAP, int width, int height);

VB Syntax:

Function fcVBFaceCrop_FileToHBITMAP(ByVal inFileName As String, ByRef outHBITMAP As Long, ByVal width As Long, ByVal height As Long) As Long

Parameters:

inFileName – path to the image file to crop the face from.

outHBITMAP – a handle of the image to save cropped face to.

width – width of the cropped face image.

height – height of the cropped face image.

Return Value:

Returns fcErrorOk if successful.

fcFaceCrop_HBITMAPToHBITMAP Function

Crops the detected face from an HBITMAP and saves it to the HBITMAP. The function is available only on the Windows platform.

C++ Syntax:

int fcFaceCrop_HBITMAPToHBITMAP(HBITMAP* inHBITMAP, HBITMAP* outHBITMAP, int width, int height);

Delphi Syntax:

function fcFaceCrop_HBITMAPToHBITMAP(inHBITMAP: PHBITMAP; outHBITMAP: PHBITMAP; width: integer; height: integer): intege class="c-code"r;

C# Syntax:

int fc.FaceCrop_HBITMAPToHBITMAP(ref IntPtr inHBITMAP, ref IntPtr outHBITMAP, int width, int height);

VB Syntax:

Function fcVBFaceCrop_HBITMAPToHBITMAP(ByRef inHBITMAP As Long, ByRef outHBITMAP As Long, ByVal width As Long, ByVal height As Long) As Long

Parameters:

inHBITMAP – a handle of the image to crop the face from.

outHBITMAP – a handle of the image to save cropped face to.

width – width of the cropped face image.

height – height of the cropped face image.

Return Value:

Returns fcErrorOk if successful.

fcGetFacePosition Function

Detects a frontal face in an image and stores information about the coordinates of the face.

C++ Syntax:

int fcGetFacePosition(char* inFileName, int width, int height, int* x1, int* y1, int* x2, int* y2);

Delphi Syntax:

function fcGetFacePosition(inFileName: PChar; width: integer; height: integer; x1: PInteger; y1: PInteger; x2: PInteger; y2: PInteger): integer;

C# Syntax:

int fc.GetFacePosition(string inFileName, int width, int height, ref int x1, ref int y1, ref int x2, ref int y2);

PHP Syntax:

int fcGetFacePosition(string $inFileName, int $width, int $height, int $x1, int $y1, int $x2, int $y2, int $ContextID);

VB Syntax:

Function fcVBGetFacePosition(ByVal inFileName As String, ByVal width As Long, ByVal height As Long, ByRef x1 As Long, ByRef y1 As Long, ByRef x2 As Long, ByRef y2 As Long) As Long

Parameters:

inFileName – path to the image file to detect the face coordinates on.

width – width of the detected face.

height – height of the detected face.

x1, y1 – coordinates of the left-top corner of the detected face.

x2, y2 – coordinates of the right-bottom corner of the detected face.

Return Value:

Returns fcErrorOk if successful.

fcGetFacePosition_HBITMAP Function

Detects a frontal face in a HBITMAP handle and stores information about the coordinates of the containing face rectangle. The function is available only on the Windows platform.

C++ Syntax:

int fcGetFacePosition_HBITMAP(HBITMAP* inHBITMAP, int width, int height, int* x1, int* y1, int* x2, int* y2);

Delphi Syntax:

function fcGetFacePosition_HBITMAP(inHBITMAP: PHBITMAP; width: integer; height: integer; x1: PInteger; y1: PInteger; x2: PInteger; y2: PInteger): integer;

C# Syntax:

int fc.GetFacePosition_HBITMAP(ref IntPtr inHBITMAP, int width, int height, ref int x1, ref int y1, ref int x2, ref int y2);

VB Syntax:

Function fcVBGetFacePosition_HBITMAP(ByRef inHBITMAP As Long, ByVal width As Long, ByVal height As Long, ByRef x1 As Long, ByRef y1 As Long, ByRef x2 As Long, ByRef y2 As Long) As Long

Parameters:

inHBITMAP – a handle of the image to detect the face coordinates on.

width – width of the detected face.

height – height of the detected face.

x1, y1 – coordinates of the left-top corner of the detected face.

x2, y2 – coordinates of the right-bottom corner of the detected face.

Return Value:

Returns fcErrorOk if successful.

 

Next chapterFace Detection and Cropping Parameters

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.