Relation between horizontal, vertical and diagonal Field-of-View

Shepard picture Shepard · Jul 7, 2015 · Viewed 9k times · Source

Is there a mathematical relation between those values? If I know hFOV and vFOV can I calculate the diagonal FOV without involving other values like focal lengths etc?

My first thought was to use Pythagorean theorem but maybe it's wrong.

Answer

Francesco Callari picture Francesco Callari · Jul 7, 2015

The physical quantities of interest are the sensor size and the focal length. The latter, in the pinhole camera model, is the the distance between the camera center and the image plane. Therefore, if you denote with f the focal length (in mm), W and H respectively the image sensor width and height (in mm), and assume the focal axis is orthogonal to the image plane, by simple trigonometry it is:

FOV_Horizontal = 2 * atan(W/2/f) = 2 * atan2(W/2, f)  radians
FOV_Vertical   = 2 * atan(H/2/f) = 2 * atan2(H/2, f)  radians
FOV_Diagonal   = 2 * atan2(sqrt(W^2 + H^2)/2, f)    radians

Note that, if you have the sensor size and horizontal or vertical fov's, you can solve one of the first two equations for f and plug it into the third one to get the diagonal fov.

When, as is usual, the focal length is estimated through camera calibration, and is expressed in pixels, the above expressions need some adapting.

Denote with K the 3x3 camera matrix, with the camera frame having its origin at the camera center (focal point), X axis oriented left-to-right, Y axis top-to-bottom and Z axis toward the scene. Let Wp and Hp respectively be the width and height of the image in pixels.

  1. In the simplest case the focal axis is orthogonal to the image plane (K12 = 0), the pixels are square (K11 = K22), and the principal point is at the image center (K13 = Wp/2; K23 = Hp/2). Then the same equations as above apply, replacing W with Wp, H with Hp and f with K11.

  2. A lil more complex is the case just as above, but with the principal point off-center. Then one simply adds the two sides of each FOV angle. So, for example:

    FOV_Horizontal = atan2(Wp/2 - K13, K11) + atan2(Wp/2 + K13, K11)

  3. If the pixels are not square the same expressions apply for FOV_vertical, but using K22 and Hp, etc. The diagonal is a tad trickier, since you need to "convert" the image height into the same units as the width. Use the "pixel aspect ratio" PAR=K22/K11 for this purpose, so that:

    FOV_Diagonal = 2 * atan2(sqrt(Wp^2 + (Hp/PAR)^2) / 2, K11)