how to get depth image from disparity map
See original GitHub issueWhen I run the submission.py on Kitti 2012, I get the disparity as output. Is it the expected output from the submission.py run?
python submission.py --maxdisp 192 --model stackhourglass --KITTI 2012 --datapath DATA/Kitti2012/testing/ --loadmodel models/pretrained/pretrained_model_KITTI2015.tar
I was thinking I would get a depth map of this kind (not the same image, just for example):
I am a bit confused.
I understand the formula depth = baseline * focal / disparity Is that what I should implement to generate the depth from the output of submission.py ?
Or is there some paramater to give to generate it directly from the run of submission?
I checked Kitti development kit and didnt find it helpful.
Any help would be welcome.
Thank you (And thank you anyway for the great implementation - great work)
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top GitHub Comments
I have rewritten the disp_to_color.m in Python, welcome issues for somebody else, I will try to make the script running fast.
https://github.com/passion3394/PSMNet_CPU/blob/master/disp_to_color.py
Answering to myself if anyone has the same question (thanks to https://github.com/JiaRenChang/PSMNet/issues/56#issuecomment-398021563)
1/ download toolkit for sceneflow here: http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=stereo
2/ you have ot use the disp_to_color.m file.
Assuming you have a file test.png in the same folder, this simple code is working:
test.png:
test_color.png