当前位置:编程学习 > VC++ >>

VC++开发人脸识别

 


FaceSDK可以帮助Visual C++, C#, VB, Jav以及Borland Delphi开发者构建基于Web, Windows, Linux和Macintosh的具有人脸识别功能的应用程序。


头文件如下,可以轻易构建一个人脸识别的应用程序。

 

 

[cpp]
#ifndef _LUXANDFACESDK_  
#define _LUXANDFACESDK_  
 
#if defined( _WIN32 ) || defined ( _WIN64 )  
    #define _FSDKIMPORT_ __declspec(dllimport) __cdecl  
    #include <windows.h>  
#else  
    #define _FSDKIMPORT_  
    #define __cdecl  
#endif  
 
#ifdef __cplusplus  
extern "C" { 
#endif  
 
// Error codes  
 
#define FSDKE_OK                0  
#define FSDKE_FAILED            -1  
#define FSDKE_NOT_ACTIVATED     -2  
#define FSDKE_OUT_OF_MEMORY     -3  
#define FSDKE_INVALID_ARGUMENT  -4  
#define FSDKE_IO_ERROR          -5  
#define FSDKE_IMAGE_TOO_SMALL  -6  
#define FSDKE_FACE_NOT_FOUND  -7  
#define FSDKE_INSUFFICIENT_BUFFER_SIZE  -8  
#define FSDKE_UNSUPPORTED_IMAGE_EXTENSION   -9  
#define FSDKE_CANNOT_OPEN_FILE -10  
#define FSDKE_CANNOT_CREATE_FILE -11  
#define FSDKE_BAD_FILE_FORMAT -12  
#define FSDKE_FILE_NOT_FOUND -13  
#define FSDKE_CONNECTION_CLOSED     -14  
#define FSDKE_CONNECTION_FAILED     -15  
#define FSDKE_IP_INIT_FAILED    -16  
#define FSDKE_NEED_SERVER_ACTIVATION -17  
 
// Facial feature count  
 
#define FSDK_FACIAL_FEATURE_COUNT   66  
 
// Types  
 
typedef enum { 
    FSDK_MJPEG 
} FSDK_VIDEOCOMPRESSIONTYPE; 
 
typedef enum { 
    FSDK_IMAGE_GRAYSCALE_8BIT, 
    FSDK_IMAGE_COLOR_24BIT, 
    FSDK_IMAGE_COLOR_32BIT   
} FSDK_IMAGEMODE;  
 
typedef unsigned int HImage; 
     
typedef struct {  
    int x, y;  
} TPoint; 
 
typedef TPoint TPointArray [FSDK_FACIAL_FEATURE_COUNT]; 
 
typedef TPoint FSDK_Features [FSDK_FACIAL_FEATURE_COUNT]; 
 
typedef float FSDK_ConfidenceLevels [FSDK_FACIAL_FEATURE_COUNT]; 
 
typedef struct { 
    int xc, yc, w; 
    double angle; 
} TFacePosition; 
 
typedef struct {  
    char ftemplate[16384];   
} FSDK_FaceTemplate;  
 
 
 
typedef void (__cdecl *FSDK_ProgressCallbackFunction)(int); 
 
// Facial features  
 
#define FSDKP_LEFT_EYE  0  
#define FSDKP_RIGHT_EYE 1  
#define FSDKP_LEFT_EYE_INNER_CORNER 24  
#define FSDKP_LEFT_EYE_OUTER_CORNER 23  
#define FSDKP_LEFT_EYE_LOWER_LINE1  38  
#define FSDKP_LEFT_EYE_LOWER_LINE2  27  
#define FSDKP_LEFT_EYE_LOWER_LINE3  37  
#define FSDKP_LEFT_EYE_UPPER_LINE1  35  
#define FSDKP_LEFT_EYE_UPPER_LINE2  28  
#define FSDKP_LEFT_EYE_UPPER_LINE3  36  
#define FSDKP_LEFT_EYE_LEFT_IRIS_CORNER 29  
#define FSDKP_LEFT_EYE_RIGHT_IRIS_CORNER    30  
#define FSDKP_RIGHT_EYE_INNER_CORNER    25  
#define FSDKP_RIGHT_EYE_OUTER_CORNER    26  
#define FSDKP_RIGHT_EYE_LOWER_LINE1 41  
#define FSDKP_RIGHT_EYE_LOWER_LINE2 31  
#define FSDKP_RIGHT_EYE_LOWER_LINE3 42  
#define FSDKP_RIGHT_EYE_UPPER_LINE1 40  
#define FSDKP_RIGHT_EYE_UPPER_LINE2 32  
#define FSDKP_RIGHT_EYE_UPPER_LINE3 39  
#define FSDKP_RIGHT_EYE_LEFT_IRIS_CORNER    33  
#define FSDKP_RIGHT_EYE_RIGHT_IRIS_CORNER   34  
#define FSDKP_LEFT_EYEBROW_INNER_CORNER 13  
#define FSDKP_LEFT_EYEBROW_MIDDLE   16  
#define FSDKP_LEFT_EYEBROW_MIDDLE_LEFT  18  
#define FSDKP_LEFT_EYEBROW_MIDDLE_RIGHT 19  
#define FSDKP_LEFT_EYEBROW_OUTER_CORNER 12  
#define FSDKP_RIGHT_EYEBROW_INNER_CORNER    14  
#define FSDKP_RIGHT_EYEBROW_MIDDLE  17  
#define FSDKP_RIGHT_EYEBROW_MIDDLE_LEFT 20  
#define FSDKP_RIGHT_EYEBROW_MIDDLE_RIGHT    21  
#define FSDKP_RIGHT_EYEBROW_OUTER_CORNER    15  
#define FSDKP_NOSE_TIP  2  
#define FSDKP_NOSE_BOTTOM   49  
#define FSDKP_NOSE_BRIDGE   22  
#define FSDKP_NOSE_LEFT_WING    43  
#define FSDKP_NOSE_LEFT_WING_OUTER  45  
#define FSDKP_NOSE_LEFT_WING_LOWER  47  
#define FSDKP_NOSE_RIGHT_WING   44  
#define FSDKP_NOSE_RIGHT_WING_OUTER 46  
#define FSDKP_NOSE_RIGHT_WING_LOWER 48  
#define FSDKP_MOUTH_RIGHT_CORNER    3  
#define FSDKP_MOUTH_LEFT_CORNER 4  
#define FSDKP_MOUTH_TOP 54  
#define FSDKP_MOUTH_TOP_INNER   61  
#define FSDKP_MOUTH_BOTTOM  55  
#define FSDKP_MOUTH_BOTTOM_INNER    64  
#define FSDKP_MOUTH_LEFT_TOP    56  
#define FSDKP_MOUTH_LEFT_TOP_INNER  60  
#define FSDKP_MOUTH_RIGHT_TOP   57  
#define FSDKP_MOUTH_RIGHT_TOP_INNER 62  
#define FSDKP_MOUTH_LEFT_BOTTOM 58  
#define FSDKP_MOUTH_LEFT_BOTTOM_INNER   63  
#define FSDKP_MOUTH_RIGHT_BOTTOM    59  
#define FSDKP_MOUTH_RIGHT_BOTTOM_INNER  65  
#define FSDKP_NASOLABIAL_FOLD_LEFT_UPPER    50  
#define FSDKP_NASOLABIAL_FOLD_LEFT_LOWER    52  
#define FSDKP_NASOLABIAL_FOLD_RIGHT_UPPER   51  
#define FSDKP_NASOLABIAL_FOLD_RIGHT_LOWER   53  
#define FSDKP_CHIN_BOTTOM   11  
#define FSDKP_CHIN_LEFT 9  
#define FSDKP_CHIN_RIGHT    10  
#define FSDKP_FACE_CONTOUR1 7  
#define FSDKP_FACE_CONTOUR2 5  
#define FSDKP_FACE_CONTOUR12    6  
#define FSDKP_FACE_CONTOUR13    8     
 
 
// Initialization functions  
int _FSDKIMPORT_ FSDK_ActivateLibrary(char * LicenseKey); 补充:软件开发 , C++ ,

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,