Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Theo dõi chuyển độ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.
Trong Android 9, các thiết bị máy ảnh có thể quảng cáo khả năng theo dõi chuyển động.
Những máy ảnh hỗ trợ tính năng này không tự tạo dữ liệu theo dõi chuyển động, mà được ARCore hoặc thuật toán ổn định hình ảnh sử dụng cùng với các cảm biến khác để phân tích cảnh. Để hỗ trợ tính năng này, thiết bị phải hỗ trợ CONTROL_CAPTURE_INTENT_MOTION_TRACKING
.
Nếu ý định này là một phần của yêu cầu chụp, thì máy ảnh phải giới hạn thời gian phơi sáng ở mức tối đa là 20 mili giây để giảm hiện tượng mờ khi chuyển động.
Ví dụ và nguồn
Bạn có thể triển khai tính năng theo dõi chuyển động tham chiếu ở phía HAL trong Camera HAL.
Triển khai
Để bật tính năng theo dõi chuyển động trên thiết bị máy ảnh, hãy đảm bảo:
Xác nhận kết quả
Các thiết bị máy ảnh hỗ trợ tính năng theo dõi chuyển động phải vượt qua các bài kiểm thử CTS của máy ảnh.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# Motion tracking\n\nIn Android 9, camera devices can advertise\n[motion tracking capability](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING).\nCameras that support this feature don't produce motion tracking data itself,\nbut instead are used by ARCore or an image-stabilization algorithm along with\nother sensors for scene analysis. To support this feature, devices must support\n[`CONTROL_CAPTURE_INTENT_MOTION_TRACKING`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_CAPTURE_INTENT_MOTION_TRACKING).\nIf this intent is part of the capture request, the camera must limit the\nexposure time to a maximum of 20 milliseconds to reduce motion blur.\n\nExamples and source\n-------------------\n\nA reference motion tracking implementation on the HAL side is available as part\nof the\n[Camera HAL](https://android.googlesource.com/platform/hardware/qcom/camera/+/android16-release/msm8998/QCamera2/HAL3/QCamera3HWI.cpp).\n\nImplementation\n--------------\n\nTo enable motion tracking on a camera device, make sure:\n\n- The [`ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING`](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/camera/metadata/3.3/types.hal#230) capability is enabled.\n- The [`ANDROID_CONTROL_CAPTURE_INTENT_MOTION_TRACKING`](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/camera/metadata/3.3/types.hal#206) intent is supported and when included in a capture request limits the camera exposure time to a maximum of 20 milliseconds.\n- Lens calibration data from the following list is accurately reported in the\n static information and dynamic metadata fields:\n\n - [`ANDROID_LENS_POSE_ROTATION`](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/camera/metadata/3.2/types.hal#747)\n - [`ANDROID_LENS_POSE_TRANSLATION`](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/camera/metadata/3.2/types.hal#753)\n - [`ANDROID_LENS_INTRINSIC_CALIBRATION`](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/camera/metadata/3.2/types.hal#773)\n - [`ANDROID_LENS_RADIAL_DISTORTION`](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/camera/metadata/3.2/types.hal#780)\n - [`ANDROID_LENS_POSE_REFERENCE`](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/camera/metadata/3.3/types.hal#78)\n\nValidation\n----------\n\nCamera devices supporting the motion tracking feature must pass the\n[camera CTS tests](/docs/compatibility/cts/camera-hal#cts_tests)."]]