- Sceneform SDK cho Android có nguồn mở và được lưu trữ (github.com/google-ar/sceneform-android-sdk) với phiên bản 1.16.0.
- Trang web này (developers.google.com/sceneform) đóng vai trò là kho lưu trữ tài liệu cho phiên bản trước, Sceneform SDK for Android 1.15.0.
- Không sử dụng phiên bản 1.17.0 của Cấu phần phần mềm Maven của Sceneform.
- Có thể sử dụng các cấu phần phần mềm Maven 1.17.1. Tuy nhiên, khác với phiên bản, các cấu phần phần mềm 1.17.1 giống với các cấu phần phần mềm 1.15.0.
Khuôn mặt tăng cường
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tính năng Khuôn mặt tăng cường cho phép ứng dụng của bạn tự động xác định các vùng khác nhau của khuôn mặt được phát hiện và sử dụng các vùng đó để phủ các thành phần như kết cấu và mẫu theo cách phù hợp với các đường nét và vùng của từng khuôn mặt.
Tính năng Khuôn mặt tăng cường hoạt động như thế nào?
Ứng dụng mẫu AugmentedFaces phủ các đặc điểm trên khuôn mặt của một con cáo lên khuôn mặt của người dùng bằng cách sử dụng cả hai thành phần của mô hình và kết cấu.
![]()
Mô hình 3D bao gồm hai tai cáo và mũi cáo. Mỗi cột là một cột riêng, có thể được di chuyển riêng để đi theo vùng khuôn mặt gắn vào:
![]()
Kết cấu bao gồm bóng mắt, tàn nhang và các màu khác:
![]()
Khi bạn chạy ứng dụng mẫu, ứng dụng này sẽ gọi các API để phát hiện khuôn mặt và phủ cả kết cấu lẫn mô hình lên mặt.
Xác định lưới mặt tăng cường
Để phủ các hoạ tiết và mô hình 3D đúng cách trên khuôn mặt được phát hiện, ARCore cung cấp các khu vực được phát hiện và lưới mặt tăng cường. Lưới này là đại diện ảo của khuôn mặt, bao gồm các đỉnh, vùng mặt và phần giữa đầu của người dùng. Lưu ý rằng hướng của lưới khác với Cảnh.
![]()
Khi camera phát hiện khuôn mặt của người dùng, ARCore thực hiện các bước sau để tạo lưới khuôn mặt tăng cường, cũng như các tư thế căn giữa và vùng:
Đoạn mã này xác định tư thế trung tâm và lưới mặt.
- Tư thế trung tâm, nằm sau mũi, là điểm trung tâm thể chất của đầu người dùng (nói cách khác, bên trong hộp sọ).
![]()
- Lưới mặt bao gồm hàng trăm đỉnh tạo nên khuôn mặt, và được xác định tương ứng với tư thế ở giữa.
![]()
Lớp AugmentedFace
sử dụng lưới khuôn mặt và tư thế khuôn mặt để xác định các tư thế vùng mặt trên khuôn mặt của người dùng. Các vùng này là:
- Trán bên trái (
LEFT_FOREHEAD
)
- Trán phải (
RIGHT_FOREHEAD
)
- Đầu mũi (
NOSE_TIP
)
Các thành phần này – tư thế trung tâm, lưới khuôn mặt và tư thế khuôn mặt – bao gồm lưới khuôn mặt tăng cường và được API AugmentedFace
sử dụng làm vị trí và điểm đặt để đặt tài sản trong ứng dụng.
Các bước tiếp theo
Bắt đầu sử dụng tính năng Khuôn mặt tăng cường trong các ứng dụng riêng. Để tìm hiểu thêm, hãy xem bài viết:
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2022-09-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2022-09-26 UTC."],[[["\u003cp\u003eAugmented Faces automatically identifies face regions to overlay assets like textures and models, realistically conforming to individual faces.\u003c/p\u003e\n"],["\u003cp\u003eIt utilizes a 3D model with movable bones (e.g., ears, nose) and a texture for features like eye shadow, freckles, etc., to augment the user's face.\u003c/p\u003e\n"],["\u003cp\u003eARCore provides an augmented face mesh, consisting of vertices, facial regions, and the head's center, for precise overlay placement.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves detecting the center pose, creating a face mesh, and identifying face region poses (forehead, nose tip) for asset positioning.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage Augmented Faces by creating specific assets and using the Sceneform developer guide for implementation.\u003c/p\u003e\n"]]],["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"],null,["# Augmented Faces allows your app to automatically identify different\nregions of a detected face, and use those regions to overlay assets such as\ntextures and models in a way that properly matches the contours and regions of\nan individual face.\n\nHow does Augmented Faces work?\n------------------------------\n\nThe [**AugmentedFaces**](//github.com/google-ar/sceneform-android-sdk/tree/v1.15.0/samples/augmentedfaces) sample\napp overlays the facial features of a fox onto a user's face using both the\nassets of a model and a texture.\n\nThe 3D model consists of two fox ears and a fox nose. Each is a separate [bone](//en.wikipedia.org/wiki/Skeletal_animation)\nthat can be moved individually to follow the facial region they are attached to:\n\nThe texture consists of eye shadow, freckles, and other coloring:\n\nWhen you run the sample app, it calls APIs to detect a face and overlays both the texture and the models onto the face.\n\nIdentifying an augmented face mesh\n----------------------------------\n\nIn order to properly overlay textures and 3D models on a detected face, ARCore\nprovides detected regions and an *augmented face mesh* . This mesh\nis a virtual representation of the face, and consists of the vertices, facial\nregions, and the center of the user's head. Note that the\n[orientation](/sceneform/develop/augmented-faces/developer-guide#face_mesh_orientation)\nof the mesh is different for Sceneform.\n\nWhen a user's face is detected by the camera, ARCore performs these steps to\ngenerate the augmented face mesh, as well as center and region poses:\n\n1. It identifies the *center pose* and a *face mesh*.\n\n - The center pose, located behind the nose, is the physical center point of the user's head (in other words, inside the skull).\n\n - The face mesh consists of hundreds of vertices that make up the face, and is defined relative to the center pose. \n\n2. The `AugmentedFace` class uses the face mesh and center pose to identify\n *face region poses* on the user's face. These regions are:\n\n - Left forehead (`LEFT_FOREHEAD`)\n - Right forehead (`RIGHT_FOREHEAD`)\n - Tip of the nose (`NOSE_TIP`)\n\nThese elements -- the center pose, face mesh, and face region poses -- comprise\nthe augmented face mesh and are used by `AugmentedFace` APIs as positioning\npoints and regions to place the assets in your app.\n\nNext steps\n----------\n\nStart using Augmented Faces in your own apps. To learn more, see:\n\n- [Creating assets for Augmented Faces](/sceneform/develop/augmented-faces/creating-assets)\n\n- [Augmented Faces developer guide for Sceneform](/sceneform/develop/augmented-faces/developer-guide)"]]