Improve depth calculation

Hi, I’m having trouble with my Zed2i and the depth calculation.

For measures from 2 to 5 meters, I range from 5% to 10% depth mistake.
From I assumed the error would be less than 2cm for a ground truth distance of 2meters.

I cannot upload a file, but here is a frame of it.

  • the small red seat is at an expected distance of 3.06m, found depth of 2.94, confidence level 0.89 (small error)
  • the parrot toy is at an expected distance of 4.7m, found depth of 4.65, confidence level 2.52 (good !)
  • a point in the chairback is at an expected distance of 6.82m, found depth of 6.4, confidence level 2.07 (not good)

My acquisition is currently realized with a Zed2i, HD2K, 15fps. I’m using the Zed_explorer software.

Do you have any clue on how to improve my measurements ?


which DEPTH_MODE do you use? Have you tried DEPTH_MODE::NEURAL?
it is the more accurate mode.
You can also increase a bit the depth_stabilization, this will smooth the depth noise and should give better results.

Hi, thanks for your answer.

depth_stabilization changed nothing.

But I’m having trouble with sl.DEPTH_MODE.NEURAL
It just prints
Optimizing neural_depth_1.4 | 0.0%[> ] 4min 10s est. left
Then moves on to the next step.
And the output has nothing but NAN as a depth, and 100.0 as a confidence.

Here is how I initialize my camera.

def initialize_zed(input_path):
    # Create a ZED camera object
    init_parameters = sl.InitParameters()
    init_parameters.depth_mode = sl.DEPTH_MODE.ULTRA
    init_parameters.depth_mode = sl.DEPTH_MODE.NEURAL
    init_parameters.coordinate_units = sl.UNIT.METER
    init_parameters.depth_stabilization = 2  # default 1, the higher, the smoother the depth
    # Open the ZED
    zed = sl.Camera()
    return zed

DEPTH_MODE::NEURAL need to be optimized for your GPU first, as this may take few minutes the best way to do it is with the tool “ZED Diagnostic”, you can run it in commande line with the “–nrlo” option, once it is done, you should be able to run your program.

No luck with that, the progress bar does not move, and in less than 1sec, the command line ends.

I should add I am using

  • Ubuntu 22.04
  • CUDA 11.5 (edit, sorry)

Hello, there is probably something wrong with your cuda or nvidia installation.
Can you :

  • Make sure you use SDK 3.8.2
  • Remove everything from /usr/local/zed/resources
  • Send us the report generated by ZED_Diagnostics
  • Check that nvidia-smi returns something that seems allright

Strange. It tells me I don’t have CUDA 11.7 but nvidia-smi shows it…

Fri Dec 23 17:26:42 2022
| NVIDIA-SMI 515.86.01 Driver Version: 515.86.01 CUDA Version: 11.7 |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
| 0 NVIDIA GeForce … On | 00000000:01:00.0 Off | N/A |
| N/A 45C P0 N/A / N/A | 5MiB / 4096MiB | 0% Default |
| | | N/A |

| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
| 0 N/A N/A 2511 G /usr/lib/xorg/Xorg 4MiB |