ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

There's probably 3 major steps you should consider. 1) You must get that bounding box / segmented pixels / whatever way you detected the object with respect to the depth frame. You can look at TF to get into the depth frame, then project them into the pixel frame of the depth camera. There are tons of great resources to cover this pixel projection work in calibration literature and CV basics. 2) Now that you have your detection in the depth frame, you can then take you bounding box / segmented pixels to find the pixels that belong to you object. If a segmented mask, you can look at the depth values directly. If you have a bounding box, cluster the foreground of object of the depth image using one of a number of clustering techniques, or just use all the values in the box for first order estimate 3) Then take all your pixels you think belong to the object from a segmented mask, or from the bounding box clusters, and average them. That should be a good estimate of distance.

There's probably 3 major steps you should consider. consider.

1) You must get that bounding box / segmented pixels / whatever way you detected the object with respect to the depth frame. You can look at TF to get into the depth frame, then project them into the pixel frame of the depth camera. There are tons of great resources to cover this pixel projection work in calibration literature and CV basics. basics.

2) Now that you have your detection in the depth frame, you can then take you bounding box / segmented pixels to find the pixels that belong to you object. If a segmented mask, you can look at the depth values directly. If you have a bounding box, cluster the foreground of object of the depth image using one of a number of clustering techniques, or just use all the values in the box for first order estimate estimate

3) Then take all your pixels you think belong to the object from a segmented mask, or from the bounding box clusters, and average them. That should be a good estimate of distance. distance.