TRAILab / CaDDN

Categorical Depth Distribution Network for Monocular 3D Object Detection (CVPR 2021 Oral)
Apache License 2.0
359 stars 62 forks source link

How can I transform depth map to real depth ? #57

Closed kaixinbear closed 2 years ago

kaixinbear commented 2 years ago

I notice that you turn the depth map to real depth by dividing 256. But when I change the depth to point cloud, I found this value not correct. Could you tell me why you divide 256 to get the depth?

codyreading commented 2 years ago

If you take a look at the depth completion code I used: https://github.com/kujason/ip_basic/blob/master/demos/depth_completion.py#L180.

They multiply by 256 before saving it to an image, so I just do the reverse when I load in the depth maps to recover the real depths.

kaixinbear commented 2 years ago

OK, I solve it .Thx

Len-Li commented 2 years ago

Hi, how can I transform depth distribution to depth map according to different Depth Discretization Methods?

codyreading commented 2 years ago

Hello!

You can take the expectation of the depth distributions. Basically, you multiply the depth distribution scores by the bin center and sum these to get the estimated depth value for each pixel.

Len-Li commented 2 years ago

Hello!

You can take the expectation of the depth distributions. Basically, you multiply the depth distribution scores by the bin center and sum these to get the estimated depth value for each pixel.

Thanks for your reply! How about I simply using the argmax bin as the final depth? I can use the inverse form of the code to calculate the depth map.