- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have Intel RealSense Camera F200,Object is placed around 1/2 meter distance from camera.
I am able to get the depth value via using "PIXEL_FORMAT_DEPTH_F32".
CodeSnippet:-
sts = senseMgr.AcquireFrame(true);
if (sts == pxcmStatus.PXCM_STATUS_NO_ERROR)
{
PXCMCapture.Sample sample = senseMgr.QuerySample();
if (sample.depth != null)
{
PXCMImage.ImageData dData = new PXCMImage.ImageData();
sample.depth.AcquireAccess(PXCMImage.Access.ACCESS_READ,PXCMImage.PixelFormat.PIXEL_FORMAT_DEPTH_F32, dData);
if (sts.compareTo(pxcmStatus.PXCM_STATUS_NO_ERROR)<0)
{
System.out.println ("Failed to AcquireAccess of depth image data");
System.exit(3);
}
int dBuff[] = new int[dData.pitches[0]/4 * dHeight];
dData.ToIntArray(0, dBuff);
The values which i am getting is of order 10 example:-"1136884736"
How to relate this value with real world value? As camera is only at a distance of 1/2 meter from the object.
Regards,
Himanshu
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use PIXEL_FORMAT_DEPTH_F32, the depth map data in 32-bit floating point. The value precision is in millimeters. Looks like the value you got is not the right one. Please found our sample C# code @C:\Program Files (x86)\Intel\RSSDK\framework\CSharp\DF_RawStreams.cs. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are converting a float32 to an int. Of course it will come out incorrect. Try reading the values in as floats and when you print to stdout, also make sure the formatting is for %f (so the value is printed as a float not interpreted as an int)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for your prompt reply kyran......we got the code running based on your comment.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
himanshu p. wrote:
thanks for your prompt reply kyran......we got the code running based on your comment.....
Great! Glad I could help. I am new to this forum, and what is funny is I can't even get my SDK to install yet!

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