Luxand FaceCrop SDK – Face Cropping Functions

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