Items with no label
3335 Discussions

Exact depth distance with opencv

idata
Employee
1,910 Views

Hi Guys,

Was finally able to get my hands on the D435 and got to play around with it. I've manage to work around my current background subtraction code with pyrealsense and was able to get the x,y coords of a detected object. Now Im checking how am I able to retrieve the exact depth information in the form of a value in my program? Will inputting the current x,y coords help in any way?

For example, I have the x,y midpoint coords of that bounding box and now I wish to get the depth distance of the x,y midpoints.

0 Kudos
3 Replies
MartyG
Honored Contributor III
536 Views

The developer UnaNancyOwen has a depth program example for OpenCV.

https://github.com/UnaNancyOwen/RealSense2Sample/blob/master/sample/Depth/realsense.cpp RealSense2Sample/realsense.cpp at master · UnaNancyOwen/RealSense2Sample · GitHub

0 Kudos
idata
Employee
536 Views

Hi,

thanks again for the resource. You won't happen to know any examples in python?

0 Kudos
MartyG
Honored Contributor III
536 Views

Intel has published a Python tutorial called distance_to_object.

https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/distance_to_object.ipynb librealsense/distance_to_object.ipynb at jupyter · IntelRealSense/librealsense · GitHub

0 Kudos
Reply