125 lines
4.0 KiB
C++
125 lines
4.0 KiB
C++
/*************************************************************************
|
||
*
|
||
* DeepCam CONFIDENTIAL
|
||
* FILE: CenterFaceMnn.h
|
||
*
|
||
* [2019] - [2020] DeepCam, LLC and DeepCam
|
||
NOTICE:
|
||
* All information contained herein is, and remains the property of DeepCam LLC.
|
||
* The intellectual and technical concepts contained herein are proprietary to DeepCam
|
||
* and may be covered by U.S. and Foreign Patents,patents in process, and are protected by
|
||
* trade secret or copyright law.
|
||
* Dissemination of this information or reproduction of this material
|
||
* is strictly forbidden unless prior written permission is obtained
|
||
* DeepCam, LLC.
|
||
*
|
||
*
|
||
* Written: DongPo Wang
|
||
* Date: 11/24/2020
|
||
* Mail: dongpo.wang@deepcam.com
|
||
*/
|
||
|
||
#ifndef _DEEPCAM_FACE_STD_API_H
|
||
#define _DEEPCAM_FACE_STD_API_H
|
||
|
||
#include "DeepCamDef.h"
|
||
#include "opencv2/opencv.hpp"
|
||
#include <vector>
|
||
|
||
#define IN
|
||
#define OUT
|
||
|
||
#ifdef DEEPCAM_FACE_LIBRARY
|
||
#ifdef _MSC_VER
|
||
#define DEEPCAM_API_EXPORT __declspec(dllexport)
|
||
#else
|
||
#define DEEPCAM_API_EXPORT __attribute ((visibility("default")))
|
||
#endif //_MSC_VER
|
||
#else
|
||
#ifdef _MSC_VER
|
||
#define DEEPCAM_API_EXPORT __declspec(dllimport)
|
||
#else
|
||
#define DEEPCAM_API_EXPORT
|
||
#endif //_MSC_VER
|
||
#endif // DEEPCAM_FACE_LIBRARY
|
||
|
||
enum PIXEL_TYPE
|
||
{
|
||
PIXEL_RGB = 0,
|
||
PIXEL_BGR = 1
|
||
};
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamFaceDetectStd(IN unsigned char * data, IN int width, IN int height, IN int pixelType = PIXEL_BGR);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamGetFaceRectStd(IN int index, OUT float* face_rect);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamGetFaceLandmarkStd(IN int index, OUT float* landmark);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamGetFaceQualityStd(IN int index, OUT float& score);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamGetFaceFeatureStd(IN int index, OUT float* feature);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamFaceFeatureCompareStd(const float* feature1, const float* feature2, float & fSimilarity);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamFaceLivenessRgbStd(IN int index, OUT float& score);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamFaceLivenesIrStd(IN int index, OUT float& score);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamGetFaceLandmark68Std(IN int index, OUT float* landmark68);
|
||
|
||
|
||
/************************************************************************/
|
||
/* 人脸数据库管理接口 */
|
||
/************************************************************************/
|
||
|
||
/**
|
||
* @brief 录入人脸到数据库
|
||
* @param name 录入人脸名称
|
||
* @param vid 录入人脸ID
|
||
* @param group_name 人脸分组
|
||
* @param feature 人脸特征值,特征值长度为512
|
||
* @param img_data 图像数据
|
||
* @param img_data_len 图像数据长度
|
||
* @return 参考DeepCamDef.h
|
||
*/
|
||
DEEPCAM_API_EXPORT int DeepCamEnterFace(IN const char* name, IN const char* vid, IN const char* group_name,
|
||
IN const float* feature, IN const unsigned char* img_data, IN int img_data_len);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamFaceSearch(IN const float* feature, IN const char* group_name, OUT char* name, OUT char* vid,
|
||
OUT const uint8_t* img_data, OUT float& fSimilarity, float fThreshold = 0.8);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamDeleteFaceByName(IN const char* name, IN const char* group_name);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamDeleteAllFace(IN const char* group_name);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamAddFaceGroup(IN const char* group_name, IN const char* remarks);
|
||
|
||
DEEPCAM_API_EXPORT int DeepCamDeleteFaceGroup(IN const char* group_name);
|
||
|
||
|
||
/**
|
||
* @brief 获取所有人脸分组信息
|
||
* @param group_infos 分组数据信息 {"group_num":1,data:[{"group_name":"","remark":""}]}
|
||
* @param len 返回的数据长度
|
||
* @return 参考DeepCamDef.h
|
||
*/
|
||
//DEEPCAM_API_EXPORT int DeepCamGetAllFaceGroup(OUT char* group_infos, OUT int& len);
|
||
|
||
/**
|
||
* @brief 获取某个人脸分组下面的所有人脸信息
|
||
* @param group_name 分组名称
|
||
* @param face_infos 人脸数据信息 {"face_num":1,"group_name":"1号组",data:[{"name":"张三","vid":"","uuid":""}]}
|
||
* @param len 返回的数据长度
|
||
* @return 参考DeepCamDef.h
|
||
*/
|
||
//DEEPCAM_API_EXPORT int DeepCamGetAllFaceByGroup(IN const char* group_name, OUT char* face_infos, OUT int& len);
|
||
|
||
#ifdef __cplusplus
|
||
} //end extern "C"
|
||
#endif
|
||
|
||
#endif |