# focal length and calibration

Is there a mapping of camera FOV and resolution to focal length as accepted by solvePnP or especially POSIT?

End-users can't be expected to do chessboard-calibration. :(

Since there are camera specs available online, it would've been much easier if such mapping existed.

What are the variables for focal length, anyway? I always guessed, or used a retractable ruler on POSIT, my face, and several (dozen) iterations of launching the POSIT-using code with different focal lengths. This is far from robust, though.

I'll be grateful from the bottom of my heart to anyone who provides an equation that works!!!

-sh

edit retag close merge delete

Sort by ยป oldest newest most voted

In the pin-hole camera model, focal length is the distance of the image-plane from the focal point of the camera. However, the units it is given in may differ from system to system.

Film cameras and lens, usually denote f in mm. The effective (pin-hole) FOV is measured relative to the width of the film, e.g. 35mm.

In this case, if the frame width is 35mm, and the distance is, say 30mm, then simple trigonometry gives you:

1. If f=30mm is the triangle height;
2. and taking half the width of the frame gives us a right-triangle with a base of w/2=35/2=17.5;
3. Then if the angle at the top, half the FOV, is a, we get: tan(a)=(w/2)/f=0.58333333, or a=30.256 deg;
4. The FOV = 2a = 60.5 deg

For digital cameras you can substitute the sensor width for the film width (35mm).

In vision systems, the focal length is often calculated in pixels, so that the width is taken as the image width in pixels. If you know your sensor size in mm, you can easily convert between the two.

Obviously, if you know your FOV, you can reverse this simple calculation to get f in which ever units you know your width.

more

This helps a lot. Thank you for the indepth explanation!

( 2012-08-05 14:55:47 -0600 )edit

Official site

GitHub

Wiki

Documentation