


Today’s Question: Do you have a recommendation for a program/method that would fairly accurately calculate the distance (miles/yards/feet/inches) between objects in a photo? For instance, if you had a photo of a field with two telephone poles in it, could you determine the real-life distance between those poles?
Tim’s Quick Answer: You can use the Ruler tool in Photoshop to measure distances within an image, but there are some important caveats that affect the accuracy of your results.
More Detail: The Ruler tool in Photoshop enables you to measure within an image, including being able to set the scale based on the size of a known object within the frame. However, there can be significant challenges with an accurate measurement based on issues related to perspective and relative distances.
Using the example from today’s question, let’s assume that you know the poles are exactly 35 feet tall. You could use the Ruler tool to set the reference measurement to the height of the pole, designating that as being 35 feet. To do so, go to the menu and choose Image > Analysis > Set Measurement Scale > Custom. In the dialog that appears, enter the real-world dimension of the object you measured in the Logical Length field, and enter a name (such as “Feet”) in the Logical Units field. Click OK to apply the change. This establishes a relationship between the number of pixels in the image and a real-world measurement.
With that reference set, you could then use the Ruler tool to measure the distance between the poles, with the result shown as the “L1” value (for length) on the Options bar.
Put another way, if you took a picture of me standing next to a building, you could set the reference distance to my height, which is six feet. Based on that reference you could then measure the building. Let’s assume it is ten times as many pixels as I am tall, which means the building is 60-feet tall.
There are important caveats to consider here, however. With the power pole example, if the two poles are not aligned perpendicular to the line of the lens, then the distance you’re trying to measure is actually a diagonal within the scene, so you aren’t truly measuring the distance between the poles. Similarly, with the example of me standing beside a building, if I had been positioned halfway between the camera and the building, I’m not right next to the building, and therefore you can’t use my height as an accurate reference for the height of the building.
So, if the lines, angles, and distances in the image are such that you can use the height of one object to calculate the height of another object, the Ruler tool in Photoshop can be very helpful. But under more real-world conditions there is a strong chance that the measurement would not be as precise as you might like.