| <html devsite><head> |
| |
| <meta name="book_path" value="/_book.yaml"/> |
| |
| <meta name="project_path" value="/_project.yaml"/> |
| </head> |
| <body> |
| |
| <!-- |
| Copyright 2018 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <h1 id="motion_tracking" class="page-title">运动跟踪</h1> |
| |
| <p>在 Android 9 中,摄像头设备可以支持<a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING">运动跟踪功能</a>。支持此功能的摄像头本身不会生成运动跟踪数据,而是供 ARCore 或图像稳定算法以及其他传感器用于进行场景分析。要支持此功能,设备必须支持 <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_CAPTURE_INTENT_MOTION_TRACKING"><code>CONTROL_CAPTURE_INTENT_MOTION_TRACKING</code></a>。如果该 intent 是捕获请求的一部分,则摄像头必须将曝光时间限制为不超过 20 毫秒,以减少运动模糊。</p> |
| |
| <h2 id="examples_and_source">示例和源代码</h2> |
| |
| <p>HAL 端的参考运动跟踪实现是<a href="https://android.googlesource.com/platform/hardware/qcom/camera/+/master/msm8998/QCamera2/HAL3/QCamera3HWI.cpp">摄像头 HAL</a> 的一部分。</p> |
| |
| <h2 id="implementation">实现</h2> |
| |
| <p>要在摄像头设备上启用运动跟踪功能,请确保:</p> |
| |
| <ul> |
| <li><a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/metadata/"><code>ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING</code></a> 功能处于启用状态。</li> |
| <li><a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/metadata/"><code>ANDROID_CONTROL_CAPTURE_INTENT_MOTION_TRACKING</code></a> intent 受支持,并且当该 intent 包含在捕获请求中时,将摄像头曝光时间限制为不超过 20 毫秒。</li> |
| <li><p>在静态信息和动态元数据字段中准确报告以下列表中的镜头校准数据:</p> |
| |
| <ul> |
| <li><a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/metadata/3.2/types.hal#747"><code>ANDROID_LENS_POSE_ROTATION</code></a></li> |
| <li><a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/metadata/3.2/types.hal#753"><code>ANDROID_LENS_POSE_TRANSLATION</code></a></li> |
| <li><a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/metadata/3.2/types.hal#773"><code>ANDROID_LENS_INTRINSIC_CALIBRATION</code></a></li> |
| <li><a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/metadata/3.2/types.hal#780"><code>ANDROID_LENS_RADIAL_DISTORTION</code></a></li> |
| <li><a href="https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/metadata/"><code>ANDROID_LENS_POSE_REFERENCE</code></a></li> |
| </ul></li> |
| </ul> |
| |
| <h2 id="validation">验证</h2> |
| |
| <p>支持运动跟踪功能的摄像头设备必须通过<a href="/compatibility/cts/camera-hal#cts_tests">摄像头 CTS 测试</a>。</p> |
| |
| </body></html> |