title: Is this how I would calculate the FOV when I have distortion?
body: <p>Following this <a href="http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html" rel="nofollow noreferrer">resource</a>, I believe I understand how the Plumb Bob model for distortion works.</p>
  <p>What I couldn't find, was how to apply this to the calculation of field of view (FOV). To get you used to my notation, without distortion it's</p>
  <pre class="lang-py prettyprint-override"><code>def calculate_fov(
          K: np.ndarray, resolution: Tuple[int, int]) -&gt; Tuple[int, int]:
      &quot;&quot;&quot;
      Calculate fov given intrisic matrix and image size
      Args:
          K - (3, 3) intrinsics matrix
          resolution - (width, height)
      &quot;&quot;&quot;
      fx = K[0, 0]
      fy = K[1, 1]
      return (2 * np.arctan(resolution[0] * 0.5 / fx), 2 * np.arctan(resolution[1] * 0.5 / fy))
  </code></pre>
  <p>Now some back of the envelope math makes me think I can get away with getting some sort of &quot;modified&quot; or &quot;effective&quot; focal lengths.</p>
  <p><a href="https://i.stack.imgur.com/heTpy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/heTpy.png" alt="enter image description here" /></a></p>
  <p>So to &quot;adjust&quot; <code>fx</code> we just multiply it by the radial distortion coefficient.</p>
  <p>So my modified function is</p>
  <pre class="lang-py prettyprint-override"><code>def calculate_fov(
          K: np.ndarray, resolution: Tuple[int, int], D: Optional[np.ndarray] = None) -&gt; Tuple[int, int]:
      &quot;&quot;&quot;
      Calculate fov given intrisic matrix and image size
      Args:
          K - (3, 3) intrinsics matrix
          resolution - (width, height)
          D - Optional (5,) with distortion model
      &quot;&quot;&quot;
      fx = K[0, 0]
      fy = K[1, 1]
      # Adjust fx and fy based on distortion http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html
      if D is not None:
          rx = resolution[0] * 0.5 / fx
          fx = fx * (1 + D[0] * rx**2 + D[1] * rx**4 + D[4] * rx**6)
          ry = resolution[1] * 0.5 / fy
          fy = fy * (1 + D[0] * ry**2 + D[1] * ry**4 + D[4] * ry**6)
      return (2 * np.arctan(resolution[0] * 0.5 / fx), 2 * np.arctan(resolution[1] * 0.5 / fy))
  </code></pre>
  <p>In words, the idea is to take the widest possible point in my image, work out how much that point would be moved because of distortion, then use that in the basic trigonometry for FOV. I just can't find any resources to confirm this, and I'm a little suspicious of the order of operations/logic. And I'm not sure it was fair of me to disregard the tangential distortion.</p>