Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Oct 25, 2022 · 2 comments

Comments

@shreyash0502
Copy link

shreyash0502 commented Oct 25, 2022

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.

@shreyash0502 shreyash0502 changed the title 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? 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. 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? Oct 25, 2022
@matteoTaiana
Copy link

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
Copy link

65535

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants