| | |
| | | return face_compare(feat1, feat2); |
| | | } |
| | | |
| | | // quality |
| | | int c_api_face_quality_init(const int tm){ |
| | | return init_face_quality(tm, dtors_); |
| | | } |
| | | |
| | | void c_api_set_quality_params(const int min, const int max){ |
| | | return set_quality_params(min, max); |
| | | } |
| | | |
| | | cThfqResult* c_api_face_check_quality(const cFacePos *pos, uchar*data, const int w, const int h, const int channel){ |
| | | const cIMAGE img{data, w, h, 3}; |
| | | return face_check_quality(channel, &img, *pos); |
| | | } |
| | | |
| | | int c_api_face_check_quality_brightness(const cFacePos *pos, uchar*data, const int w, const int h, const int channel, int *nBrightness){ |
| | | const cIMAGE img{data, w, h, 3}; |
| | | return face_check_quality_brightness(channel, &img, *pos, nBrightness); |
| | | } |
| | | |
| | | int c_api_face_check_quality_occlusion(const cFacePos *pos, uchar*data, const int w, const int h, const int channel, int *nOcclusion){ |
| | | const cIMAGE img{data, w, h, 3}; |
| | | return face_check_quality_occlusion(channel, &img, *pos, nOcclusion); |
| | | } |
| | | |
| | | int c_api_face_check_quality_hat(const cFacePos *pos, uchar*data, const int w, const int h, const int channel, int *nHat){ |
| | | const cIMAGE img{data, w, h, 3}; |
| | | return face_check_quality_hat(channel, &img, *pos, nHat); |
| | | } |
| | | |
| | | int c_api_face_check_quality_blur_glass(const cFacePos *pos, uchar*data, const int w, const int h, |
| | | const int channel, int* nBlur,int* nGlasses){ |
| | | const cIMAGE img{data, w, h, 3}; |
| | | return face_check_quality_blur_glass(channel, &img, *pos, nBlur, nGlasses); |
| | | } |
| | | |
| | | cRECT* c_api_face_track_only(int *fCount, uchar *data, const int wid, const int hei, const int channel){ |
| | | const cIMAGE img{data, wid, hei, 3}; |
| | | |
| | |
| | | cFaceInfo* c_api_face_track_detect(int *fCount, uchar *data, const int wid, const int hei, const int channel); |
| | | cFaceInfo* c_api_face_track(int *fCount, uchar *data, const int wid, const int hei, const int channel); |
| | | |
| | | // quality |
| | | int c_api_face_quality_init(const int tm); |
| | | void c_api_set_quality_params(const int min, const int max); |
| | | cThfqResult* c_api_face_check_quality(const cFacePos *pos, uchar*data, const int w, const int h, const int channel); |
| | | int c_api_face_check_quality_brightness(const cFacePos *pos, uchar*data, const int w, const int h, |
| | | const int channel, int *nBrightness); |
| | | int c_api_face_check_quality_occlusion(const cFacePos *pos, uchar*data, const int w, const int h, |
| | | const int channel, int *nOcclusion); |
| | | int c_api_face_check_quality_hat(const cFacePos *pos, uchar*data, const int w, const int h, |
| | | const int channel, int *nHat); |
| | | int c_api_face_check_quality_blur_glass(const cFacePos *pos, uchar*data, const int w, const int h, |
| | | const int channel, int* nBlur,int* nGlasses); |
| | | |
| | | /// yolo api |
| | | cObjInfo* c_api_yolo_detect(YoloHandle handle, int *objCount, uchar*data, const int w, const int h, const float thrsh, const int use_means); |
| | | const char* c_api_yolo_obj_name(const int typ); |
| | |
| | | long nFaceID;//face tracking id |
| | | } cFaceInfo; |
| | | |
| | | typedef struct _cThfqParam{ |
| | | int brightness_min;//0-100,太暗阈值,建议25.越小越可能把过暗的人脸当作正常人脸,此参数会影响THFQ_Result::brightness |
| | | int brightness_max;//0-100,太亮阈值,建议75.越大越可能把的过亮人脸当作正常人脸,此参数会影响THFQ_Result::brightness |
| | | }cThfqParam; |
| | | |
| | | typedef struct _cThfqResult{ |
| | | int brightness;//人脸亮度,只有3种可能的值:[-1->太暗,0->正常,1->太亮],亮度结果会受亮度阈值参数brightness_min和brightness_max影响 |
| | | int occlusion;//人脸遮挡度,范围值为0-100,越大表示人脸遮挡程度越高 |
| | | int hat;//带帽子,范围为0-100,越大表示越可能有佩戴帽子,建议判别阈值为50 |
| | | int blur;//人脸模糊度,范围值为0-100,越大表示图像越模糊,建议人脸模糊度判别阈值为70 |
| | | int glasses;//带眼镜,范围为0-100,越大表示越可能有戴眼镜,建议判别阈值为70 |
| | | }cThfqResult; |
| | | |
| | | |
| | | typedef struct _cObjInfo |
| | | { |
| | | cRECT rcObj; |
| | |
| | | #include "buz/face/extractor.cpp" |
| | | #include "buz/face/property.cpp" |
| | | #include "buz/face/tracker.cpp" |
| | | #include "buz/face/quality.cpp" |
| | | |
| | | #include "buz/yolo/detector.cpp" |
| | | |
New file |
| | |
| | | #include "quality.h" |
| | | |
| | | #include "THFaceQuality_i.h" |
| | | #include "csdk_struct.h" |
| | | |
| | | namespace csdk_wrap{ |
| | | int init_face_quality(const int tm, VecFunc &vec){ |
| | | auto ret = THFQ_Create(tm); |
| | | if(ret != tm){ |
| | | printf("create face quality error\n"); |
| | | }else{ |
| | | vec.emplace_back([]{THFQ_Release();}); |
| | | } |
| | | return ret; |
| | | } |
| | | |
| | | void set_quality_params(const int min, const int max){ |
| | | int _min = (min<=10)?10:((min>=40)?40:min); |
| | | int _max = (max>=90)?90:((max<=60)?60:max); |
| | | const cThfqParam params{_min, _max}; |
| | | printf("set_quality_params : %d, %d\n", _min, _max); |
| | | |
| | | THFQ_SetParam((THFQ_Param*)¶ms); |
| | | } |
| | | |
| | | cThfqResult* face_check_quality(const int chan, const cIMAGE *img, const cFacePos &pos){ |
| | | if(chan < 0 || !img){ |
| | | printf("face check quality error, image or pos null\n"); |
| | | return NULL; |
| | | } |
| | | |
| | | cThfqResult *pResult = (cThfqResult*)malloc(sizeof(cThfqResult)); |
| | | auto ret = THFQ_Check(chan, (BYTE*)(img->data), 3, img->width, img->height, (THFI_FacePos*)(&pos), (THFQ_Result*)pResult); |
| | | return pResult; |
| | | } |
| | | |
| | | int face_check_quality_brightness(const int chan, const cIMAGE *img, const cFacePos &pos, int *nBrightness){ |
| | | if(!img){ |
| | | printf("face check quality error, image or pos null\n"); |
| | | return -1; |
| | | } |
| | | |
| | | auto ret = THFQ_Check_Brightness(chan, (BYTE*)(img->data), 3, img->width, img->height, (THFI_FacePos*)(&pos), (int*)nBrightness); |
| | | return ret; |
| | | } |
| | | |
| | | int face_check_quality_occlusion(const int chan, const cIMAGE *img, const cFacePos &pos, int *nOcclusion){ |
| | | if(!img){ |
| | | printf("face check quality error, image or pos null\n"); |
| | | return -1; |
| | | } |
| | | |
| | | auto ret = THFQ_Check_Occlusion(chan, (BYTE*)(img->data), 3, img->width, img->height, (THFI_FacePos*)(&pos), (int*)nOcclusion); |
| | | return ret; |
| | | } |
| | | int face_check_quality_hat(const int chan, const cIMAGE *img, const cFacePos &pos, int *nHat){ |
| | | if(!img){ |
| | | printf("face check quality error, image or pos null\n"); |
| | | return -1; |
| | | } |
| | | |
| | | auto ret = THFQ_Check_Hat(chan, (BYTE*)(img->data), 3, img->width, img->height, (THFI_FacePos*)(&pos), (int*)nHat); |
| | | return ret; |
| | | } |
| | | |
| | | int face_check_quality_blur_glass(const int chan, const cIMAGE *img, const cFacePos &pos, int* nBlur,int* nGlasses){ |
| | | if(!img){ |
| | | printf("face check quality error, image or pos null\n"); |
| | | return -1; |
| | | } |
| | | |
| | | auto ret = THFQ_Check_BlurGlasses(chan, (BYTE*)(img->data), 3, img->width, img->height, (THFI_FacePos*)(&pos), (int*)nBlur, (int*)nGlasses); |
| | | return ret; |
| | | } |
| | | } |
New file |
| | |
| | | #ifndef _c_wrapper_face_quality_h_ |
| | | #define _c_wrapper_face_quality_h_ |
| | | |
| | | #include "../base.hpp" |
| | | |
| | | struct _cFacePos; |
| | | struct _cIMAGE; |
| | | struct _cThfqParam; |
| | | struct _cThfqResult; |
| | | |
| | | namespace csdk_wrap{ |
| | | int init_face_quality(const int tm); |
| | | void set_quality_params(const _cThfqParam* params); |
| | | int face_check_quality(const int chan, const cIMAGE *img, const cFacePos &pos, _cThfqResult *pResult); |
| | | int face_check_quality_brightness(const int chan, const cIMAGE *img, const cFacePos &pos, int *nBrightness); |
| | | int face_check_quality_occlusion(const int chan, const cIMAGE *img, const cFacePos &pos, int *nOcclusion); |
| | | int face_check_quality_hat(const int chan, const cIMAGE *img, const cFacePos &pos, int *nHat); |
| | | int face_check_quality_blur_glass(const int chan, const cIMAGE *img, const cFacePos &pos, int* nBlur,int* nGlasses); |
| | | } |
| | | #endif |
| | |
| | | PFacialData [8192]uint8 |
| | | NFaceID int64 |
| | | } |
| | | type CThfqParam struct { |
| | | Brightness_min int32 //0-100,太暗阈值,建议25.越小越可能把过暗的人脸当作正常人脸,此参数会影响THFQ_Result::brightness |
| | | Brightness_max int32 //0-100,太亮阈值,建议75.越大越可能把的过亮人脸当作正常人脸,此参数会影响THFQ_Result::brightness |
| | | } |
| | | type CThfqResult struct { |
| | | Brightness int32 //人脸亮度,只有3种可能的值:[-1->太暗,0->正常,1->太亮],亮度结果会受亮度阈值参数brightness_min和brightness_max影响 |
| | | Occlusion int32 //人脸遮挡度,范围值为0-100,越大表示人脸遮挡程度越高 |
| | | Hat int32 //带帽子,范围为0-100,越大表示越可能有佩戴帽子,建议判别阈值为50 |
| | | Blur int32 //人脸模糊度,范围值为0-100,越大表示图像越模糊,建议人脸模糊度判别阈值为70 |
| | | Glasses int32 //带眼镜,范围为0-100,越大表示越可能有戴眼镜,建议判别阈值为70 |
| | | } |
| | | |
| | | type CObjInfo struct { |
| | | RcObj CRECT |
| | | Typ int32 |
| | | Prob float32 |
| | | } |
| | | |
| | | //track yolo objs info |
| | | type CObjTrackInfo struct { |
| | | ObjInfo CObjInfo |
| | |
| | | #cgo LDFLAGS: -L/usr/local/cuda/lib64 -L${SRCDIR}/sdk/face/lib/gpu -L${SRCDIR}/sdk/darknet/lib |
| | | #cgo LDFLAGS: -L${SRCDIR}/sdk/plate/eparking/lib -L${SRCDIR}/sdk/plate/cloud/lib -L${SRCDIR}/sdk/plate/vehicle/lib |
| | | #cgo LDFLAGS: -Wl,-rpath,${SRCDIR}/sdk/face/lib/gpu:${SRCDIR}/sdk/darknet/lib:${SRCDIR}/sdk/plate/cloud/lib:${SRCDIR}/sdk/plate/vehicle/lib |
| | | #cgo LDFLAGS: -ldarknet -lTHFaceImage -lTHFeature -lTHFaceProperty -lTHFaceTracking -lcudart -lcublas -lcurand -lrt -ldl -lpthread -lthplateid -lLPRecognition |
| | | #cgo LDFLAGS: -ldarknet -lTHFaceImage -lTHFaceQuality -lTHFeature -lTHFaceProperty -lTHFaceTracking -lcudart -lcublas -lcurand -lrt -ldl -lpthread -lthplateid -lLPRecognition |
| | | #cgo LDFLAGS: -lVehicleTypeRecognition -lFeatureExtraction |
| | | #include <stdlib.h> |
| | | #include "csdk.h" |
| | |
| | | C.c_api_face_tracker_init(C.int(tm), C.int(gi), C.int(w), C.int(h), C.int(maxFaces), C.int(interval), C.int(sample)) |
| | | } |
| | | |
| | | // InitFaceQuality init face quality |
| | | func InitFaceQuality(tm int) { |
| | | |
| | | C.c_api_face_quality_init(C.int(tm)) |
| | | } |
| | | |
| | | // SetFaceQualityParams set face quality params |
| | | func SetFaceQualityParams(min, max int) { |
| | | |
| | | C.c_api_set_quality_params(C.int(min), C.int(max)) |
| | | } |
| | | |
| | | // ResizeFaceTracker init face tracker |
| | | func ResizeFaceTracker(ch, w, h int) int { |
| | | |
| | |
| | | return b |
| | | } |
| | | |
| | | |
| | | // FaceQuality face check quality |
| | | func FaceQuality(fpos CFacePos, img SDKImage, ch int) CThfqResult { |
| | | |
| | | data := img.Data |
| | | w := img.Width |
| | | h := img.Height |
| | | |
| | | pos := (*C.cFacePos)(unsafe.Pointer(&fpos)) |
| | | result := C.c_api_face_check_quality(pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch)) |
| | | |
| | | return *((*CThfqResult)(unsafe.Pointer(&result))) |
| | | } |
| | | |
| | | // FaceQuality face check quality |
| | | func FaceQualityBrightness(fpos CFacePos, img SDKImage, ch int) int { |
| | | |
| | | data := img.Data |
| | | w := img.Width |
| | | h := img.Height |
| | | |
| | | var brightness, ret C.int |
| | | pos := (*C.cFacePos)(unsafe.Pointer(&fpos)) |
| | | |
| | | ret = C.c_api_face_check_quality_brightness(pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch), &brightness) |
| | | if ret == -1 { |
| | | return -1 |
| | | } |
| | | |
| | | return int(brightness) |
| | | } |
| | | |
| | | // FaceQuality face check quality |
| | | func FaceQualityOcclusion(fpos CFacePos, img SDKImage, ch int) int { |
| | | |
| | | data := img.Data |
| | | w := img.Width |
| | | h := img.Height |
| | | |
| | | var occlusion, ret C.int |
| | | pos := (*C.cFacePos)(unsafe.Pointer(&fpos)) |
| | | |
| | | ret = C.c_api_face_check_quality_occlusion(pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch), &occlusion) |
| | | if ret == -1 { |
| | | return -1 |
| | | } |
| | | |
| | | return int(occlusion) |
| | | } |
| | | |
| | | // FaceQuality face check quality |
| | | func FaceQualityHat(fpos CFacePos, img SDKImage, ch int) int { |
| | | |
| | | data := img.Data |
| | | w := img.Width |
| | | h := img.Height |
| | | |
| | | var hat, ret C.int |
| | | pos := (*C.cFacePos)(unsafe.Pointer(&fpos)) |
| | | |
| | | ret = C.c_api_face_check_quality_hat(pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch), &hat) |
| | | if ret == -1 { |
| | | return -1 |
| | | } |
| | | |
| | | return int(hat) |
| | | } |
| | | |
| | | // FaceQuality face check quality |
| | | func FaceQualityBlurGlass(fpos CFacePos, img SDKImage, ch int) (int, int) { |
| | | |
| | | data := img.Data |
| | | w := img.Width |
| | | h := img.Height |
| | | |
| | | var blur, glass, ret C.int |
| | | pos := (*C.cFacePos)(unsafe.Pointer(&fpos)) |
| | | |
| | | ret = C.c_api_face_check_quality_blur_glass(pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch), &blur, &glass) |
| | | if ret == -1 { |
| | | return -1, -1 |
| | | } |
| | | |
| | | return int(blur), int(glass) |
| | | } |
| | | |
| | | // FaceCompare face compare |
| | | func FaceCompare(feat1 []byte, feat2 []byte) float32 { |
| | | res := C.c_api_face_compare((*C.uchar)(unsafe.Pointer(&feat1[0])), (*C.uchar)(unsafe.Pointer(&feat2[0]))) |
New file |
| | |
| | | #ifndef THFACEQUALITY_I_H
|
| | | #define THFACEQUALITY_I_H
|
| | |
|
| | | #include "THFaceImage_i.h"
|
| | |
|
| | | /*
|
| | | * ============================================================================
|
| | | * Name : THFaceQuality_i.h
|
| | | * Part of : Face Quality (THFaceQuality) SDK
|
| | | * Created : 5.11.2019 by XXX
|
| | | * Description:
|
| | | * THFaceQuality_i.h - Face Quality (THFaceQuality) SDK header file
|
| | | * Version : 1.0.0
|
| | | * Copyright: All Rights Reserved by XXXX
|
| | | * Revision:
|
| | | * ============================================================================
|
| | | */
|
| | |
|
| | | #define THFACEQUALITY_API extern "C"
|
| | |
|
| | | struct THFQ_Param
|
| | | {
|
| | | int brightness_min;//0-100,太暗阈值,建议25.越小越可能把过暗的人脸当作正常人脸,此参数会影响THFQ_Result::brightness
|
| | | int brightness_max;//0-100,太亮阈值,建议75.越大越可能把的过亮人脸当作正常人脸,此参数会影响THFQ_Result::brightness
|
| | | };
|
| | |
|
| | | struct THFQ_Result
|
| | | {
|
| | | int brightness;//人脸亮度,只有3种可能的值:[-1->太暗,0->正常,1->太亮],亮度结果会受亮度阈值参数brightness_min和brightness_max影响
|
| | | int occlusion;//人脸遮挡度,范围值为0-100,越大表示人脸遮挡程度越高
|
| | | int hat;//带帽子,范围为0-100,越大表示越可能有佩戴帽子,建议判别阈值为50
|
| | | int blur;//人脸模糊度,范围值为0-100,越大表示图像越模糊,建议人脸模糊度判别阈值为70
|
| | | int glasses;//带眼镜,范围为0-100,越大表示越可能有戴眼镜,建议判别阈值为70
|
| | | };
|
| | |
|
| | | THFACEQUALITY_API int THFQ_Create(short nChannelNum);
|
| | | /*
|
| | | 描述:初始化人脸质量模块,建议在应用程序初始化时调用一次
|
| | | 参数:
|
| | | nChannelNum[intput],算法通道数,一个线程使用一个通道
|
| | | 返回值:
|
| | | 大于0为成功初始化的通道数,小于等于0为加载模型失败
|
| | | */
|
| | |
|
| | | THFACEQUALITY_API void THFQ_Release();
|
| | | /*
|
| | | 描述:释放人脸质量模块,建议在应用程序退出时调用一次
|
| | | 参数:
|
| | | 无
|
| | | 返回值:
|
| | | 无
|
| | | */
|
| | |
|
| | | THFACEQUALITY_API void THFQ_SetParam(THFQ_Param* pParam);
|
| | | /*
|
| | | 描述:设置参数
|
| | | 参数:
|
| | | pParam[input],算法相关参数,主要是亮度阈值,如果参数为NULL,算法内部将使用默认值
|
| | | 返回值:
|
| | | 无
|
| | | */
|
| | |
|
| | | THFACEQUALITY_API int THFQ_Check(short nChannelID, BYTE* pImage, int bpp, int nWidth, int nHeight, THFI_FacePos* pfp,THFQ_Result* pResult);
|
| | | /*
|
| | | 描述:获取一个人脸的所有质量判别结果
|
| | | 参数:
|
| | | nChannelID[intput],通道id,与初始化THFQ_Create相关,一般来说合法的通道id为0到nChannelNum-1
|
| | | pImage[input],图像数据地址,图像数据必须为bgr顺序
|
| | | bpp[input],图像数据格式,必须为24,代表bgr三通道数据
|
| | | nWidth[input],图像宽
|
| | | nHeight[input],图像高
|
| | | pfp[input],人脸检测结果,由THFaceImage模块的人脸检测接口THFI_DetectFace返回的THFI_FacePos数据
|
| | | pResult[output],质量判别结果
|
| | | 返回值:
|
| | | -1,算法未初始化或通道id非法
|
| | | -2,图像数据参数非法
|
| | | -3,pfp或pResult为NULL
|
| | | 0,成功
|
| | | */
|
| | |
|
| | | THFACEQUALITY_API int THFQ_Check_Brightness(short nChannelID, BYTE* pImage, int bpp, int nWidth, int nHeight, THFI_FacePos* pfp, int* nBrightness);
|
| | | /*
|
| | | 描述:获取一个人脸的亮度判别结果
|
| | | 参数:
|
| | | nChannelID[intput],通道id,与初始化THFQ_Create相关,一般来说合法的通道id为0到nChannelNum-1
|
| | | pImage[input],图像数据地址,图像数据必须为bgr顺序
|
| | | bpp[input],图像数据格式,必须为24,代表bgr三通道数据
|
| | | nWidth[input],图像宽
|
| | | nHeight[input],图像高
|
| | | pfp[input],人脸检测结果,由THFaceImage模块的人脸检测接口THFI_DetectFace返回的THFI_FacePos数据
|
| | | nBrightness[output],亮度判别结果
|
| | | 返回值:
|
| | | -1,算法未初始化或通道id非法
|
| | | -2,图像数据参数非法
|
| | | -3,pfp或nBrightness为NULL
|
| | | 0,成功
|
| | | */
|
| | |
|
| | | THFACEQUALITY_API int THFQ_Check_Occlusion(short nChannelID, BYTE* pImage, int bpp, int nWidth, int nHeight, THFI_FacePos* pfp, int* nOcclusion);
|
| | | /*
|
| | | 描述:获取一个人脸的遮挡判别结果
|
| | | 参数:
|
| | | nChannelID[intput],通道id,与初始化THFQ_Create相关,一般来说合法的通道id为0到nChannelNum-1
|
| | | pImage[input],图像数据地址,图像数据必须为bgr顺序
|
| | | bpp[input],图像数据格式,必须为24,代表bgr三通道数据
|
| | | nWidth[input],图像宽
|
| | | nHeight[input],图像高
|
| | | pfp[input],人脸检测结果,由THFaceImage模块的人脸检测接口THFI_DetectFace返回的THFI_FacePos数据
|
| | | nOcclusion[output],遮挡判别结果
|
| | | 返回值:
|
| | | -1,算法未初始化或通道id非法
|
| | | -2,图像数据参数非法
|
| | | -3,pfp或nOcclusion为NULL
|
| | | 0,成功
|
| | | */
|
| | |
|
| | | THFACEQUALITY_API int THFQ_Check_Hat(short nChannelID, BYTE* pImage, int bpp, int nWidth, int nHeight, THFI_FacePos* pfp, int* nHat);
|
| | | /*
|
| | | 描述:获取一个人脸的帽子判别结果
|
| | | 参数:
|
| | | nChannelID[intput],通道id,与初始化THFQ_Create相关,一般来说合法的通道id为0到nChannelNum-1
|
| | | pImage[input],图像数据地址,图像数据必须为bgr顺序
|
| | | bpp[input],图像数据格式,必须为24,代表bgr三通道数据
|
| | | nWidth[input],图像宽
|
| | | nHeight[input],图像高
|
| | | pfp[input],人脸检测结果,由THFaceImage模块的人脸检测接口THFI_DetectFace返回的THFI_FacePos数据
|
| | | nHat[output],帽子判别结果
|
| | | 返回值:
|
| | | -1,算法未初始化或通道id非法
|
| | | -2,图像数据参数非法
|
| | | -3,pfp或nHat为NULL
|
| | | 0,成功
|
| | | */
|
| | |
|
| | | THFACEQUALITY_API int THFQ_Check_BlurGlasses(short nChannelID, BYTE* pImage, int bpp, int nWidth, int nHeight, THFI_FacePos* pfp, int* nBlur,int* nGlasses);
|
| | | /*
|
| | | 描述:获取一个人脸的模糊度与眼镜判别结果
|
| | | 参数:
|
| | | nChannelID[intput],通道id,与初始化THFQ_Create相关,一般来说合法的通道id为0到nChannelNum-1
|
| | | pImage[input],图像数据地址,图像数据必须为bgr顺序
|
| | | bpp[input],图像数据格式,必须为24,代表bgr三通道数据
|
| | | nWidth[input],图像宽
|
| | | nHeight[input],图像高
|
| | | pfp[input],人脸检测结果,由THFaceImage模块的人脸检测接口THFI_DetectFace返回的THFI_FacePos数据
|
| | | nBlur[output],模糊度判别结果
|
| | | nGlasses[output],眼镜判别结果
|
| | | 返回值:
|
| | | -1,算法未初始化或通道id非法
|
| | | -2,图像数据参数非法
|
| | | -3,pfp或nBlur或nGlasses为NULL
|
| | | 0,成功
|
| | | */
|
| | |
|
| | |
|
| | | #endif
|