sample_depth_estimation 示例应用使用 ROS 2 节点从 RGB 图像估计每像素深度图。它使用 Qualcomm® AI Engine Direct SDK (QNN) 进行设备端模型推理。
sample_depth_estimation 接受一张名为 input_image.jpg 的 RGB 图像作为输入,或订阅来自 qrb_ros_camera 节点的 /sample_container/cam0_stream1 topic。它将深度估计结果作为每像素深度图发布到 /sample_container/depth_map topic。
注意
- 有关更多信息,请参见 sample_depth_estimation GitHub 仓库。
- 此模型来自 Depth Anything V2,其中深度指的是从摄像头到图像中每个点的距离,使用深度卷积神经网络估计。
图:sample_depth_estimat 的示例效果
sample_depth_estimation 的流水线流程
图:sample_depth_estimation 的流水线流程
sample_depth_estimation 流水线中使用的 ROS 节点
sample_depth_estimation 流水线中使用的 ROS topic
| ROS topic | 类型 | 说明 |
|---|---|---|
/image_raw | sensor_msgs.msg.Image | 发布的图像信息,来自 image_publisher。以绝对名称订阅,因此不带命名空间。 |
/sample_container/cam0_stream1 | sensor_msgs.msg.Image | 摄像头图像流,来自 qrb_ros_camera。 |
/sample_container/qrb_inference_input_tensor | qrb_ros_tensor_list_msgs.msg.TensorList | 预处理消息。 |
/sample_container/qrb_inference_output_tensor | qrb_ros_tensor_list_msgs.msg.TensorList | 后处理消息。 |
/sample_container/depth_map | sensor_msgs.msg.Image | 包含以颜色图表示的每像素深度值。 |
注意launch 文件将所有节点放置于
sample_container 命名空间下,因此该示例的 topic 都以 /sample_container/ 为前缀。只有 /image_raw 以绝对名称订阅,因此保持全局。前提条件
你已完成 设置运行示例应用的环境 中的以下设置。- 设置设备
- 设置主机 docker
开箱即用运行 sample_depth_estimation
构建并运行 sample_depth_estimation
以下步骤以 Dragonwing IQ-9075 Evaluation Kit 为例构建 sample_depth_estimation 包。
试一试
试一试
1
在主机计算机上构建并打包
- 构建示例应用项目。
SSH Session
- 打包并将示例应用推送到设备。
SSH Session
2
在开发套件上安装并运行
- 安装示例应用。
SSH Session
- 按照 开箱即用运行 sample_depth_estimation 中的步骤运行示例应用。

