Ask Your Question
3

focal length and calibration

asked 2012-08-05 05:43:03 -0500

sthalik gravatar image

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
8

answered 2012-08-05 14:04:46 -0500

Adi gravatar image

updated 2012-08-05 14:24:43 -0500

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.

image description

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.

edit flag offensive delete link more

Comments

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

sthalik gravatar imagesthalik ( 2012-08-05 14:55:47 -0500 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2012-08-05 05:43:03 -0500

Seen: 7,738 times

Last updated: Aug 05 '12