Wednesday, 1 July 2015

calculations - Calculate angle/field of view from 2D image


I want to calculate the angle of view (or field of view) from a photograph, without knowing anything about the camera (or lens).


Please have a look at this example: example


It is assumed the angle between the line CENTER-LEFT and CENTER-RIGHT is 90° in reality.


What I do know:




  • The width and height of the image (in px).

  • The distances C-VPleft and C-VPright (in px).

  • The distance C-CENTER (in m).

  • The real angles between LEFT-CENTER-RIGHT. (So in reality and not in the picture.)


I have no other information.


Any help is appreciated.


Thanks!



Answer



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.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...