当前位置:网站首页>Mutual conversion of camera internal parameter matrix K and FOV
Mutual conversion of camera internal parameter matrix K and FOV
2022-07-25 19:30:00 【Rusian_ Stand】
1、 Theoretical knowledge


It can be seen intuitively from the figure fov_y The focal length f And image height ,tan(fov_y/2) = 2/h / fy. So the forward and reverse conversion process is very direct .f With pixel In units of .
2、 Code
def camera_intrinsic_transform(fov_x=45,fov_y=60,pixel_width=320,pixel_height=240):
camera_intrinsics = np.zeros((3,4))
camera_intrinsics[2,2] = 1
camera_intrinsics[0,0] = (pixel_width/2.0)/math.tan(math.radians(fov_x/2.0))
camera_intrinsics[0,2] = pixel_width/2.0
camera_intrinsics[1,1] = (pixel_height/2.0)/math.tan(math.radians(fov_y/2.0))
camera_intrinsics[1,2] = pixel_height/2.0
return camera_intrinsics
def camera_intrinsic_fov(intrinsic):
# Calculation FOV
w, h = intrinsic[0][2]*2, intrinsic[1][2]*2
fx, fy = intrinsic[0][0], intrinsic[1][1]
# Go
fov_x = np.rad2deg(2 * np.arctan2(w, 2 * fx))
fov_y = np.rad2deg(2 * np.arctan2(h, 2 * fy))
return fov_x, fov_y
边栏推荐
猜你喜欢

Common misunderstandings caused by a time reporting assistant of Blue Bridge Cup basic questions

帝国CMS7.5仿《问答库》题库问答学习平台网站源码 带手机版

【刷题记录】21. 合并两个有序链表

Leetcode skimming: dynamic programming 07 (different binary search trees)

【阅读笔记】《深度学习》第一章:引言

Binary tree visualization

解决Win10账户没有了管理员权限

iMeta | Sangerbox: 交互式整合临床生信分析平台

Wechat campus maintenance application applet graduation design finished product of applet completion work (3) background function

IP地址的概念
随机推荐
Global configuration and page configuration of wechat applet development
NPM semantic version control, solution console prop being mutated: "placement" error
鸿蒙-大喵计算画板-简介
浅谈接口加密
[wp]ctfshow-web入门-爆破
北航等《深度学习事件抽取》文献综述论文,27页pdf阐述当前趋势
Common misunderstandings caused by a time reporting assistant of Blue Bridge Cup basic questions
[hdlbits questions] Verilog language (3) modules: hierarchy section
TypeError: ‘str‘ object is not callable的错误原因
高效生成接口文档好方法
网络数据包多层传输演示
FPGA based 1080p 60Hz bt1120 interface debugging process record
平衡二叉树
Illegal mix of collations for operation ‘UNION‘(bug记录)
鸿蒙-大喵计算画板-视频
小程序毕设作品之微信校园维修报修小程序毕业设计成品(4)开题报告
Swift 基础 Codable(JSONEncoder JSONDecoder)的使用
【DETR用于3D目标检测】DETR3D: 3D Object Detection from Multi-view Images via 3D-to-2D Queries
Pymoo learning (8):grades
Scala基础【集合01】