bef_effect_ai_skin_segmentation.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef ANDROIDDEMO_BEF_EFFECT_AI_SKIN_SEGMENTATION_H
  2. #define ANDROIDDEMO_BEF_EFFECT_AI_SKIN_SEGMENTATION_H
  3. #include "bef_effect_ai_public_define.h"
  4. /**
  5. * @brief 输出结果
  6. *
  7. */
  8. typedef struct
  9. {
  10. int width;
  11. int height;
  12. unsigned char* mask;
  13. } bef_ai_skin_segmentation_ret;
  14. /**
  15. * @brief 模型参数类型
  16. *
  17. */
  18. typedef enum {
  19. BEF_AI_SKIN_SEG_MODEL_KEY = 0, // 设置皮肤分割模型的key,默认tt_skin_seg, string
  20. BEF_AI_SKIN_SEG_IS_NEED_FACE = 1, // 是否加载人脸模型以去除五官皮肤, int
  21. } bef_ai_skin_segmentation_param_type;
  22. bef_effect_result_t SkinSegmentation_ReleaseHandle(bef_effect_handle_t handle);
  23. BEF_SDK_API
  24. bef_effect_result_t bef_effect_ai_skin_segmentation_create(bef_effect_handle_t *handle);
  25. BEF_SDK_API
  26. bef_effect_result_t bef_effect_ai_skin_segmentation_init(bef_effect_handle_t handle, const char *modelPath);
  27. BEF_SDK_API
  28. bef_effect_result_t bef_effect_ai_skin_segmentation_detect(bef_effect_handle_t handle,
  29. const unsigned char *image,
  30. bef_ai_pixel_format pixel_format,
  31. int image_width,
  32. int image_height,
  33. int image_stride,
  34. bef_ai_rotate_type orientation,
  35. bef_ai_skin_segmentation_ret *result);
  36. BEF_SDK_API
  37. bef_effect_result_t bef_effect_ai_skin_segmentation_set_paramS(bef_effect_handle_t handle, bef_ai_skin_segmentation_param_type type, const char *value);
  38. BEF_SDK_API
  39. bef_effect_result_t bef_effect_ai_skin_segmentation_set_paramI(bef_effect_handle_t handle, bef_ai_skin_segmentation_param_type type, int value);
  40. BEF_SDK_API
  41. bef_effect_result_t bef_effect_ai_skin_segmentation_release(bef_effect_handle_t handle);
  42. /**
  43. * @brief 皮肤分割授权
  44. * @param [in] handle Created skeleton detect handle
  45. * 已创建的皮肤分割句柄
  46. * @param [in] license 授权文件字符串
  47. * @param [in] length 授权文件字符串长度
  48. * @return If succeed return BEF_RESULT_SUC, other value please refer bef_effect_ai_public_define.h
  49. * 成功返回 BEF_RESULT_SUC, 授权码非法返回 BEF_RESULT_INVALID_LICENSE ,其它失败返回相应错误码, 具体请参考 bef_effect_ai_public_define.h
  50. */
  51. BEF_SDK_API
  52. bef_effect_result_t bef_effect_ai_skin_segmentation_check_license(bef_effect_handle_t handle, const char *licensePath);
  53. BEF_SDK_API
  54. bef_effect_result_t bef_effect_ai_skin_segmentation_check_online_license(bef_effect_handle_t handle, const char *licensePath);
  55. #endif //ANDROIDDEMO_BEF_EFFECT_AI_SKIN_SEGMENTATION_H