common.py 文件源码

python
阅读 80 收藏 0 点赞 0 评论 0

项目:prototype 作者: chutsu 项目源码 文件源码
def focal_length(image_width, image_height, fov):
    """Calculate focal length in the x and y axis from:
    - image width
    - image height
    - field of view

    Parameters
    ----------
    image_width : int
        Image width
    image_height : int
        Image height
    fov : float
        Field of view

    Returns
    -------
    (fx, fy) : (float, float)
        Focal length in x and y axis

    """
    fx = (image_width / 2.0) / tan(deg2rad(fov) / 2.0)
    fy = (image_height / 2.0) / tan(deg2rad(fov) / 2.0)
    return (fx, fy)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号