cleinc / bts

From Big to Small: Multi-Scale Local Planar Guidance for Monocular Depth Estimation
GNU General Public License v3.0
635 stars 179 forks source link

Can you please tell me how to figure out the actual depth value(in metres or centimeteres) at any (x,y) coordinate of the image that is being predicted by the model? #136

Open shreyash0502 opened 2 years ago

shreyash0502 commented 2 years ago

How to convert the pixel value to depth? What is the formula for that? I want to get the depth of some object (in metres or centimetres) from the predicted depths given by the model.

matteoTaiana commented 2 years ago

Hi, I've been thinking about this as well. For what I understand, each depth value is represented with 2 Bytes = 16 bits. If you interpret that as one positive integer, you get a range between 0 and 65535 (these seem to be the values I get if I open the output images with PIL). So I guess that we should map the numerical range we get to the known range in meters for a specific dataset. For example, the KITTI data has a range between 0 and 80 meters. So to go from the pixel value to the depth, I would use this formula: metric_depth = (pixel_value * 80) / 65535.

But this is only a guess. Anyone of the authors can confirm or refute my guess, please?

Zhangwenyao1 commented 1 year ago

65535

But the max value of kiiti depth is 255, then the metric depth would be less than 1m, is this true?