4 min read

Calculating meters per pixel from aerial photographs

Calculate the meters per pixel of a camera from its resolution, height, and angle of view.
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: rxr_x and ryr_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=xrx=2htan(αx2)rx\mu_x = \frac{x}{r_x} = \frac{2h\tan\left(\frac{\alpha_x}{2}\right)}{r_x} μy=yry=2htan(αy2)ry\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.2675h mm/pixel\mu_x = 0.2675h ~\text{mm/pixel} μy=0.2631h mm/pixel\mu_y = 0.2631h ~\text{mm/pixel}

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