Depth image changes from 4.x to 5.x?

Did the depth image format (sl.MEASURE.DEPTH with Camera.retrieve_measure) change between the 4.x and 5.x SDK?

Trying to root cause a problem that we’re having with depth image data looking “suspicious” after an SDK update.

The measure is still distance from camera on z axis right? With 0 at the camera plane?

There have been big changes from v4 to v5.
Can you please add details concerning your doubts so we can understand if it’s expected?

Sure, this cannot change.

1 Like

It’s hard to say, but the values in the depth image seem lower than expected. Due to a severe lack of testing equipment right now I don’t have a 4.x system to compare it to.

At a high level, we have interactive content that is driven by the depth data for depths within a certain range, and all I know right now is the depth data is reportedly not triggering interactions after a 5.x update.

I don’t really have much to go on, sorry, that’s why I didn’t mention any details. What are some of the changes related to depth data that have occurred? Is there a 5.x migration guide somewhere?

Currently we are retrieving depth data and casting the floats to uint16s, in Python, basically like this:

camera.grab(sl.RuntimeParameters())
camera.retrieve_measure(depth, sl.MEASURE.DEPTH)
depth_image = np.nan_to_num(depth.get_data())
depth_image = np.minimum(depth_image, 65535)
depth_image = np.maximum(depth_image, 0)
depth_image = depth_image.astype("uint16")

With the camera initialization parameters being:

        init_params = sl.InitParameters()
        init_params.coordinate_units = sl.UNIT.MILLIMETER
        init_params.depth_mode = sl.DEPTH_MODE.NEURAL
        init_params.coordinate_system = sl.COORDINATE_SYSTEM.LEFT_HANDED_Y_UP
        init_params.depth_minimum_distance = 0.5

This code definitely worked in 4.x. I am unsure if it works in 5.x. Like I said, I have no idea where the problem with our system is right now, I just started to investigate it and have limited resources at the moment. So any hints would be super helpful, if you have any.

Thanks!

So I downgraded my test machine to 4.x and compared the depth data with 5.x, and aside from 4.x having slightly softer edges around objects they appear to be similar enough.

So I don’t think any 4.x to 5.x changes are actually responsible for our issues here.

Would still be interested in a migration guide, however.

Thanks!

There are no big API differences between v4 and v5; that’s why we have not released a migration guide. This blog post contains a few useful information.

The only big difference regards the fact that we progressively removed standard stereo vision depth modes to replace them with AI-based modes.

1 Like

Great, thank you very much!

1 Like