Best practices for saving depth or disparity images

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; …)

straight up floats, where 1.0 is one pixel, in a TIFF that carries fp32 samples.

that’s plenty.

a maximum disparity is hardly a real limitation. a maximum disparity represents maximum “crosseyedness”, i.e. short distances. nothing happens that close by. in practice, the field of view limits you already.

1 Like