4
$\begingroup$

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

$\endgroup$
6
  • $\begingroup$ Is the game just maybe... Minecraft? $\endgroup$ Commented Apr 8, 2022 at 6:24
  • $\begingroup$ @MonoWolfChrome Haha, good guess! But actually no, the game is Halo Infinite. $\endgroup$
    – Brovidio
    Commented Apr 8, 2022 at 13:44
  • $\begingroup$ Perhaps just rotate the camera until something goes out of sight? $\endgroup$
    – Emil
    Commented Apr 9, 2022 at 6:44
  • $\begingroup$ 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. $\endgroup$
    – PaulHK
    Commented May 17, 2022 at 3:54
  • $\begingroup$ 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. $\endgroup$
    – Thomas
    Commented May 7, 2023 at 8:00

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.