StandardFaceTrackComponent

最低版本: 1.0.0最后更新: 2020/6/18

组件功能:

用于多轮焦点跟随

支持平台

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

参数

参数名类型属性JS类型Java类型默认值必填说明最低版本
paramStandardFaceTrackParampersonIdnumberintundefinedno需要首次跟随的id1.0.0
maxDistancenumberdouble3no识别最大距离,单位m(米)1.0.0
maxFaceAngleXnumberdouble60no识别最大人脸角度,单位度1.0.0
isNeedInCompleteFacebooleanbooleanfalseno是否检测红框人脸1.0.0
disappearTimeoutnumberlong7000no丢失超时时间,单位 ms1.0.0
isMultiPersonNotTrackbooleanbooleanfalseno是否停用多人追踪1.1.2
multiPersonNotTrackDistancenumberdouble2no多人检测距离,单位m(米)1.1.2
isAllowMoveBodybooleanbooleantrueno是否移动底盘1.1.2

结果码

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

错误码

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

状态码

返回状态描述
STATUS_TRACK_SUCCESS32720001焦点跟随成功
STATUS_TRACK_END32720003单次焦点跟随结束,还会继续找人追踪

示例代码:

this.param = new StandardFaceTrackParam(personId);

<StandardFaceTrackComponent

    param={this.param}

    navigation={this.props.navigation}

    onStatusUpdate={this.onStatusUpdate}

    onFinish={this.onFinish}

/>

public onStatusUpdate = (status: any, data: any): void => {

    console.log('onStatusUpdate status: ', status, ' data: ', data);

    switch (status) {

      case ComponentStatusConst.STATUS_TRACK_SUCCESS:

          if (data) {

              console.log('onStatusUpdate status: ',' person:',JSON.parse(data));

          }

          break;

      case ComponentStatusConst.STATUS_TRACK_END:

         console.log('onStatusUpdate status: ',' STATUS_TRACK_END');

          break;

      default:

          break;

  }

};

public onFinish = (reason: any, result: any): void => {

    console.log('onFinish: ',' reason:',reason,'  result:',result);

};