- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I want to know the distance of 22 points from real sense camera.
Is it possible?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ariska,
Thankyoo. But i need the code. I want to know at how much distance my hand is placed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you are trying to get the distance of your hand just like getting distance of a face using QueryFaceAverageDepth method.
However, I don't think the SDK provides a way to query the average depth of user's hand. #CMIIW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you can get the pixel coordinates of whatever you want to know the distance of (I haven't used the hand tracking module much so don't know how easy this is), you can use the PXCMProjection.MapColorToDepth function to map coordinates in the colour image to the depth image (you may not need this step if a function in the hand tracking module gives you depth coordinates already), then PXCMImage.ImageData.ToUShortArray to get the depth at the points you're interested in.
I originally got the bulk of the code from one of the samples but can't remember which one it was, sorry!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Yes, it is possible.
But you're not saying from which camera those 22 points are from.
If those points are from the Infrared, or the depth stream, then you can get the corresponding 3D points(X, Y, Z) in mm by using the queryvertices function of the RealSense API. You are interested in Z, as that is the distance of that point in space to the camera. Have a look here for more info about this method:
https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/queryvertices_pxcprojection.html
Make sure you allocate the memory for the vertices first though!
If the points are from the color stream, you will need to make sure that they are aligned with the depth stream first, and then proceed in the same way as before. You can create a depth image mapped to the color stream by using this:
https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/createdepthimagemappedtocolor_pxcprojection.html