Software Archive
Read-only legacy content
17061 Discussions

Intel Depth

agund4
Novice
904 Views

Hi all,

I want to know the distance of 22 points from real sense camera.

Is it possible?

0 Kudos
5 Replies
Ariska_Hidayat
Beginner
904 Views

 

Hi,

Maybe this can to help.

0 Kudos
agund4
Novice
904 Views

Ariska,

 

Thankyoo. But i need the code. I want to know at how much distance my hand is placed.

0 Kudos
PKusm
New Contributor I
904 Views

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

 

0 Kudos
jb455
Valued Contributor II
904 Views

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!

0 Kudos
samontab
Valued Contributor II
904 Views

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

0 Kudos
Reply