A configuration that tracks the movement and expressions of the user’s face with the TrueDepth camera.
使用TrueDepth相机跟踪用户脸部的移动和表情的配置。
Overview
A face tracking configuration detects the user’s face in view of the device’s front-facing camera. When running this configuration, an AR session detects the user's face (if visible in the front-facing camera image) and adds to its list of anchors an ARFaceAnchor object representing the face. Each face anchor provides information about the face’s position and orientation, its topology, and features that describe facial expressions.
Important
Face tracking is available only on iOS devices with a front-facing TrueDepth camera (see iOS Device Compatibility Reference). Use the ARFaceTrackingConfiguration isSupported property to determine whether face tracking is available on the current device before offering the user any features that require face tracking.
The ARFaceTrackingConfiguration class provides no methods or properties, but supports all properties inherited from its superclass ARConfiguration. Additionally, when you enable the lightEstimationEnabled setting, a face tracking configuration uses the detected face as a light probe and provides an estimate of directional or environmental lighting (an ARDirectionalLightEstimate object).
Note
Face tracking provides your app with personal facial information. If you use ARKit face tracking features, your app must include a privacy policy describing to users how you intend to use face tracking and face data. For details, see the Apple Developer Program License Agreement.
鉴于设备的前置摄像头,脸部跟踪配置会检测用户的脸部。运行此配置时,AR Session会检测用户的脸部(如果在前置摄像头图像中可见),并将锚点列表添加到表示脸部的ARFaceAnchor对象。每个脸部定位点提供有关脸部位置和方向的信息,其拓扑结构以及描述脸部表情的功能。
重要
脸部追踪仅适用于带前置TrueDepth相机的iOS设备(请参阅iOS设备兼容性参考)。在向用户提供任何需要脸部追踪的功能之前,使用ARFaceTrackingConfiguration isSupported属性确定当前设备上的脸部追踪是否可用。
ARFaceTrackingConfiguration类不提供方法或属性,但支持从其超类ARConfiguration继承的所有属性。此外,启用lightEstimationEnabled设置后,人脸跟踪配置会将检测到的人脸作为光线探测器,并提供方向或环境光照的估计值(ARDirectionalLightEstimate对象)。
注意
脸部追踪为您的应用提供个人脸部信息。如果您使用ARKit人脸追踪功能,您的应用必须包含一项隐私政策,向用户介绍您打算如何使用人脸追踪和人脸数据。有关详细信息,请参阅Apple开发人员计划许可协议。
Creating a Configuration
- init
Creates a new face tracking configuration.
创建一个新的脸部跟踪配置。