Best practices for saving depth or disparity images

Micka
Tue, 24 Jun 2025 07:34:52 +0000
Uncategorized

We are collecting disparity maps from different sources. Finally, we want to train depth estimation DNNs with that data.

Are there any best practices of how to save them best?
We could save floating point matrices as cv::FileStorage (or similar formats), but that’s quite big.

Afair, KITTI for example saves depth images quantized to 16 bit png images, clipped to some maximum depth (> 600 m). But we don’t know the depth, only disparity. However we could scale inverse disparity with some constant scaling factor.

If we quanitze disparity directly, we would have to choose a maximum disparity, leading to some minimum representable depth.

Anyways I’m asking myself, whether there might be some smarter scaling, like squared or logarithmic, to preserve higher depth-difference precision in either short or long distance (it feels like small depth differences are more relevant in short distance).

Best would be a way to save so that

good trade-off between data precision and file size

easy ways to work with that data (no need to save separate meta data per image; possibilities to view the data as images; …)

2 posts - 2 participants