ActiveVisionLab / nope-nerf

(CVPR 2023) NoPe-NeRF: Optimising Neural Radiance Field with No Pose Prior
https://nope-nerf.active.vision/
MIT License
372 stars 30 forks source link

Fixing writing depth image bug after generating depth data with DPT #10

Closed yangjiheng closed 1 year ago

yangjiheng commented 1 year ago

During processing my own dataset with preprocess script, the original script always fails at writing depth image, reporting "cannot write mote F as PNG" from imageio.imwrite function. Turns out depth image is a float array generated from DPT, and can not be directly wrote to png file.

Also the depth image is not normalized, if directly converting to uint8, the depth image will have very low contrast.

Upon the above error, the pre-processing is broken due to exception and resulting depth image is not correctly generated. Therefore proposing two changes:

  1. Change depth image data to uint8 format for png writing
  2. Renormalizing depth image data to range 0-255 for high contrast.