智能客服
你问我答,随时在线为你解决问题

























此版本文档已归档不再维护,推荐您使用最新版本。
| class info |
| com.huawei.hms.mlsdk.face.MLFace |
| 表示由人脸分析器(MLFaceAnalyzer)检测到的人脸。人脸的属性包括宽高、旋转度、是否睁眼、是否微笑、人脸关键点和轮廓等。 |
| Type | Name | Desc |
| float | UNANALYZED_POSSIBILITY | 睁眼、年龄等表情和特征可能性的默认值。 在MLFaceAnalyzerSetting.TYPE_UNSUPPORT_FEATURESYS模式下, 所有表情和特征的可能性值都为该默认值。 |
| Return type | Method name |
| List<MLPosition> | getAllPoints() |
| android.graphics.Rect | getBorder() |
| android.graphics.PointF | getCoordinatePoint() |
| MLFaceEmotion | getEmotions() |
| MLFaceKeyPoint | getFaceKeyPoint(int keyPointType) |
| List<MLFaceKeyPoint> | getFaceKeyPoints() |
| MLFaceShape | getFaceShape(int shapeType) |
| List<MLFaceShape> | getFaceShapeList() |
| MLFaceFeature | getFeatures() |
| float | getHeight() |
| float | getRotationAngleX() |
| float | getRotationAngleY() |
| float | getRotationAngleZ() |
| int | getTracingIdentity() |
| float | getWidth() |
| String | toString() |
| Constant |
| public static final float UNANALYZED_POSSIBILITY |
| 睁眼、年龄等表情和特征可能性的默认值。在MLFaceAnalyzerSetting.TYPE_UNSUPPORT_FEATURES模式下,所有表情和特征的可能性值都为该默认值。 |
| Constant Value: -1.0f |
| Method |
| public List<MLPosition> getAllPoints() |
| 获取人脸完整轮廓点集合,包含855个位置点。 |
Return
| Type | desc |
| List<MLPosition> | 返回人脸完整关键点集合。 |
| Method |
| public android.graphics.Rect getBorder() |
| 获取人脸的轴对齐矩形边界框。 |
Return
| Type | desc |
| android.graphics.Rect | 返回Rect类的实例。 |
| Method |
| public android.graphics.PointF getCoordinatePoint() |
| 获取人脸的轴对齐矩形边界框左上角位置。 |
Return
| Type | desc |
| android.graphics.PointF | 返回人脸的轴对齐矩形边界框左上角位置。 |
| Method |
| public MLFaceEmotion getEmotions() |
| 获取人脸全部表情。 |
Return
| Type | desc |
| MLFaceEmotion | 返回MLFaceEmotion的实例。 |
| Method |
| public MLFaceKeyPoint getFaceKeyPoint(int keyPointType) |
| 通过人脸关键点类型获取人脸关键点,如果传入的类型无效,则返回null。 |
Parameters
| Parameter name | Parameter desc |
| keyPointType | 人脸关键点类型,具体请参考MLFaceKeyPoint中定义的类型。 |
Return
| Type | desc |
| MLFaceKeyPoint | 返回MLFaceKeyPoint的实例。 |
| Method |
| public List<MLFaceKeyPoint> getFaceKeyPoints() |
| 获取人脸全部12个关键点。 |
Return
| Type | desc |
| List<MLFaceKeyPoint> | 返回人脸全部12个关键点,具体请参考MLFaceKeyPoint中定义的关键点类型。 |
| Method |
| public MLFaceShape getFaceShape(int shapeType) |
| 通过轮廓类型获取人脸轮廓。 |
Parameters
| Parameter name | Parameter desc |
| shapeType | 轮廓类型,具体请参考MLFaceShape中定义的类型。 |
Return
| Type | desc |
| MLFaceShape | 返回MLFaceShape类的实例。 |
| Method |
| public List<MLFaceShape> getFaceShapeList() |
| 获取人脸的全部14种关键轮廓。 |
Return
| Type | desc |
| List<MLFaceShape> | 返回人脸全部14种关键轮廓型,具体请参考MLFaceShape中定义的轮廓类型。 |
| Method |
| public MLFaceFeature getFeatures() |
| 获取人脸全部特征,具体特征信息参考MLFaceFeature。 |
Return
| Type | desc |
| MLFaceFeature | 返回MLFaceFeature的实例。 |
| Method |
| public float getHeight() |
| 获取人脸高度。 |
Return
| Type | desc |
| float | 返回人脸高度。 |
| Method |
| public float getRotationAngleX() |
| 获取人脸俯仰角度。 |
Return
| Type | desc |
| float | 返回人脸俯仰角度,正值表示人脸低头角度,负值表示人脸仰头角度。 |
| Method |
| public float getRotationAngleY() |
| 获取人脸左右旋转角度。 |
Return
| Type | desc |
| float | 返回人脸左右旋转角度,正值表示人脸转向图像的右侧,负值表示人脸转向图像的左侧。 |
| Method |
| public float getRotationAngleZ() |
| 获取图像中人脸在竖直平面的旋转角度。 |
Return
| Type | desc |
| float | 返回图像中人脸在竖直平面的旋转角度。正值表示人脸在图像竖直平面顺时针旋转,负值表示人脸在图像竖直平面逆时针旋转。 |
| Method |
| public int getTracingIdentity() |
| 获取人脸跟踪ID, 即图片中识别到的人脸唯一标识。 |
Return
| Type | desc |
| int | 返回人脸跟踪ID。如果启用了人脸跟踪功能,则在连续帧中同一张人脸的ID相同。 |
| Method |
| public float getWidth() |
| 获取人脸宽度。 |
Return
| Type | desc |
| float | 返回人脸宽度。 |
| Method |
| public String toString() |
| 当前实例转换为字符串。 |
Return
| Type | desc |
| String | 当前实例的字符串。 |
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功