Items with no label
3335 Discussions

Does anybody know how can I retrieve depth or distance from the Intel RealSense D435?

SWong19
Beginner
2,333 Views

Hi, does anybody know what algorithm is used to retrieve the distance measured from the depth sensor in the Intel RealSense D435? I wish to utilise the depth data, specifically the distance obtained to proceed with my current project. I mean, is there any specific built-in function to get the distance of a specific object or human?

Is there any reference source code in C# that applies to my question? Thanks in advance.

0 Kudos
4 Replies
MartyG
Honored Contributor III
852 Views

In the 400 Series cameras, the depth pixel value is a measurement from the parallel plane of the imagers and not the absolute range

The documentation for the .NET wrapper in SDK 2.0 has a very simple sample 'Hello World' C# script for detecting the depth of an object.

https://github.com/IntelRealSense/librealsense/tree/master/wrappers/csharp librealsense/wrappers/csharp at master · IntelRealSense/librealsense · GitHub

The SDK also has a more complex sample program called 'Measure'. This one is written in C++, though the explanations of the code will help to give a deeper understanding of how SDK 2.0 handles depth calculation.

https://github.com/IntelRealSense/librealsense/tree/master/examples/measure librealsense/examples/measure at master · IntelRealSense/librealsense · GitHub

0 Kudos
PSnip
New Contributor II
852 Views

Hi Marty,

To add to what you already mentioned, I think following might as well work.

For any Pixel in depth Image, we can gets x,y, z co-ordinates for that pixel using function rs2_deproject_pixel_to_point

https://github.com/IntelRealSense/librealsense/blob/5e73f7bb906a3cbec8ae43e888f182cc56c18692/include/librealsense2/rsutil.h# L46 librealsense/rsutil.h at 5e73f7bb906a3cbec8ae43e888f182cc56c18692 · IntelRealSense/librealsense · GitHub

The 3-D co-ordinate which above function returns is a physical point in space w.r.t. camera co-ordinate system. Z value is the actual Depth value. By using x & y values along with Z, one can know the actual distance of that particular point from camera.

0 Kudos
SWong19
Beginner
852 Views

does that mean this is one of the ways for me to retrieve the depth data? thanks

0 Kudos
idata
Employee
852 Views

Hello StevenWong1995,

 

 

We were wondering if the recommendations provided by Marty G and thePaintedSnipe were the solution that you were looking for.

 

Please, let us know if further assistance is required or if we can close this case.

 

 

Best regards.

 

 

Josh B.

 

Intel Customer Support

 

0 Kudos
Reply