I am a software developer with focus on computer graphics but being poor in the topic of camera hardware. I try to implement a physical camera for simulation purposes and having some parameters to define the camera:

  1. Focal length
  2. Focal distance
  3. Multiple radial distortion coefficients
  4. Sensor resolution
  5. Sensor size

I found a formula to calculate the field of view as follow:

imagePlaneDistance = focalDistance * focalLength / (focalDistance - focalLength)
fovHorizontal = 2.0 * atan(sensorWidth / (2.0 * imagePlaneDistance))

This works very well! But now I want to add radial distortion by Brown Conrady and Kannala Brandt algorithm which also works very well.

Both algorithms convert the angle between the view direction and the pixel outgoing direction to the distorted angle offset. When applying one of the two algorithms on top of my rendered (Perspective projection) image which is rendered with a field of view calculated by the formula above. The barrel distortion at the edges and corners points me to a larger field of view than the formula. The pincushion distortion at the edges and corners points me to a smaller field of view than the formula. (See figure 1)

enter image description here

Figure 1: Left: Barrel distortion. Right: Pincushion distortion. The green border in the left image points to higher field of view than the formula above defines. The fine black lines in the right image are projection issues, which will be corrected later.

I totally understand why this happens. But I'm confused, how the "real" field of view gets calculated when having these parameters.

I think, that there are two ways:

  1. Add the maximum distortion offset on top of the field of view calculation to render with a larger frustum.
  2. The output image is a cut out from the distorted edges (like in figure1 the red box).

Which way to choose to be realistic? Or is there another better solution? How to get the real field of view?

  • \$\begingroup\$ Does this answer your question? Does "Field of view" include radial lens distortion? \$\endgroup\$
    – scottbb
    Feb 16, 2023 at 18:43
  • \$\begingroup\$ Your formula is correct for rectilinear lenses (i.e., using the pinhole projection mapping function). But different fisheye lenses use different projection mapping functions. \$\endgroup\$
    – scottbb
    Feb 16, 2023 at 18:52
  • \$\begingroup\$ @scottbb first of all, thank you for the link. His question is exactly what I am looking for. But I don't like the answer... I am trying to simulate a very good and expensive camera where the user can insert the parameters from above. And the output (FoV) should be correct at the end. What would you do? \$\endgroup\$
    – Thomas
    Feb 16, 2023 at 21:13
  • \$\begingroup\$ "Correct" FoV is a matter of perspective and opinion. That is, it's not an absolute truth, it's what you define it to be. Most lenses are characterized by 3 angles of view — horizontal, vertical, and diagonal. As far as the question you're asking, along the lines of what you're rendering... you have to render everything visible by the viewport (i.e., through the lens into the sensor). ¯\_(ツ)_/¯ \$\endgroup\$
    – scottbb
    Feb 16, 2023 at 21:35
  • \$\begingroup\$ means that the field of view can only be determined by testing. Thank you for your support @scottbb =) \$\endgroup\$
    – Thomas
    Feb 17, 2023 at 12:58


Browse other questions tagged or ask your own question.