There are two ways to determine the distance of an object:
TRIANGULATION: You measure the angle that the point you are measuring with two or more sensors; this is what Russell told you, and used with compass for example;
TRILATERATION: You measure the distance from the point to two or more sensors, without knowing the direction; this is the case of GPS tracking or ultrasonic sensors.
So basically, you can use lasers (or lights in general, that involves also image detection) with cameras to do triangulation, or range sensors like ultrasonic sensors (used in robotics too) and use trilateration. I think it depends by the properties of the objects you're measuring and also other things like precision, size and others.
If it can help I've seen that self-driving veichles like the ones that participate to DARPA Grand Challenge often use cameras, and since the distance is similar probably that's the best choice.
Using computer vision, a common approach is to project on the objects a pattern (there are studies about which is better for a specific task) and using disparity maps to find the differences between images (obviously you need stereo vision).
This last method is really powerful, and probably the image you posted comes from that (even though I cannot understand why the can seems flat; probably it's been flattened later). There is a Matlab toolbox and for sure there are functions ni the OpenCV library for C, C++, Python and Java. Probably the first is the best for embedded implementation.