4 min read

How High Was Your Drone? Estimate Altitude From a Photo

If it's a DJI, you may not need to calculate anything. Their JPEGs carry the height in the metadata, in a field called RelativeAltitude inside the drone-dji XMP block. It is in metres above the takeoff point, and any metadata viewer or ExifTool will show it. Height above takeoff isn't always the same as height over the ground directly below you, for instance if you launched from a hilltop and flew out over a valley, but it is usually what people mean.

The calculation is for the other cases: a drone that doesn't write the number, a still pulled out of a video, a photo someone sent you, or a quick check on whether a log is wrong. It is also a handy sanity check if you want to know whether you were under the usual height limit. Many places cap flights at 120 m (about 400 ft) above ground, but the rules differ by country and by drone category, so check yours.

What you need

Three things: something of known size visible in the frame, the real focal length and sensor width of the camera, and a camera pointing mostly straight down.

Standard-size objects work best. A 40-foot shipping container is 12.19 m long. A tennis court is 23.77 m long and 10.97 m wide for doubles. A football goal is 7.32 m between the posts. Running track lanes are 1.22 m wide. Cars are usable but vary; most are somewhere between 4.2 and 5 m, so accept a few percent of error.

The real focal length is not the 35 mm equivalent. Drone specs advertise the equivalent, and 24 mm is common, but the lens is physically much shorter. The EXIF block usually lists both, and the spec sheet gives the sensor size.

A worked example

Say a drone has a 1-inch sensor (13.2 by 8.8 mm), a real focal length of 8.4 mm and a picture 5472 pixels wide. A 40-foot container lies along the width of the frame and covers about a fifth of it, which is 1094 pixels.

So the camera was about 38.8 m from the container's roof. The container is about 2.6 m tall, which puts the drone roughly 36 m above the ground beside it. At these distances the "1 +" part barely matters, so you can just use focal length times real size divided by size on the sensor.

The calculator on this site does the same arithmetic if you give it the sensor size, the focal length and the pixel measurements. If the drone isn't in the camera list you will need the sensor dimensions from the spec sheet. It was built around upright subjects such as a bird's height, but the maths doesn't care which way the subject lies as long as you measure the same dimension on both sides. The same formula is worked through for birds in the post on whether your lens is enough.

What throws the number off

Tilt. The number you get is the distance along the line of sight. If the gimbal points straight down, that is the height above the object. If it is tilted, the height is the distance multiplied by the sine of the angle below horizontal: about 0.87 at 60 degrees down and 0.71 at 45. DJI logs the gimbal pitch in the same XMP block (minus 90 means straight down), so you can look it up.

Cropping or digital zoom. If the photo has been cropped, the fraction of the frame has to be measured against the original uncropped frame, not the crop. This is probably the most common reason an answer comes out wrong.

Position in the frame. Wide lenses stretch things near the corners, so use an object near the centre. JPEGs from most drones have lens distortion corrected already. Raw files don't.

Expect an answer within about ten percent if the object is a standard size and you measured it carefully. If you have the DJI figure as well, compare the two. A bigger gap than that usually means the crop or the tilt.