wx_human_seg 3.0.0
Typedefs | Functions
wx_idphoto_detect_c_api.h File Reference
#include "wx_api.h"
#include "wx_image_c_api.h"
#include "wx_idphoto_c_api.h"

Go to the source code of this file.

Typedefs

typedef struct WXIDPhotoDetectResult_t WXIDPhotoDetectResult_t
 
typedef struct WXIDPhotoDetector_t WXIDPhotoDetector_t
 

Functions

WX_API void WXIDPhotoDetectResult_Release (WXIDPhotoDetectResult_t *result)
 
WX_API int WXIDPhotoDetectResult_GetInt (WXIDPhotoDetectResult_t *result, const char *key, int defValue)
 
WX_API float WXIDPhotoDetectResult_GetFloat (WXIDPhotoDetectResult_t *result, const char *key, float defValue)
 
WX_API uint8_t WXIDPhotoDetectResult_GetBool (WXIDPhotoDetectResult_t *result, const char *key, uint8_t defValue)
 
WX_API const char * WXIDPhotoDetectResult_GetString (WXIDPhotoDetectResult_t *result, const char *key)
 
WX_API const int * WXIDPhotoDetectResult_GetIntArray (WXIDPhotoDetectResult_t *result, const char *key)
 
WX_API const float * WXIDPhotoDetectResult_GetFloatArray (WXIDPhotoDetectResult_t *result, const char *key)
 
WX_API int WXIDPhotoDetectResult_KeyIsExists (WXIDPhotoDetectResult_t *result, const char *key)
 
WX_API int WXIDPhotoDetector_Create (WXDeviceType deviceType, WXIDPhotoDetector_t **detector_p)
 创建WXIDPhotoDetector_t对象 More...
 
WX_API void WXIDPhotoDetector_Release (WXIDPhotoDetector_t *detector)
 
WX_API int WXIDPhotoDetector_Detect (WXIDPhotoDetector_t *detector, const WXImage_t *inImg, WXIDPhotoDetectResult_t **result_p)
 证件照成品检测函数 More...
 
WX_API void WXIDPhotoDetector_SetSettings (WXIDPhotoDetector_t *detector, const WXIDPhotoSettings_t *settings)
 保留函数,暂不使用
 

Detailed Description

证件照sdk,证件照成品检测接口。

Typedef Documentation

◆ WXIDPhotoDetector_t

C_WXIDPhotoDetector

WXIDPhotoDetector_t 结构对象

◆ WXIDPhotoDetectResult_t

WXIDPhotoDetectResult_t

WXIDPhotoDetectResult_t结构对象

Function Documentation

◆ WXIDPhotoDetector_Create()

WX_API int WXIDPhotoDetector_Create ( WXDeviceType  deviceType,
WXIDPhotoDetector_t **  detector_p 
)

创建WXIDPhotoDetector_t对象

See also
wonxai::WXIDPhotoDetector::WXIDPhotoDetector
Note
调用前,保证已经成功调用WXSDKInitWithLicense*函数对SDK进行了初始化
Parameters
[in]deviceType是否使用gpu
[out]detector_p创建并返回WXIDPhotoDetector_t对象
Returns
0: 成功; 非0: 错误码

◆ WXIDPhotoDetector_Detect()

WX_API int WXIDPhotoDetector_Detect ( WXIDPhotoDetector_t detector,
const WXImage_t inImg,
WXIDPhotoDetectResult_t **  result_p 
)

证件照成品检测函数

See also
wonxai::WXIDPhotoDetector::detect
Parameters
[in]detector使用WXIDPhotoDetector_Create 创建的WXIDPhotoDetector_t对象
[in]inImg待检测的图片
[out]result_p检测结果,WXIDPhotoDetectResult_t
Returns
0: 成功; 非0: 错误码

◆ WXIDPhotoDetector_Release()

WX_API void WXIDPhotoDetector_Release ( WXIDPhotoDetector_t detector)

释放WXIDPhotoDetector_t对象

◆ WXIDPhotoDetectResult_GetBool()

WX_API uint8_t WXIDPhotoDetectResult_GetBool ( WXIDPhotoDetectResult_t result,
const char *  key,
uint8_t  defValue 
)

获取WXIDPhotoDetectResult_t布尔型参数值,

◆ WXIDPhotoDetectResult_GetFloat()

WX_API float WXIDPhotoDetectResult_GetFloat ( WXIDPhotoDetectResult_t result,
const char *  key,
float  defValue 
)

获取WXIDPhotoDetectResult_t浮点参数值,

◆ WXIDPhotoDetectResult_GetFloatArray()

WX_API const float * WXIDPhotoDetectResult_GetFloatArray ( WXIDPhotoDetectResult_t result,
const char *  key 
)

获取WXIDPhotoDetectResult_t浮点数组参数值,

Note
如果参数值不存在或者类型不匹配,返回NULL

◆ WXIDPhotoDetectResult_GetInt()

WX_API int WXIDPhotoDetectResult_GetInt ( WXIDPhotoDetectResult_t result,
const char *  key,
int  defValue 
)
检测指标参数及类型如下:
   int face_count;                 // 人脸个数,如果人脸个数不等于1,则不会再检测其他指标,所以,可以先判断此指标
   int width_pix;                  // 图片像素宽度
   int height_pix;                 // 图片像素高度
   std::vector<int> dpi;           // dpi,长度为2,分别为宽和高的dpi,如果图片中未设置dpi,则返回的vector长度为0
   int width_mm;                   // 图片毫米宽度,只有当dpi值存在时,才有本指标
   int height_mm;                  // 图片毫米高度,只有当dpi值存在时,才有本指标
   int file_size;                  // 图片文件大小(in bytes)
   int darkillum;                  // 明暗度分数[0-100]
   int face_blur;                  // 脸部清晰度分数[0-100]
   int face_unbalance;             // 脸部光线平衡分数
   GlassesType glasses;            // 眼镜类型[0-100]
   int eyes_close;                 // 闭眼分数[0-100]
   int mouth_close;                // 闭嘴分数[0-100]
   int face_occlusion;             // 脸部遮挡分数[0-100]
   std::string photo_format;       // 图片格式,jpg,png
   float head_top;                 // 头顶离图片顶部距离(0-1.0)
   float head_left;                // 头左部离图片左边距离(0-1.0)
   float head_right;               // 头右部离图片右边距离(0-1.0)
   float head_chin_y;              // 头部下巴底部离图片底部距离(0-1.0)
   float face_x_center;            // 人脸中心点x轴(0-1.0)
   float eyes_y_center;            // 人脸中心点y轴(0-1.0)
   float eyes_spacing;             // 两眼中心点的距离(0-1.0)
   float face_x_occupy;            // 人脸宽度占比(0-1.0)
   std::vector<int> background_color;  // 背景颜色,RGB值,长度为3
   int background_clean;           // 背景干净度分值[0-100]
   int background_gradual;         // 是否为渐变色背景分值[0-100]
   int bf_similarity;              // 背景和衣服颜色相似度分值[0-100]
   int shoulder_equal;             // 肩膀两侧平衡分值[0-100]
   float nose_tip_x;               // 鼻尖位置X坐标(0-1.0)
   float nose_tip_y;               // 鼻尖位置Y坐标(0-1.0)
   std::vector<float> head_pose;   // 头部角度,长度为3,依次分别代表三个方向: yaw(左右摇头), pitch(上下点头), roll(左右摆头,头部歪向两侧肩膀)
   int gaze;                       // 视线是否平视前方的分值
 

获取WXIDPhotoDetectResult_t整形参数值

◆ WXIDPhotoDetectResult_GetIntArray()

WX_API const int * WXIDPhotoDetectResult_GetIntArray ( WXIDPhotoDetectResult_t result,
const char *  key 
)

获取WXIDPhotoDetectResult_t整形数组参数值,

Note
如果参数值不存在或者类型不匹配,返回NULL

◆ WXIDPhotoDetectResult_GetString()

WX_API const char * WXIDPhotoDetectResult_GetString ( WXIDPhotoDetectResult_t result,
const char *  key 
)

获取WXIDPhotoDetectResult_t字符串参数值,

Note
如果参数值不存在或者类型不匹配,返回NULL

◆ WXIDPhotoDetectResult_KeyIsExists()

WX_API int WXIDPhotoDetectResult_KeyIsExists ( WXIDPhotoDetectResult_t result,
const char *  key 
)

判断WXIDPhotoDetectResult_t参数key是否存在,

◆ WXIDPhotoDetectResult_Release()

WX_API void WXIDPhotoDetectResult_Release ( WXIDPhotoDetectResult_t result)

WXIDPhotoDetectResult_t结构释放函数