isl-org / MiDaS

Code for robust monocular depth estimation described in "Ranftl et. al., Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer, TPAMI 2022"
MIT License
4.52k stars 624 forks source link

how to estimate depth ? moderate,far away,close up etc #168

Open akashAD98 opened 2 years ago

akashAD98 commented 2 years ago

how to get the depth of images ? after getting the result i want to know whether my object is near,far, moderate,very far, what are the parameters we need to use

image

younesr1 commented 2 years ago

I believe that the fundamental nature of monocular depth means that you get relative depth maps not real depth maps in meters. To convert a relative depth map to a real depth map, you'd need the real depth of some part of the image.

akashAD98 commented 2 years ago

understood, but we can use image disparity to understand the depth.if image disparity is very high & object bbox is very high we can say the object is near , same for faraway object, but I dont know how to find image disparity here

Mr0cket commented 2 years ago

I believe that the fundamental nature of monocular depth means that you get relative depth maps not real depth maps in meters. To convert a relative depth map to a real depth map, you'd need the real depth of some part of the image.

Wouldn't it be even the least bit useful if there was a passing reference to this fact in either the documentation, or the paper?

dfrumkin commented 2 years ago

The way I see it, for a fixed known camera (or class of cameras), you could get some idea of what is near, far, or in between. This network works on all images from unknown sources with unknown post-processing, so only relative depth estimation is possible. In chapter 4, the authors discuss various data sources they used for training and their scale- and shift-invariant loss.

akashAD98 commented 2 years ago

@dfrumkin yes understood. i build a rule-based system which doing well for predicting its depth. example. bus,train is big size object .if we detect this in frame & its bbounding box area is very small comapired to total fame size. we can say that image is far away. same for close object -if bbox is very big which is equals to size of frame this are few examples.

image image

here i first detected object using yoo framwork & build rule based system, but i want to combine this semi supervised approch to build this depth estimation

dfrumkin commented 2 years ago

@akashAD98 A simplistic approach would be to combine segmentation with depth, compute the average depth for the mask and thus decide how far it is. The result would still be relative, giving you a bunch of "cardboard" cutouts at various relative depths (may be a good assumption for a standing person, but not for one lying with his feet/head toward the camera). If you know the real-world size of the object and your camera parameters, you can get some idea of whether it's near or far.

duhaitong commented 1 year ago

@akashAD98 A simplistic approach would be to combine segmentation with depth, compute the average depth for the mask and thus decide how far it is. The result would still be relative, giving you a bunch of "cardboard" cutouts at various relative depths (may be a good assumption for a standing person, but not for one lying with his feet/head toward the camera). If you know the real-world size of the object and your camera parameters, you can get some idea of whether it's near or far. Hello, I would like to ask a question. I obtained the relative depth through the program and knew the object size and camera internal parameters. Is there any formula for obtaining distance?

pragathiacharya commented 2 months ago

how to get the depth of images ? after getting the result i want to know whether my object is near,far, moderate,very far, what are the parameters we need to use

image

@akashAD98 Have you found the solution for the above posted question ? If so please let me know as i am working on the same. Thank you in advance.