Depth Units ambiguity
Hello,
I'm pushing the limits of the D415 with my application and I'm leveraging everything I can to improve depth accuracy in the 400-750mm range.
I'm trying to change my code to use small depth units as recommended in Intels depth quality white paper however my application is not working correctly when I switch depth units and apply a scale. I think it's because it's not always clear when to apply a new scale.
For example in the RealSense Viewer the default depth unit is 1000, and API world values are in metres.
So what happens when the depth unit is 100? are APIs returning meters or 10x metres or 1/10 metres?
So what happens when the depth unit is 10000? are APIs returning meters or 10x metres or 1/10 metres?
When I use the Python API in my application to modify the depth units, 100,1000,10000 are invalid, I need to use 0.01, 0.001, 0.0001
Can someone please explain how to properly use depth units, ideally with a small code example with an emphasis on when the API values should be scaled and when they should not?
I'm primarily using data from a point cloud and also doing a lot of 3D->2D->3D mapping with the depth and colour images.
Thank you!
-
Thanks Alexandra,
I've done this in Python:
self.depth_sensor.set_option(rs.option.depth_units, 0.0001)
My question is, how does this affect other APIs, for example if I call depth_frame.get_distance() do I still get metres in return? or 1/10 of a meter? Where does changing the depth unit affect values? When I change the depth_unit my code no longer works, and its not fixed by a simple scale factor either. Does that make sense?
-
Hello Keith,
Changing the depth units automatically changes the "raw" depth data so that the `Depth_unit` X 'Raw depth raw Value' remains unchanged, i.e the value of depth_frame.get_distance(i,j) will remain approximately the same . It is the depth resolution and precision that get affected.
As a sequence changing the depth units shall transparent to the other parts of the user's code, unless there code make (incorrect) assumptions regarding the depth units.
Remember that raw depth is an unsigned 16-bit unit-less value that shall be interpreted only in conjunction with the actual `Depth_units` value.
Note that in changing the depth units also modifies the sensor's dynamic range:
- With default depth units (0.001m) the "theoretical" max distance is 0.001 * 2^16 ~=64m
-Changing the depth units to 100μm (0.0001m) allows for the max measured range ~6.4m
Please sign in to leave a comment.
Comments
4 comments