| class info |
| com.huawei.hms.mlsdk.objects.MLObject |
| 对象属性类,表示由对象分析器(MLObjectAnalyzer)检测到的对象,对象的属性包括: 1、对象分类(包括:家具、货物、食物、地点、植物、人脸和其他分类)。 2、对象边界框,表示图片中的对象位置。 3、对象ID,用整数表示,视频流模式下,每个被检测到的对象都会有一个ID,图片模式下,此ID为空。 4、检测结果置信度,取值0.0-1.0,越大越可信,当对象被归类为其他分类(TYPE_OTHER)时,该属性为空。 |
| Type | Name | Desc |
| int | TYPE_OTHER | 对象分类0:其他分类 |
| int | TYPE_GOODS | 对象分类1:货物 |
| int | TYPE_FOOD | 对象分类2:食物 |
| int | TYPE_FURNITURE | 对象分类3:家具 |
| int | TYPE_PLANT | 对象分类4:植物 |
| int | TYPE_PLACE | 对象分类5:地点 |
| int | TYPE_FACE | 对象分类6:人脸 |
| Return type | Method name |
| android.graphics.Rect | getBorder() |
| Integer | getTracingIdentity() |
| int | getTypeIdentity() |
| Float | getTypePossibility() |
| void | setBorder(android.graphics.Rect border) |
| void | setTracingIdentity(Integer tracingIdentity) |
| void | setTypeIdentity(int type) |
| void | setTypePossibility(Float possibility) |
| Constant |
| public static final int TYPE_OTHER |
| 对象分类0:其他分类。 |
| Constant Value: 0。 |
| Constant |
| public static final int TYPE_GOODS |
| 对象分类1:货物。 |
| Constant Value: 1。 |
| Constant |
| public static final int TYPE_FOOD |
| 对象分类2:食物。 |
| Constant Value: 2。 |
| Constant |
| public static final int TYPE_FURNITURE |
| 对象分类3:家具。 |
| Constant Value: 3。 |
| Constant |
| public static final int TYPE_PLANT |
| 对象分类4:植物。 |
| Constant Value: 4。 |
| Constant |
| public static final int TYPE_PLACE |
| 对象分类5:地点。 |
| Constant Value: 5。 |
| Constant |
| public static final int TYPE_FACE |
| 对象分类6:人脸。 |
| Constant Value: 6。 |
| Method |
| public android.graphics.Rect getBorder() |
| 获取对象轴对齐矩形边界框。 |
Return
| Type | desc |
| android.graphics.Rect | 返回对象轴对齐矩形边界框。 |
| Method |
| public Integer getTracingIdentity() |
| 获取对象ID。 |
Return
| Type | desc |
| Integer | 返回对象ID,用整数表示,在MLObjectSetting.TYPE_PICTURE模式下为空。 |
| Method |
| public int getTypeIdentity() |
| 获取对象分类结果。 |
Return
| Type | desc |
| int | 返回对象分类结果: 0:TYPE_OTHER 表示其他分类 1:TYPE_GOODS 表示货物 2:TYPE_FOOD 表示食物 3:TYPE_FURNITURE 表示家具 4:TYPE_PLACE 表示地点 5:TYPE_PLANT 表示植物 6:TYPE_FACE 表示人脸 |
| Method |
| public Float getTypePossibility() |
| 获取对象检测置信度。 |
Return
| Type | Desc |
| Float | 返回对象检测置信度,取值0.0-1.0,越大结果越可信,当对象被归类为其他分类时,该属性为空。 |
| Method |
| public void setBorder(android.graphics.Rect border) |
| 设置对象轴对齐矩形边界框。 |
Parameters
| Parameter name | Parameter desc |
| border | Rect类型变量。 |
| Method |
| public void setTracingIdentity(Integer tracingIdentity) |
| 设置对象的追踪ID,视频流模式下,每个被检测到的对象都会有一个ID,图片模式下,此ID为空。 |
Parameters
| Parameter name | Parameter desc |
| tracingIdentity | 整数型变量,取值范围:0-2147483648。 |
| Method |
| public void setTypeIdentity(int type) |
| 设置对象分类。 |
Parameters
| Parameter name | Parameter desc |
| type | 可设置值为: 0:TYPE_OTHER 表示其他分类 1:TYPE_GOODS,表示货物 2:TYPE_FOOD,表示食物 3:TYPE_FURNITURE,表示家具 4:TYPE_PLACE,表示地点 5:TYPE_PLANT,表示植物 6:TYPE_FACE 表示人脸 |
| Method |
| public void setTypePossibility(Float possibility) |
| 设置检测结果置信度。 |
Parameters
| Parameter name | Parameter desc |
| possibility | 浮点型变量,取值范围0.0-1.0,数值越大表示结果越可信。 |