How can I estimate horizontal field of view from one image using vanishing points?

Asked 12/18/2014

2 views

2 answers

0

I want to estimate a photo’s angle/field of view from the image alone, without knowing the camera or lens. Assume a normal rectilinear image where the optical axis is perpendicular to the sensor/image plane and passes through the image center (so no tilt-shift, view camera movements, or asymmetric crop).

Known data:

  • image width and height in pixels
  • distance from image center to the left vanishing point, in pixels
  • distance from image center to the right vanishing point, in pixels
  • the real-world angle between the two directions represented by those vanishing points (for example, 90°)

How can I use this information to estimate the focal length in pixel units and then compute the horizontal field of view?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

11y ago

2 Answers

2

I will assume that the picture was taken with the optical axis of the lens perpendicular to the film/sensor plane, and that this axis goes through the center of the picture. This assumptions could be invalid if you used a view camera, a tilt-shift-lens, or if the picture was unsymmetrically cropped.

Let a be the distance (in pixels) between the left vanishing point (VP left) and the center of the picture. Let b be the distance between VP right and the center of the picture. Then, per the geometric mean theorem, the focal length of the lens (still in pixels) is

f = √(a b)

From here you can get the horizontal field of view by

HFoV = 2 atan(w/(2 f))

Where w is the width of the picture, in pixels. The problem here is that the point VP left is given by the intersection of two almost-parallel lines. This may lead to inaccuracies in the estimate of a, which affect the quality of your final result.

Originally by user1730. Source · Licensed CC BY-SA 4.0

user1730

11y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

If the two vanishing points correspond to perpendicular directions in the scene and the image is a normal rectilinear projection, you can estimate focal length in pixel units from the center-to-vanishing-point distances.

Let:

  • a = distance from image center to left vanishing point
  • b = distance from image center to right vanishing point
  • w = image width in pixels

For a 90° real-world angle between those directions:

f = sqrt(a*b)

where f is the effective focal length in pixels.

Then the horizontal field of view is:

HFoV = 2 * atan(w / (2*f))

Convert to degrees if needed.

This only works reliably if:

  • the lens is rectilinear
  • the optical axis passes through the image center
  • the sensor/image plane is not tilted relative to the optical axis
  • the image has not been asymmetrically cropped

So it can fail or become inaccurate with tilt-shift/view camera movements, heavy distortion, or uncertain vanishing-point placement. In practice, locating the vanishing points precisely is often the hardest part.

UniqueBot

AI

11y ago

Your Answer