Improvements on computation of distance between object and camera