对视频中的车牌和人脸进行检测,输出车牌或人脸的位置矩形框、类别和置信度;目前应用在车端脱敏功能中。
详细接口说明查看头文件: bef_effect_ai_license_cake.h
BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_create(bef_effect_handle_t *handle);
参数说明
参数名 | 参数类型 | 参数说明 |
---|---|---|
handle | bef_effect_handle_t* | 创建的算法句柄 |
BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_init(bef_effect_handle_t handle, const char *modelPath);
参数说明
参数名 | 参数类型 | 参数说明 |
---|---|---|
handle | bef_ai_facefitting_handle | 创建的算法句柄 |
model_path | const char * | 模型的路径 |
返回值
成功返回 BEF_RESULT_SUC, 失败返回相应错误码, 具体请参考 bef_effect_ai_public_define.h
BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_detect(bef_effect_handle_t handle, const unsigned char *image, bef_ai_pixel_format pixel_format, int image_width, int image_height, int image_stride, bef_ai_rotate_type orientation, int *license_cake_info_num, bef_ai_license_cake_info **license_cake_info)
参数说明
参数名 | 参数类型 | 参数说明 |
---|---|---|
handle | bef_effect_handle_t | 算法句柄 |
image | const unsigned char * | 输入图像数据 |
pixel_format | bef_ai_pixel_format | 输入图像格式 |
image_width | int | 输入输入图像的宽度 (以像素为单位) |
image_height | int | 输入图像高输入图像的高度 (以像素为单位) |
image_stride | int | 输入图像每一行的步长 (以像素为单位) |
orientation | bef_ai_rotate_type | 输入图像的转向,具体请参考 bef_effect_ai_public_define.h 中的 bef_rotate_type |
license_cake_info_num | int | 最大支持检测数(10) |
license_cake_info | bef_ai_license_cake_info | 检测结果 |
返回值
成功返回 BEF_RESULT_SUC, 失败返回相应错误码, 具体请参考 bef_effect_ai_public_define.h
BEF_SDK_API bef_effect_result_t bef_effect_result_t bef_effect_ai_license_cake_release(bef_effect_handle_t handle);
参数说明
参数名 | 参数类型 | 参数说明 |
---|---|---|
handle | bef_effect_handle_t | 算法的句柄 |
返回值
成功返回 BEF_RESULT_SUC, 失败返回相应错误码, 具体请参考 bef_effect_ai_public_define.h
// 离线license检测方式 BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_check_license(bef_effect_handle_t handle, const char* licensePath) // 在线license检测方式 BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_check_online_license(bef_effect_handle_t handle, const char *licensePath)
参数说明
参数名 | 参数类型 | 参数说明 |
---|---|---|
handle | bef_effect_handle_t | 算法句柄 |
licensePath | const char * | 授权文件字符串 |
返回值
成功返回 BEF_RESULT_SUC, 失败返回相应错误码, 具体请参考 bef_effect_ai_public_define.h
/** * @brief 模型参数类型 */ typedef enum { ALGORITHM_PARAMS_KEY_LICENSEFACE_DEDETECTION_DETECT_INTERVAL = 0, // 定义执行检测算法帧率,例如每隔n帧执行一次检测算法 ALGORITHM_PARAMS_KEY_LICENSEFACE_DEDETECTION_SIDE_MODEL_LEN = 1, // 定义执行检测算法的输入分辨率 ALGORITHM_PARAMS_KEY_LICENSEFACE_DEDETECTION_DETECT_USE_REGRESSOR = 2, // 定义是否执行跟踪(回归)算法,暂未ready ALGORITHM_PARAMS_KEY_LICENSEFACE_DEDETECTION_DETECT_USE_TRACKER = 3, // 定义是否执行跟踪(卡尔曼滤波)算法,暂未ready } bef_ai_license_cake_param_type; BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_set_paramS(bef_effect_handle_t handle, bef_ai_license_cake_param_type type, const char *value); BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_set_paramF(bef_effect_handle_t handle, bef_ai_license_cake_param_type type, float value); BEF_SDK_API bef_effect_result_t bef_effect_ai_license_cake_set_paramI(bef_effect_handle_t handle, bef_ai_license_cake_param_type type, int value);
接口说明
详细接口说明查看文件:com.bytedance.labcv.effectsdk.LicenseCakeDetect.java
int init(Context context, String modelPath, String licensePath, boolean onlineLicense)
参数说明
参数名 | 参数类型 | 参数说明 |
---|---|---|
context | String | java context |
modelPath | String | 模型目录路径 |
licensePath | String | 授权文件绝对路径 |
onlineLicense | boolean | 授权类型 |
返回值
成功返回BEF_RESULT_SUC,否则返回对应的错误码
public BefLicenseCakeInfo detect(ByteBuffer buffer, BytedEffectConstants.PixlFormat pixelFormat, int imageWidth, int imageHeight, int imageStride, BytedEffectConstants.Rotation orientation)
参数说明
参数名 | 参数类型 | 参数说明 |
---|---|---|
buffer | ByteBuffer | 图像输出 |
pixelFormat | BytedEffectConstants.PixlFormat | 图像格式 |
image_width | int | 输入输入图像的宽度 (以像素为单位) |
image_height | int | 输入图像高输入图像的高度 (以像素为单位) |
image_stride | int | 输入图像每一行的步长 (以像素为单位) |
orientation | BytedEffectConstants.Rotation | 输入图像的转向 |
算法结果
BefLicenseCakeInfo:LicenseCake的算法结果
public void release()
答:建议首先查看以下tag输出Error类型的日志:
bef_effect_ai 和SMASH_E_LOG 以及 EffectSDK
错误码请参考错误码表