cgm-ml icon indicating copy to clipboard operation
cgm-ml copied to clipboard

Change preprocess shortcoming: interpolation when resizing

Open markus-hinsche opened this issue 3 years ago • 1 comments

During training, we upscale the depthmaps from size (180, 135) to (240, 180).

Depthmaps contain pixels which have a values 0. (zero), where they are invalid. This is an important information for depthmaps.

When upscaling we use tf.image.resize() the scaling algorithm will interpolate values. This works for RGB images.

Problem: This way of upscaling is not suited for depthmaps, because the interpolation between invalid pixels and valid pixels will yield some average, but actually should be invalid.

Without resizing: out_without_resize

With resizing: out_with_resize

Notice how the edges got blurry due to resizing

Ideas for solutions:

  • don't upscale
  • interpolate values: correctly
    • Use scale method before, but than mask (like smoothing)
    • interpolate pixel by pixel: if one of 4 pixels is 0, then the output pixel is 0

Details:

  • Datasets used: anon-depthmap-95k, anon-depthmap-mini

markus-hinsche avatar Aug 05 '21 09:08 markus-hinsche

All eye on #429 👀👀

prajurock avatar Aug 05 '21 12:08 prajurock