If you know the FOV of your camera in degrees, pixel resolution of the image and the real-world dimensions of the target, then you can compute the distance.
This page should get you going. Especially the "Measurements" section about half-way down.
Identifying and Processing the Targets