当前位置:网站首页>相机内参矩阵K和fov的相互转换
相机内参矩阵K和fov的相互转换
2022-07-25 19:29:00 【Rusian_Stand】
1、理论知识


从图可以很直观的看出fov_y 焦距f和图像高之间的关系,tan(fov_y/2) = 2/h / fy.所以正反向的转换过程就很直接。f以pixel为单位。
2、代码
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):
#计算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
边栏推荐
- Solve the problem that the win10 account has no administrator rights
- SDL text display
- modelsim和quartus联合仿真PLL FIFO等IP核
- [record of question brushing] 21. Merge two ordered linked lists
- Talk about 15 tips of SQL optimization
- Alibaba cloud free SSL certificate application detailed process
- Introduction to web security ICMP testing and defense
- Imperial cms7.5 imitation "question and answer library" question and answer learning platform website source code with mobile version
- [applet development] common components and basic usage details
- Kcon 2022 highlights and agenda revealed!
猜你喜欢

鸿蒙-大喵计算画板-简介

JS basic type reference type deep / shallow clone copy

Improvement of wechat applet 28 hot search list ①

Hongmeng - Damiao computing Sketchpad - Introduction

Full scale and Xuan of C key

【DETR用于3D目标检测】3DETR: An End-to-End Transformer Model for 3D Object Detection

哈希无向图可视化

IP地址的概念

Talk about 11 tips for interface performance optimization

modelsim和quartus联合仿真PLL FIFO等IP核
随机推荐
ML的编程技巧:
485 current acquisition module dam-8041
Basic music theory -- configuring chords
六轴传感器使用学习记录
帝国CMS整站|手机号/QQ靓号商城源码|适配移动端
微信小程序开发之网络数据请求
【DETR用于3D目标检测】DETR3D: 3D Object Detection from Multi-view Images via 3D-to-2D Queries
Juzhi cloud computing opens a new era to the "proprietary cloud" of Youfu network
Use of swift basic codable (jsonencoder jsondecoder)
由一个蓝桥杯基础题报时助手而引出的常见误区
网络数据包多层传输演示
Day7:有序二叉树(二叉搜索树)
[applet development] common components and basic usage details
TypeError: ‘str‘ object is not callable的错误原因
[applet development] detailed explanation of host environment
telnet安装以及telnet(密码正确)无法登录!
Introduction of this course (Introduction to machine learning)
Empire CMS whole station | mobile number /qq lianghao mall source code | suitable for mobile terminal
哈希无向图可视化
Pymoo learning (6): termination conditions