79611668

Date: 2025-05-08 03:14:31
Score: 2.5
Natty:
Report link

HAHA, I solved this problem. I created an environment and compared it by saving the depth in png and exr formats. The depth map in png format is completely nonlinear compared to the actual depth, while the exr format is the opposite.

scene

depth map

png format depth map:

enter image description here

exr format depth map:

enter image description here

Even if you linearly map the depth of png, you can't get a depth value that matches exr.

depth_map_png = cv2.imread("images/depthpng.png", cv2.IMREAD_UNCHANGED)
depth_map_png = depth_map_png[:, :, 0].astype(np.float32)
height, width = depth_map_png.shape

depth_map_png = depth_map_png / 65535.0
depth_map_png = depth_map_png * (clip_far - clip_near) + clip_near
print(depth_map_png)

The reconstruction result of exr file:

enter image description here

Finally, I am still a little confused. Can I use the PNG depth map generated by blender through non-linear mapping?

Reasons:
  • Whitelisted phrase (-2): I solved
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Looks like a comment (1):
  • Low reputation (1):
Posted by: Clyde Tony