Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Finding Distance between Depth Camera and User's Face

Majid_N_
Beginner
555 Views

Hi,

 

In my project I have to know the Distance between the Depth Camera and the user's face

Is there any function or sample works that I can use in Unity to find the exact distance? I can measure the distance between the middle of two eye and using it for zoom in/out but I need the exact distance from camera and face.

 

Thanks

Majid

 

0 Kudos
2 Replies
Pubudu-Silva_Intel
555 Views

You can access the Z (depth) information of all pixels 

Refer to PXCFaceData::DetectionData::QueryFaceAverageDepth in the reference manual

0 Kudos
samontab
Valued Contributor II
555 Views

If you are working in the color camera, you can project the depth camera to the color camera, and then just read the depth value at the face location.

Get the depth values projected at the color camera location with this (defined in pxcprojection.h):

PXCImage* PXCAPI CreateDepthImageMappedToColor(PXCImage *depth, PXCImage *color)

0 Kudos
Reply