- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to use distance(z position), but I dont know how to get distance with x, y, position.
Could you tell me, how to get ?
regards,
shoichi
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi shoichi,
You can use the depth channel to get the XYZ coordinates of each point. You can then just use the Z component or get the norm of that vector to get the distance from the center of the camera to that point in space, depending on what you need.
To get the XYZ coordinates in mm, you can just use QueryVertices from pxcprojection with your depth image:
/** @brief Retrieve the vertices for the specific depth image. The vertices is a PXCPoint3DF32 array of depth size width*height. The world coordiantes units are in mm. @param[in] depth The depth image instance. @param[out] vertices The 3D vertices in World coordinates, to be returned. @return PXC_STATUS_NO_ERROR Successful execution. */ virtual pxcStatus PXCAPI QueryVertices(PXCImage *depth, PXCPoint3DF32 *vertices)=0;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i think globalPosition has x, y, and z coordinate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks :)
samontab wrote:
Hi shoichi,
You can use the depth channel to get the XYZ coordinates of each point. You can then just use the Z component or get the norm of that vector to get the distance from the center of the camera to that point in space, depending on what you need.
To get the XYZ coordinates in mm, you can just use QueryVertices from pxcprojection with your depth image:
/** @brief Retrieve the vertices for the specific depth image. The vertices is a PXCPoint3DF32 array of depth size width*height. The world coordiantes units are in mm. @param[in] depth The depth image instance. @param[out] vertices The 3D vertices in World coordinates, to be returned. @return PXC_STATUS_NO_ERROR Successful execution. */ virtual pxcStatus PXCAPI QueryVertices(PXCImage *depth, PXCPoint3DF32 *vertices)=0;
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page