- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(Developing project using D415, C# and Unity (but not using the unity wrapper))
I'm getting a bit confused about what exactly the GetDistance() function returns...
I have my sensor fixed ~2m high, looking down vertically and I'd like to retrieve height of each pixels compared to the ground. To get there, should I use:
- 2 - depthFrame.GetDistance(x,y)
- 2 - depthFrame[x,y] * depthScale
- depthFrame -> point cloud; 2-Points[x,y].z
- Any of the above
It is not clear in the documentation or within the examples if the GetDistance() function returns the corrected depth of a specified pixel, or the distance to the camera sensors...
Thanks for advice !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is easier to find search results relevant to what you need if you search for 'pixel depth' instead of 'pixel height'.
Example code for getting the pixel depth in meters in the SDK's documentation suggests using get_distance(x,y), though it is the nature of programming that multiple approaches to the problem will be valid, depending on how you prefer to approach the problem.
https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0#depth-image-formats
You may find this C# and Unity coordinates tutorial for the 400 Series cameras useful:
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is easier to find search results relevant to what you need if you search for 'pixel depth' instead of 'pixel height'.
Example code for getting the pixel depth in meters in the SDK's documentation suggests using get_distance(x,y), though it is the nature of programming that multiple approaches to the problem will be valid, depending on how you prefer to approach the problem.
https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0#depth-image-formats
You may find this C# and Unity coordinates tutorial for the 400 Series cameras useful:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks !
Looking at the second link you sent answered my first question: GetDistance(x,y) returns the distance to the camera plane (so the Z coordinate of the reconstructed 3D point) and not the distance to projection center (i.e. magnitude of camera->point vector).

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page