liuyuan-pal / NeuRay

[CVPR2022] Neural Rays for Occlusion-aware Image-based Rendering
GNU General Public License v3.0
409 stars 32 forks source link

Why adding a negative sign to the ray direction in NeuRay? #41

Open thucz opened 6 months ago

thucz commented 6 months ago

Hi! I do not understand why here you add a negative sign.

https://github.com/liuyuan-pal/NeuRay/blob/939af16b5e27bcda4f011d1e43cb833c1508622a/network/render_ops.py#L37

liuyuan-pal commented 6 months ago

Hi, I use the direction from the scene to the camera here. You may also use the direction from the camera to the scene.

thucz commented 6 months ago

Thanks! But I still have another question. The code considers that |depth|<1e-4 is invalid. But in OpenCV camera coordinate system, when the depth of a 3D sample point is negative, the value should be invalid as its position is behind the camera. So I think depth < 1e-4 should be invalid.

https://github.com/liuyuan-pal/NeuRay/blob/939af16b5e27bcda4f011d1e43cb833c1508622a/network/render_ops.py#L101