facebookresearch / consistent_depth

We estimate dense, flicker-free, geometrically consistent depth from monocular video, for example hand-held cell phone video.
MIT License
1.6k stars 236 forks source link

How can I get the real depth from the output? #39

Open ChenLingFeng22 opened 3 years ago

ChenLingFeng22 commented 3 years ago

Hi, thanks for your brilliant job, the result is really amazing. I am a noob in this field and I see the visulization of the result is the disparity map, not the depth map. I see that if you want to convert the disparty to the depth, you should konw the baseline first. But this is a monocular depth estimation job, is the baseline the distance of the camera between two frames in world coordinates? Can I get the real depth from the output directly? How can I convert the output to the real depth? Looking forward to your answer.

codinghaven commented 3 years ago

@ChenLingFeng22 Any luck with this, how do we know what two cameras were used for each pixel to get the baseline?

truebelief commented 3 years ago

I think this has been explained from the code: https://github.com/facebookresearch/consistent_depth/blob/master/depth_fine_tuning.py

depth should be equal to the inverse of the output raw image. Not the disparity equation from common sense.

        depth = depth.detach().cpu().numpy().squeeze()
        inv_depth = 1.0 / depth

        image_io.save_raw_float32_image(
            depth_fmt.format(frame_id) + ".raw", inv_depth)

Please correct me if I am wrong. I think the authors don't like others to find easy depth output.

kayleeliyx commented 3 years ago

I think this has been explained from the code: https://github.com/facebookresearch/consistent_depth/blob/master/depth_fine_tuning.py

depth should be equal to the inverse of the output raw image. Not the disparity equation from common sense.

        depth = depth.detach().cpu().numpy().squeeze()
        inv_depth = 1.0 / depth

        image_io.save_raw_float32_image(
            depth_fmt.format(frame_id) + ".raw", inv_depth)

Please correct me if I am wrong. I think the authors don't like others to find easy depth output.

I use those final png files. why did author save inv_depth = 1.0 / depth? Is there any particular reason?

YujiaoHao commented 2 years ago

Does anybody know the unit of actual depth? Are they in meters, feet, inches, or sth else? thanks.