Software Archive
Read-only legacy content
17061 Discussions

Depth Resolution of Real Sense Camera

Michael_S_18
Beginner
919 Views

Greetings,

My name is Michael, and I am currently using Intel Real Sense F200 camera as a measurement device for my research.

Currently I am able to get the depth data and save it as uncompressed .png file and point cloud, but when I look at the data, every point's depth data (z) is an integer.

So, I would like to know what is the depth resolution (how detailed can the z value be; 1mm or 0.1mm, etc.) for Real Sense camera(F200 & R200). If someone from Intel could tell me, I would be very thankful.

Also, I would like to know if there are any method to change the resolution.

I've tried looking at many documentations and forums but couldn't find such information. I also tried using SetDepthUnit() but whatever value I set, the value from GetDepthUnit() doesn't seem to change at all.

Thank You.

0 Kudos
7 Replies
Xusheng_L_Intel
Employee
919 Views

How did you get depth data? If you use PIXEL_FORMAT_DEPTH, The depth map data in 16-bit unsigned integer. The values indicate the distance from an object to the camera's XY plane or the Cartesian depth.The value precision is in millimeters. If you use PIXEL_FORMAT_DEPTH_RAW, then the depth map data in 16-bit unsigned integer. The value precision is device specific. The application can get the device precision via the QueryDepthUnit function. Thanks!

0 Kudos
samontab
Valued Contributor II
919 Views

I haven't checked with real data yet, but I think the three depth formats are created like this:

a) PIXEL_FORMAT_DEPTH_RAW: This is the pixel disparity obtained from the depth estimation algorithm. It is a 16bit unsigned integer number. Each unit here represents a displacement of QueryDepthUnit micrometers (which is a 32 bit floating point number).

b) PIXEL_FORMAT_DEPTH_F32: This is the Cartesian depth per pixel, in mm. It is represented as a 32 bit floating point number. It seems to be the depth value from PIXEL_FORMAT_DEPTH_RAW, multiplied by QueryDepthUnit and divided by 1000 to get distance in mm.

c) PIXEL_FORMAT_DEPTH: This should be the same as PIXEL_FORMAT_DEPTH_F32 but as a 16bit unsigned integer number.

I'm not sure if both b) and c) are calculated directly from a) or if c) is a rounded version of b) for example, so there may be some accuracy differences.

0 Kudos
Michael_S_18
Beginner
919 Views

Dear David & samontab,

Thank you very much for your answers and sorry for my late reply.

I used QueryVertices to directly get the world coordinates for making the point cloud, in which the z values are integer and the point cloud as shown in the image(this is a point cloud of 3 spheres viewed from its side) has digital z values(1 mm ). I guess I shouldn't use QueryVertices to make my point cloud because I want the value to be more analog.

On the other hand, the depth image i saved as uncompressed .png used PIXEL_FORMAT_DEPTH_RAW. Looks like this means that i have to multiply the values in the depth images with the value i get from QueryDepthUnit(in my case it's 31.25) divided by 1000 to get the image in mm unit then.

I haven't tried making my point cloud using the other depth formats and then projecting it into world coordinates but i guess it would result as samontab says.

Anyway, I think my problem is solved.
Thank you so much for the quick and easy-to-understand reply even though it's such a basic question!
If needed, I will update again later after I get my results.

0 Kudos
samontab
Valued Contributor II
919 Views

Michael,

You may get a bit more accuracy if you use the Z value from the depth stream, instead of the Z value from the X, Y, Z projection given from QueryVertices.

For some reason, the QueryVertices method of the SDK rounds the floating point number from the depth stream into an integer.

0 Kudos
Dylan_R_
Beginner
919 Views

Hello everyone, 

I have the same kind of problem, I'm not really good at programming. Can you please give me your complete code ?

Thanks a lot ;)

 

0 Kudos
carlos_manuel_v_
Beginner
919 Views

Samontab

Thanks for the useful information, how do you get a Z value from the depth stream?

 

0 Kudos
jb455
Valued Contributor II
919 Views
Here you go (in C#):
PXCMCapture.Sample photo = pSenseManager.QuerySample();
var depth = photo.depth;
PXCMImage.ImageData data;
var depth.AcquireAccess(PXCMImage.Access.ACCESS_READ, out ddata);
var dwidth = (Int32)depth.info.width;
var dheight = (Int32)depth.info.height;
var dpixels = ddata.ToUShortArray(0, dwidth * dheight);
depth.ReleaseAccess(ddata);

Then to get the depth value for a specific (x,y) pixel you use:
var pixelDepth = dpixels[y*dwidth + x];

0 Kudos
Reply