4 min read

Calculating meters per pixel from aerial photographs

Table of Contents
#

Aim

Say you’re doing some aerial photogrammetry, for scientific purposes. Then you need to know those pernickety little details like the resolution that your pictures will produce, and the precision you can infer from this. This post shows how to calculate how many meters each pixel of a photo taken by a particular camera corresponds to, given the required information.

The trigonometry assumes that you are flying a UAV with the camera facing directly downwards. The example values given are those taken from the Canon Ixus 132 I am using for my aerial photogrammetry project.

#

Trigonometry

Firstly, let’s look at how we can go from the information we have to the information we need. We need to know the following to completely determine the MPP (meters per pixel):

  • Resolution of the camera
  • Height from which photo was taken
  • Angle of view of the camera

Then let us parametrise the situation as follows:

  • Ground distances photographed in horizontal and vertical, respectively: xx and yy
  • Resolution of camera: r_xr\_x and r_yr\_y
  • Height from which photo was taken: hh
  • Angle of view of the camera: α_x\alpha\_x and α_y\alpha\_y
  • MMP: μ_x\mu\_x and μ_y\mu\_y

The following diagrams illustrate the horizontal and vertical views that the camera sees:

horizontal view


vertical view

It is clear by basic trigonometry that the tangent of half the angle of view is equal to half the ratio of the ground distance and the height. As parametrised:

tan(α_x2)=x2h\tan\left(\frac{\alpha\_x}{2}\right) = \frac{x}{2h} tan(α_y2)=y2h\tan\left(\frac{\alpha\_y}{2}\right) = \frac{y}{2h}

Rearranging this for xx and yy:

x=2htan(α_x2)x = 2h\tan\left(\frac{\alpha\_x}{2}\right) y=2htan(α_y2)y = 2h\tan\left(\frac{\alpha\_y}{2}\right)

Then the MMP is given by:

μ_x=xr_x=2htan(α_x2)r_x\mu\_x = \frac{x}{r\_x} = \frac{2h\tan\left(\frac{\alpha\_x}{2}\right)}{r\_x} μ_y=yr_y=2htan(α_y2)r_y\mu\_y = \frac{y}{r\_y} = \frac{2h\tan\left(\frac{\alpha\_y}{2}\right)}{r\_y} #

Finding camera resolution

The camera resolution should be displayed on the camera specifications, or in the camera settings dialogue. If you don’t have access to this information, it can also be read directly from the EXIF metadata using exiftool:

Terminal window
1
> exiftool photo.jpg
2
...
3
Image Size: 4608x3456 # This is the camera resolution
4
...
#

Finding angle of view

The angle of view of a camera can be calculated from the camera’s effective focal length, ff (which excluding macro photography is approximately equal to the stated focal length), and the dimension of the sensor in that direction, dd as follows:

α=2arctan(d2f)\alpha = 2\arctan\left(\frac{d}{2f}\right)

The focal length is stated on the camera specs. For my Ixus 132 the stated focal length is 5.0 mm.

To find the dimension of the camera sensor, you need to know what type of sensor it is. It’ll either be a CCD sensor (Charge Coupled Device) or a CMOD sensor (Complementary Metal-Oxide Semiconductor).

This image, courtesy of gizmag, show the dimensions of various common sensor sizes:

sensor sizes

If your sensor is not listed here, then Wikipedia has a full table of listings for every sensor imaginable over on the page for Image sensor format.

For instance, my camera has a 1/2.3” CCD, meaning it has dimensions 6.17 mm by 4.55 mm.

Thus, plugging these values into the equation above, my camera has angles of view of:

α_x=63.3\alpha\_x = 63.3^{\circ} α_y=48.9\alpha\_y = 48.9^{\circ} #

Conclusion

Then plugging these values into the formula given above, the MMP as a function of height is:

μ_x=0.2675hmm/pixel˜\mu\_x = 0.2675h \~\text{mm/pixel} μ_y=0.2631hmm/pixel˜\mu\_y = 0.2631h \~\text{mm/pixel}

Where hh is in meters. Thus at a typical UAV flight height of h=100m˜h = 100\~\text{m} , the MMP is 2.68 cm per pixel in the horizontal and 2.63 cm per pixel in the vertical.