水平,垂直和对角线视场之间的关系 [英] Relation between horizontal, vertical and diagonal Field-of-View

查看:633
本文介绍了水平,垂直和对角线视场之间的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些值之间是否存在数学关系?如果我知道hFOV和vFOV,我可以在不涉及焦距等其他值的情况下计算对角FOV吗?



我的第一个想法是使用勾股定理,但这也许是错误的。 / p>

解决方案

感兴趣的物理量是传感器的大小和焦距。在针孔相机模型中,后者是相机中心和图像平面之间的距离。因此,如果用f表示焦距(以毫米为单位),W和H分别表示图像传感器的宽度和高度(以mm为单位),并假设焦轴与像平面正交,则通过简单的三角函数为:

  FOV_Horizo​​ntal = 2 * atan(W / 2 / f)= 2 * atan2(W / 2,f)弧度
FOV_Vertical = 2 * atan(H / 2 / f)= 2 * atan2(H / 2,f)弧度
FOV_Diagonal = 2 * atan2(sqrt(W ^ 2 + H ^ 2)/ 2,f)弧度

请注意,如果您具有传感器大小和水平或垂直视野,则可以解决

通常情况下,焦距是通过相机校准估算的,并且以像素表示,以上表达需要一些适应。



用K表示3x3摄像机矩阵,摄像机框架的原点位于摄像机中心(焦点),X轴从左到右,Y轴从上到下和Z轴朝向场景。令Wp和Hp分别为图像的宽度和高度(以像素为单位)。


  1. 在最简单的情况下,焦轴与图像平面正交(K12 = 0),像素为正方形(K11 = K22),并且主点位于图像中心(K13 = Wp / 2; K23 = Hp / 2)。然后应用与上述相同的方程,用Wp替换W,用Hp替换H,用K11替换f。


  2. 更复杂的情况就是上述情况,但主要点偏离中心。然后,只需将每个FOV角的两侧相加即可。因此,例如:



    FOV_Horizo​​ntal = atan2(Wp / 2-K13,K11)+ atan2(Wp / 2 + K13,K11)


  3. 如果像素不是正方形,则相同的表达式适用于FOV_vertical,但使用K22和Hp等。对角线有点棘手,因为您需要将图像高度转换为与宽度相同的单位。为此,请使用像素宽高比 PAR = K22 / K11,



    FOV_Diagonal = 2 * atan2(sqrt(Wp ^ 2 +(Hp / PAR )^ 2)/ 2,K11)



Is there a mathematical relation between those values? If I know hFOV and vFOV can I calculate the diagonal FOV without involving other values like focal lengths etc?

My first thought was to use Pythagorean theorem but maybe it's wrong.

解决方案

The physical quantities of interest are the sensor size and the focal length. The latter, in the pinhole camera model, is the the distance between the camera center and the image plane. Therefore, if you denote with f the focal length (in mm), W and H respectively the image sensor width and height (in mm), and assume the focal axis is orthogonal to the image plane, by simple trigonometry it is:

FOV_Horizontal = 2 * atan(W/2/f) = 2 * atan2(W/2, f)  radians
FOV_Vertical   = 2 * atan(H/2/f) = 2 * atan2(H/2, f)  radians
FOV_Diagonal   = 2 * atan2(sqrt(W^2 + H^2)/2, f)    radians

Note that, if you have the sensor size and horizontal or vertical fov's, you can solve one of the first two equations for f and plug it into the third one to get the diagonal fov.

When, as is usual, the focal length is estimated through camera calibration, and is expressed in pixels, the above expressions need some adapting.

Denote with K the 3x3 camera matrix, with the camera frame having its origin at the camera center (focal point), X axis oriented left-to-right, Y axis top-to-bottom and Z axis toward the scene. Let Wp and Hp respectively be the width and height of the image in pixels.

  1. In the simplest case the focal axis is orthogonal to the image plane (K12 = 0), the pixels are square (K11 = K22), and the principal point is at the image center (K13 = Wp/2; K23 = Hp/2). Then the same equations as above apply, replacing W with Wp, H with Hp and f with K11.

  2. A lil more complex is the case just as above, but with the principal point off-center. Then one simply adds the two sides of each FOV angle. So, for example:

    FOV_Horizontal = atan2(Wp/2 - K13, K11) + atan2(Wp/2 + K13, K11)

  3. If the pixels are not square the same expressions apply for FOV_vertical, but using K22 and Hp, etc. The diagonal is a tad trickier, since you need to "convert" the image height into the same units as the width. Use the "pixel aspect ratio" PAR=K22/K11 for this purpose, so that:

    FOV_Diagonal = 2 * atan2(sqrt(Wp^2 + (Hp/PAR)^2) / 2, K11)

这篇关于水平,垂直和对角线视场之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆