PersonDisappearComponent

最低版本: 1.0.0最后更新: 2020/3/30

组件功能:

持续判断人丢(支持特定id, name及任何人)

支持平台

平台是否支持
豹小秘
豹花/大瓶
M平台

参数

参数名类型属性JS类型Java类型默认值必填说明最低版本
paramPersonDisappearParampersonIdnumberintno用于检测特定id的人脸1.0.0
personNamestringStringno用于检测特定名字的人脸(如果id和name都未提供则检测符合条件的任意人脸或人体)1.0.0
maxDistancenumberdouble3no最大距离1.0.0
maxFaceAngleXnumberdouble60no最大人脸角度1.0.0
isNeedInCompleteFacebooleanbooleanfalseno是否需要检测不完整人脸1.0.0
isNeedBodybooleanbooleanfalseno是否需要检测人体1.0.0
disappearTimeoutnumberlong7000msno人丢时间1.0.0
lostTimeoutnumberlong0msno判定人丢的时长,必须比disappearTimeout小,且大于01.1.0
  scenestringStringno场景名称1.20.0

结果码

返回结果描述
RESULT_TIMEOUT32610003组件执行超时

错误码

返回错误描述
ERROR_OPEN_PERSON_DETECT_FAILED-32600004获取人脸数据失败

示例代码:

<PersonDisappearComponent

   param={{}}

   onStatusUpdate={this.personDisappearOnStatusUpdate}

   onFinish={this.personDisappearOnFinish}

></PersonDisappearComponent>

public personDisappearOnStatusUpdate = (

   event?: ComponentEvent

): boolean => {

   console.log(TAG, 'onStatusUpdate event: ', event);

   if (event) {

       switch (event.status) {

           case ComponentStatusConst.STATUS_TRACK_SUCCESS:

               console.log(

                   TAG,

                   'personDisappearOnStatusUpdate STATUS_TRACK_SUCCESS'

               );

               return true;

           case ComponentStatusConst.STATUS_TRACK_END:

               console.log(

                   TAG,

                   'personDisappearOnStatusUpdate STATUS_TRACK_END'

               );

               return true;

           case ComponentStatusConst.STATUS_TRACK_FAILED:

               console.log(

                   TAG,

                   'personDisappearOnStatusUpdate STATUS_TRACK_FAILED'

               );

               return true;

       }

   }

   return false;

};

public personDisappearOnFinish = (event?: ComponentEvent): boolean => {

   console.log(TAG, 'onFinish event: ', event);

   return true;

};