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

How to calculate the distance to object with orbbec astra camera

asked 2019-03-24 04:39:41 -0500

Yehor gravatar image

Hello, I am using orbbec Astra camera in order to get the distance to the already detected object. I have detected the object by using OpenCV and /brg/image_raw topic from Astra camera. Now I want to estimate the distance to the object by using depth in order to send command (move forward or stay) to the robot. I am tracking that object. Could someone help me with that, or where I can find the material about distance estimation with orbbec camera.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-25 14:55:05 -0500

updated 2019-03-25 14:55:20 -0500

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.

edit flag offensive delete link more


How to check the depth values? Do you mean to check the value of the pixel?

Yehor gravatar image Yehor  ( 2019-03-27 06:39:13 -0500 )edit

and what is TF?

Yehor gravatar image Yehor  ( 2019-03-27 06:40:01 -0500 )edit

Question Tools

1 follower


Asked: 2019-03-24 04:39:41 -0500

Seen: 797 times

Last updated: Mar 25 '19