Closed longbowzhang closed 2 years ago
Hi! Thanks for your interest!
In short, depth is the z-axis component of distance.
Please first check the ray generation step. https://github.com/zju3dv/manhattan_sdf/blob/604944fd37cd8eb9045f4eb8ec4f994269981af4/lib/datasets/scannet.py#L92-L102 Note that the z-axis component of ray direction (in camera space) is 1.
We record the norm of ray direction (as depth_ratio here) and normalize it here. https://github.com/zju3dv/manhattan_sdf/blob/481974147523ac7d06c257433899cf5fe55caf04/lib/networks/network.py#L80-L81
Thus, the distance can be calculated by integral, and the depth can be calculated as distance / depth_ratio. https://github.com/zju3dv/manhattan_sdf/blob/481974147523ac7d06c257433899cf5fe55caf04/lib/networks/network.py#L130-L131
Hi @ghy0324, Thanks for the amazing and inspiring work! But I have a quick question w.r.t the depth calculation.Specifically, why do you divide
distance_map
bydepth_ratio
? what's the difference between distance and depth (I originally thought that distanced
to the camera originray_o
is exactly the depth value for corresponding pixel)? https://github.com/zju3dv/manhattan_sdf/blob/481974147523ac7d06c257433899cf5fe55caf04/lib/networks/network.py#L131Looking forward to your reply.