<p>After lots of delving, eventually I learned that what I was trying to do is an established practice called “still image camera matching” or just “camera matching”.</p>
<p>It’s used in special effects, augmented reality, traffic analysis etc.</p>
<p>It’s the process of recovering information about a camera using a photo taken by the camera as reference.</p>
<p>There’s an open source project which does exactly this: <a href="https://fspy.io/" rel="nofollow noreferrer">https://fspy.io/</a></p>
<p>Not the easiest to use, but gets the job done.</p>

CC BY-SA 4.0
2022-04-12T01:55:30.047Z
2022-04-12T01:55:30.047Z
Brovidio
<p>I'm looking for some guidance.<br />
I'm not sure if this is possible, and I'm not sure where to start.</p>
<p><strong>I need to measure the FOV angles of a first-person, 3D game using only gameplay screenshots.</strong></p>
<p>I'm bound by the game's sandbox.</p>
<p>The best I can do is use existing in-game geometry as a reference points.<br />
Right angles, parallel lines, squares, cubes, and other primitives are somewhat plentiful, and I have a fair amount of control over the camera's position and orientation.</p>
<p><strong>Can FOV be derived from the 2D appearance of known angles, distances, or objects?</strong></p>
<p><strong>If not from a single image, can it be done using multiple images; each showing a different perspective of the same scene, or a different arrangement of known objects?</strong></p>
<p>Consider the diagram at the bottom of this post.<br />
My understanding is that a gameplay screenshot is represented by the <strong>z Projection</strong> plane.<br />
The <strong>Viewing Frustum</strong> represents the observable 3D space in-game.</p>
<p><strong>I need to measure the following angles:</strong></p>
<ul>
<li>Horizontal Field of View (<strong>x FOV</strong>)</li>
<li>Vertical Field of View (<strong>y FOV</strong>)</li>
<li>Diagonal Field of View (<strong>diag FOV</strong>)</li>
</ul>
<p><strong>Things available to me:</strong></p>
<ul>
<li>I can increase and decrease a singular in-game &quot;FOV&quot; setting</li>
<li>I can point and position the camera</li>
<li>I can view some common shapes, primitives, and angles</li>
<li>I know the width, height, and resolution of <strong>z Projection</strong></li>
</ul>
<p><strong>Things I do not/cannot know:</strong> (unless someone else knows a way)</p>
<ul>
<li>The distance from the camera origin to the center of the <strong>z Projection</strong> plane<br />
(maybe sometimes this is called focal length? not sure)</li>
<li>Camera focal length (if different from above)</li>
<li>Camera aperture (if relevant)</li>
<li>Maybe more...</li>
</ul>
<p>I found two online tools that claim to do this, but I'm skeptical.</p>
<ul>
<li>They don't specify any requirements for the camera's position/orientation relative to the reference object.</li>
<li>The ONLY thing that affects the calculation is the distance between two vanishing points.</li>
</ul>
<p>Tools are here:<br />
<a href="https://www.desmos.com/calculator/3e9hs7usyr" rel="nofollow noreferrer">https://www.desmos.com/calculator/3e9hs7usyr</a><br />
<a href="https://www.desmos.com/calculator/zb2jqy5bik" rel="nofollow noreferrer">https://www.desmos.com/calculator/zb2jqy5bik</a></p>
<p><strong>Finally,</strong> these tools don't work for me since I need to detect too wide a range of FOVs. I need a method that can detect FOVs as small as 5 degrees and as large as 150 degrees. At an FOV of 5 degrees, the distance between the two vanishing points becomes absurdly large and way beyond the margin of error of these tools AND my image resolution.</p>
<p><a href="https://i.sstatic.net/57N9U.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/57N9U.png" alt="Diagram" /></a></p>

CC BY-SA 4.0
2022-04-08T06:24:22.790Z
Is the game just maybe... Minecraft?
MonoWolfChrome
CC BY-SA 4.0
2022-04-08T13:44:31.487Z
@MonoWolfChrome Haha, good guess! But actually no, the game is Halo Infinite.
Brovidio
CC BY-SA 4.0
2022-04-09T06:44:59.627Z
Perhaps just rotate the camera until something goes out of sight?
Emil
CC BY-SA 4.0
2022-05-17T03:54:40.427Z
This is a interesting problem. How about aligning a Warthog so the front end and back end of it line up with the both the left and right screen edge, then approximate how many warthogs distance you are standing back from the warthog. Now you've formed a triangle with the FOV as part of it.
PaulHK
CC BY-SA 4.0
2023-05-07T08:00:45.250Z
You talked about focal length... If focal length, image plane distance or focal distance is used in the game, then it is usually used to calculate "depth of field". In that case very close or very far object would be blurred, depending on the parameters. Do you meen "near clipping plane"?. The near clipping plane is the plane "z near" within your diagram.
Thomas
CC BY-SA 4.0
2023-05-07T08:09:38.173Z
In case the camera is implemented very realistic, have in mine that "radial distortion" can be implemented as well, which leeds to a non linear transformation of the angle between pixel and view direction. In that case to measure the maximum FoV, you need to look at the most outer pixels. For example by looking orthogonal an a box by keeping the left box edge at the first (left) Pixel on your screen. Then measure the distance to the box and use the $tan(\frac{fovX} {2}) =(boxEdgeLength / boxDistance)$
Thomas
<3d><projections><perspective>
How to derive Field of View (FOV) angles from a 2D projection
Brovidio
# How to derive Field of View (FOV) angles from a 2D projection

(Asked by: username_0 on 2022-04-07)

I'm looking for some guidance.  
I'm not sure if this is possible, and I'm not sure where to start.

**I need to measure the FOV angles of a first-person, 3D game using only gameplay screenshots.**

I'm bound by the game's sandbox.

The best I can do is use existing in-game geometry as a reference points.  
Right angles, parallel lines, squares, cubes, and other primitives are somewhat plentiful, and I have a fair amount of control over the camera's position and orientation.

**Can FOV be derived from the 2D appearance of known angles, distances, or objects?**

**If not from a single image, can it be done using multiple images; each showing a different perspective of the same scene, or a different arrangement of known objects?**

Consider the diagram at the bottom of this post.  
My understanding is that a gameplay screenshot is represented by the **z Projection** plane.  
The **Viewing Frustum** represents the observable 3D space in-game.

**I need to measure the following angles:**

* Horizontal Field of View (**x FOV**)
* Vertical Field of View (**y FOV**)
* Diagonal Field of View (**diag FOV**)

**Things available to me:**

* I can increase and decrease a singular in-game "FOV" setting
* I can point and position the camera
* I can view some common shapes, primitives, and angles
* I know the width, height, and resolution of **z Projection**

**Things I do not/cannot know:** (unless someone else knows a way)

* The distance from the camera origin to the center of the **z Projection** plane  
  (maybe sometimes this is called focal length? not sure)
* Camera focal length (if different from above)
* Camera aperture (if relevant)
* Maybe more...

I found two online tools that claim to do this, but I'm skeptical.

* They don't specify any requirements for the camera's position/orientation relative to the reference object.
* The ONLY thing that affects the calculation is the distance between two vanishing points.

Tools are here:  
<https://www.desmos.com/calculator/3e9hs7usyr>  
<https://www.desmos.com/calculator/zb2jqy5bik>

**Finally,** these tools don't work for me since I need to detect too wide a range of FOVs. I need a method that can detect FOVs as small as 5 degrees and as large as 150 degrees. At an FOV of 5 degrees, the distance between the two vanishing points becomes absurdly large and way beyond the margin of error of these tools AND my image resolution.

[![Diagram](https://i.sstatic.net/57N9U.png)](https://i.sstatic.net/57N9U.png)

**Tags:** 3d, projections, perspective

> **Comments:**
> **username_1**: Is the game just maybe... Minecraft?  
> **username_0**: @username_1 Haha, good guess! But actually no, the game is Halo Infinite.  
> **username_2**: Perhaps just rotate the camera until something goes out of sight?  
> **username_3**: This is a interesting problem. How about aligning a Warthog so the front end and back end of it line up with the both the left and right screen edge, then approximate how many warthogs distance you are standing back from the warthog. Now you've formed a triangle with the FOV as part of it.  
> **username_4**: You talked about focal length... If focal length, image plane distance or focal distance is used in the game, then it is usually used to calculate "depth of field". In that case very close or very far object would be blurred, depending on the parameters. Do you meen "near clipping plane"?. The near clipping plane is the plane "z near" within your diagram.  
> **username_4**: In case the camera is implemented very realistic, have in mine that "radial distortion" can be implemented as well, which leeds to a non linear transformation of the angle between pixel and view direction. In that case to measure the maximum FoV, you need to look at the most outer pixels. For example by looking orthogonal an a box by keeping the left box edge at the first (left) Pixel on your screen. Then measure the distance to the box and use the $tan(\frac{fovX} {2}) =(boxEdgeLength / boxDistance)$  

---

## 1 answers

### Answer by username_0 on 2022-04-12. Score: 1

After lots of delving, eventually I learned that what I was trying to do is an established practice called “still image camera matching” or just “camera matching”.

It’s used in special effects, augmented reality, traffic analysis etc.

It’s the process of recovering information about a camera using a photo taken by the camera as reference.

There’s an open source project which does exactly this: <https://fspy.io/>

Not the easiest to use, but gets the job done.


---

