#ifndef CWFaceRecognition_H #define CWFaceRecognition_H #include "CWFaceConfig.h" #if defined (__cplusplus) extern "C" { #endif /** * 功能:创建识别句柄 * 输入: * pConfigurePath - 模型配置文件 * pLicence - 授权码(仅用于安卓平台,PC端传NULL即可) * emRecogPattern - 创建的句柄类型 * 输出: * errCode - 错误码:成功返回CW_SDKLIT_OK,失败返回其他 * 返回值: * void* - 识别句柄:成功返回句柄,失败返回0 */ CW_FACE_API void* cwCreateRecogHandle(cw_errcode_t* errCode, const char* pConfigurePath, const char* pLicence, cw_recog_pattern_t emRecogPattern); /** * 功能:释放识别句柄 * 输入: * pRecogHandle - 识别句柄 * 输出: * 无 * 返回值: * 无 */ CW_FACE_API void cwReleaseRecogHandle(void* pRecogHandle); /** * 功能:获取特征长度 * 输入: * pRecogHandle - 识别句柄 * 输出: * 无 * 返回值: * int - 特征长度 */ CW_FACE_API int cwGetFeatureLength(void* pRecogHandle); /** * 功能:提取人脸特征,一次只提取一个特征 * 输入: * pRecogHandle - 识别句柄 * alignedFace - 对齐的人脸数据指针 * 输出: * pFeatueData - 返回的特征数据,需要预先分配足够空间 * 返回值: * cw_errcode_t - 成功返回CW_SDKLIT_OK,失败返回其他 */ CW_FACE_API cw_errcode_t cwGetFaceFeature(void* pRecogHandle, cw_aligned_face_t* alignedFace, void* pFeatueData); /** * 功能:计算1个特征与N个特征的相似度,返回的相似度pScores的个数为N个 * 输入: * pRecogHandle - 识别句柄 * pFea1 - 特征1,只能是一个特征 * pFea2 - 特征2,可以是N个特征 * iFea2Num - 特征2的个数 * 输出: * pScores - 返回的相似度分数数组,长度为iFea2Num,需要预先分配空间 * 返回值: * cw_errcode_t - 成功返回CW_SDKLIT_OK,失败返回其他 */ CW_FACE_API cw_errcode_t cwComputeMatchScore(void* pRecogHandle, const void* pFea1, const void* pFea2, int iFea2Num, float* pScores); /** * 功能:比对两个图片中最大人脸特征,获取相似度 * 输入: * pDetector - 检测句柄 * pRecogHandle - 识别句柄 * pFrameImg1 - 图片1数据 * pFrameImg2 - 图片2数据 * 输出: * fScore - 比对分数 * 返回值: * cw_errcode_t - 成功返回CW_SDKLIT_OK,失败返回其他 */ CW_FACE_API cw_errcode_t cwVerifyImageData(void* pDetector, void* pRecogHandle, cw_img_t* pFrameImg1, cw_img_t* pFrameImg2, float *fScore); #if defined (__cplusplus) } #endif #endif