From the images, I am assuming you do not have a multi camera setup.
So, the short answer, based on the information I think you have, you cannot. In an ideal scenario, if you know the calibration parameters of the camera, you could use the distance to a known object to compute the scale factor. But in this case, you do not have a fixed object in each image.
However, having said this, you should understand that longitudinal distance computation using single camera systems are generally error prone in the real world.(as you can see from the distance measurements in the images). This can be attributed to the non uniformity of objects as well as varying illumination conditions.
A more constrained case would be to track only objects moving in the same direction as the host. In that case, you could try to detect the labe markers(they generally have a uniform width, length and distance between them) and use the principles of similar triangles to compute the distance to the target vehicle.