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設置后饼灿,人臉跟蹤配置會將檢測到的人臉作為光線探測器,并提供方向或環(huán)境光照的估計值(ARDirectionalLightEstimate對象)帝美。
注意
臉部追蹤為您的應用提供個人臉部信息碍彭。如果您使用ARKit人臉追蹤功能,您的應用必須包含一項隱私政策悼潭,向用戶介紹您打算如何使用人臉追蹤和人臉數據庇忌。有關詳細信息,請參閱Apple開發(fā)人員計劃許可協(xié)議舰褪。
? ? ? ? ? ? ? ? ? ? ? ? ?Creating a Configuration
-?init
Creates a new face tracking configuration.
創(chuàng)建一個新的臉部跟蹤配置皆疹。