haofeixu / aanet

[CVPR'20] AANet: Adaptive Aggregation Network for Efficient Stereo Matching
Apache License 2.0
521 stars 100 forks source link

How to calculate distance of the object from the output (Depth map) of the model? #58

Closed aditdoshi333 closed 3 years ago

aditdoshi333 commented 3 years ago

Hello,

Thanks for publishing such good work. I am using the architecture for inference using stereo camera stereo. I want to calculate the distance of the object from the output of the model. Can anyone please throw some light for the same?

Thank you

haofeixu commented 3 years ago

Hi, you need the info of camera baseline b and focal length f, then the depth can be computed by bf/d, where d is the predicted disparity map.

aditdoshi333 commented 3 years ago

Hi, you need the info of camera baseline b and focal length f, then the depth can be computed by bf/d, where d is the predicted disparity map.

Hi Yeah, I have to baseline and focal length but not sure about the disparity map parameter. So d is the pixel value of the particular coordinate?

haofeixu commented 3 years ago

Yes.

aditdoshi333 commented 3 years ago

Yes.

Thanks a lot for the prompt reply. Just one last question I don't have to do any processing with the disparity map? Just feeding the pixel value in the formula will do the thing right?

haofeixu commented 3 years ago

Yes, no processing is required. You can have a try.