擴增臉孔
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
擴增臉孔功能可讓應用程式自動識別偵測到的臉孔的不同區域,並使用這些區域來重疊紋理 (例如紋理和模型),使其與個別臉孔的輪廓和區域相符。
擴增臉孔如何運作?
8mentedFaces 範例應用程式會使用模型資產和紋理,將狐狸的臉部特徵重疊在使用者的臉孔上。
![]()
3D 模型包含兩個狐狸耳朵和狐狸。每個「獨立」可以各自移動,以便跟隨其附加的臉部區域:
![]()
紋理包含眼影、雀斑和其他著色:
![]()
執行範例應用程式時,系統會呼叫 API 偵測臉部,並在紋理上重疊紋理和模型。
識別擴增臉部網格
為了在偵測到的臉孔上正確重疊紋理和 3D 模型,ARCore 提供偵測到的區域和擴增臉部網格。此網格是臉孔的虛擬表示法,由頂點、臉部區域和使用者頭部的中心組成。請注意,網格的方向是否與 Sceneform 不同。
![]()
當相機偵測到使用者的臉孔時,ARCore 會執行這些步驟來產生擴增臉部網格,以及中心和區域的姿勢:
用於辨識「置中姿」和「臉部網格」。
- 中間的姿勢位於鼻子後方,是使用者頭部的實體中心點 (也就是尖端)。
![]()
- 臉部網格是由數百個頂點組成,這些頂點組成中心點,並根據相對姿勢定義。
![]()
AugmentedFace
類別會使用臉孔網格和中心姿勢來識別使用者臉孔中的臉孔區域姿勢。這些區域如下:
- 左側前景 (
LEFT_FOREHEAD
)
- 右前方 (
RIGHT_FOREHEAD
)
- 鼻子的訣竅 (
NOSE_TIP
)
這些元素 (中心姿勢、臉部網格和臉孔區域姿勢) 包含擴增的臉部網格,並由 AugmentedFace
API 做為用來放置資產的位置和區域。
後續步驟
開始在您的應用程式中使用擴增臉孔。相關詳情請參閱:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2022-09-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2022-09-26 (世界標準時間)。"],[],["Augmented Faces utilizes ARCore to detect a user's face and overlay digital assets. ARCore identifies the face's center pose and generates a face mesh composed of vertices. Using this mesh and center pose, the system determines region poses, such as the left and right forehead, and the nose tip. These elements help position assets like textures (eye shadow, freckles) and 3D models (fox ears, nose) onto the face, allowing the system to move these elements with the face, resulting in a proper fit.\n"]]