4

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

Brovidio
  • 51
  • 4
  • Is the game just maybe... Minecraft? – MonoWolfChrome Apr 08 '22 at 06:24
  • @MonoWolfChrome Haha, good guess! But actually no, the game is Halo Infinite. – Brovidio Apr 08 '22 at 13:44
  • Perhaps just rotate the camera until something goes out of sight? – Emil Apr 09 '22 at 06:44
  • 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 May 17 '22 at 03:54
  • 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 May 07 '23 at 08:00
  • 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 May 07 '23 at 08:09

1 Answers1

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.

Brovidio
  • 51
  • 4