# Is it possible to calculate focal length of a picture taken with a zoom lens if you know the aperture?

I need focal length (for my IA homework), but I didn't know that in real world I would only get the aperture. Ok, my camera is an Olympus X-21, and manual says:

Olympus lens: 6.3 to 18.9 mm, f/3.1 to 5.9

I've taken two pictures with zoom and the aperture is f/4.2 for the first one and f/5.7 for the second one.

But I need the focal length, I don't know how these numbers are related to each other so I'm lost. Does anyone know a formula I can use? Thanks in advance.

First, there is no way to get the focal length from the aperture.

Your camera's max aperture is f/3.1 at 6.3mm and f/5.9 at 18.9mm - but there isn't anything that say the camera must use the max aperture, it's completely possible to use f/5.9 at 6.3mm - so there no relationship what so ever between the aperture used and the focal length.

Even if you force the camera to use the max aperture the relationship between the max aperture and the focal length is depended on the internal design of that camera's lens and there is not general formula that can help you.

And, just to make things even more impossible camera manufacturers don't publish the max aperture - focal length relationship because usually it just makes them look bad (the max aperture gets smaller faster than you would think).

Second, "in the real world" it's usually very easy to get the focal length, every digital camera I've ever owned from entry level point ans shoots all the way to may current DSLR always records the focal length in the EXIF data.

• I love you, it is so simple!! Thanks from the bottom of my hearth. – Engel Jan 13 '13 at 16:41
• What's your fireplace got to do with it? ;) – ElendilTheTall Jan 13 '13 at 20:40

The numbers are related in the way that 3.1 is the largest aperture at the focal length 6.3 mm and 5.9 is the largest aperture at the focal length 18.9 mm.

The camera can use a smaller aperture than the maximum (higher f number), so the only thing that you can say for certain from those numbers is that neither of the photos were taken with the focal length 18.9 mm.

The first photo had to be taken with a short focal length, somewhere in the shortest third of the range, but the second photo could be taken with a focal length up to almost the longest.

For image analysis purposes you need to know both the focal length and the sensor size. Note that the EXIF recorded focal length is only approximate.

A better solution is to calibrate the camera using a known object. Circles printed on a sheet of paper will do for this purpose, see:

http://www.ee.oulu.fi/~jkannala/publications/preprintECEWiley2008.pdf

The code for their implementation is available online if you search for it.