fabiotosi92/NeRF-Supervised-Deep-Stereo

About instant-ngp depth

Miaowei-HNU opened this issue · 12 comments

Hi,Can you provide me with the code snippet to capture the depth, I'm having trouble with instant-ngp! help @fabiotosi92

Hi! In the original code of Instant-Ngp, you simply need to set testbed.render_mode to ngp.Depth.

Hi! In the original code of Instant-Ngp, you simply need to set testbed.render_mode to ngp.Depth.

image
I did it in the same way, but I got an all-white image.

Are you saving it as np.uint16? I believe the issue might be related to how you are saving the image.

Are you saving it as np.uint16? I believe the issue might be related to how you are saving the image.

I know the way to save the image so I saved the IMAGE(np float32 WH4) to see the exact value .
image
I don't know how to calculate depth from these values

Try to visualize it using matplotlib. Let me know

Try to visualize it using matplotlib. Let me know
image

Here's my saved RGB image, the depth map is still all white, I'm curious how the depth is getting parsed out from 'image (H,W,4)'.

Consider to use the first channel -> depth[:,:,0]

Consider to use the first channel -> depth[:,:,0]

image
It still doesn't feel right. Do you remember how you handled it?

disparity = focal* args.baseline / image
disparity[np.isinf(disparity)] = 0
disparity[np.isnan(disparity)] = 0
plt.imsave(outname, disparity[:,:,0], cmap="magma")
disparity = focal* args.baseline / image
disparity[np.isinf(disparity)] = 0
disparity[np.isnan(disparity)] = 0
plt.imsave(outname, disparity[:,:,0], cmap="magma")

Oh, have you try to visualize the depth map, I'm using dataset0000, I'll try to visualize the disparity map.

disparity = focal* args.baseline / image
disparity[np.isinf(disparity)] = 0
disparity[np.isnan(disparity)] = 0
plt.imsave(outname, disparity[:,:,0], cmap="magma")

image
I got the disparity map as you provided, but with the first dimension of the image (np) not representing the depth directly

hi @Miaowei-HNU ,also i am troubled in capture the depth can u show me the code