Skip to main content
The sample_depth_estimation sample application estimates per-pixel depth maps from RGB images using ROS 2 nodes. It uses the Qualcommยฎ AI Engine Direct SDK (QNN) for on-device model inference. sample_depth_estimation accepts an RGB image named input_image.jpg as input or subscribes to the /sample_container/cam0_stream1 topic from the qrb_ros_camera node. It publishes the depth estimation results as a per-pixel depth map to the /sample_container/depth_map topic.
Note
  • For more information, see the sample_depth_estimation GitHub repository.
  • This model comes from Depth Anything V2, in which depth refers to the distance from the camera to each point in the image, estimated using a deep convolutional neural network.

Figure: Sample effects of sample_depth_estimat

Pipeline flow for sample_depth_estimation

Figure: Pipeline flow for sample_depth_estimation

ROS nodes used in the sample_depth_estimation pipeline

ROS topics used in the sample_depth_estimation pipeline

ROS TopicTypeDescription
/image_rawsensor_msgs.msg.ImagePublished image information, from image_publisher. Subscribed with an absolute name, so it is not namespaced.
/sample_container/cam0_stream1sensor_msgs.msg.ImageCamera image stream, from qrb_ros_camera.
/sample_container/qrb_inference_input_tensorqrb_ros_tensor_list_msgs.msg.TensorListPreprocess message.
/sample_container/qrb_inference_output_tensorqrb_ros_tensor_list_msgs.msg.TensorListPostprocess message.
/sample_container/depth_mapsensor_msgs.msg.ImageContains per-pixel depth values as a color map.
NoteThe launch files put every node in the sample_container namespace, so the sampleโ€™s topics are prefixed with /sample_container/. Only /image_raw is subscribed with an absolute name and therefore stays global.

Prerequisites

You have completed the following settings in Set up the environment for running sample applications.
  • Set up the device
  • Set up the host docker

Run out-of-the-box sample_depth_estimation

1

Run the sample on the development kit

SSH Session
2

View the depth estimation result on the host computer

  1. Start a terminal and run the following command to check the depth estimation result.
    SSH Session
  2. Start the rqt to view the depth estimation result on the host docker, for more information, see rqt.
    SSH Session
  3. Select the following buttons in sequence. Plugins โ€”> Visualization โ€”> Image View
  4. Select topic /sample_container/depth_map by manual on rqt gui, then picture show on rqt successfully.

Build and run sample_depth_estimation

The following steps build the sample_depth_estimation package using Dragonwing IQ-9075 Evaluation Kit as an example.
1

Build and package on the host computer

  1. Build the sample application project.
    SSH Session
  2. Package and push the sample application to the device.
    SSH Session
2

Install and run on the development kit

  1. Install the sample application.
    SSH Session
  2. Run the sample application with the steps in Run out-of-the-box sample_depth_estimation.