# Calculating meters per pixel from aerial photographs

## 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: x and y
• Resolution of camera: rx and ry
• Height from which photo was taken: h
• Angle of view of the camera: αx and αy
• MMP: μx and μy

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

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(2αx)=2hx
tan(2αy)=2hy

Rearranging this for x and y:

x=2htan(2αx)
y=2htan(2αy)

Then the MMP is given by:

μx=rxx=rx2htan(2αx)
μy=ryy=ry2htan(2α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:

## Finding angle of view

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

α=2arctan(2fd)

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:

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
αy=48.9

## Conclusion

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

μx=0.2675h mm/pixel
μy=0.2631h mm/pixel

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

If you liked this post, have any questions or fancy having a good discussion, please leave a comment below, or send me an email.