当前位置:网站首页>相机内参矩阵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
边栏推荐
- Introduction of this course (Introduction to machine learning)
- [applet development] common components and basic usage details
- 某公司网络设计与规划
- Pymoo learning (8):grades
- Binary tree visualization
- 鸿蒙-大喵计算画板-简介
- 小程序毕设作品之微信校园维修报修小程序毕业设计成品(1)开发概要
- [Detr for 3D object detection] 3detr: an end to end transformer model for 3D object detection
- 【DETR用于3D目标检测】DETR3D: 3D Object Detection from Multi-view Images via 3D-to-2D Queries
- JS learning notes 16: switching pictures small project practice
猜你喜欢

高端旗舰投影仪选购指南:当贝X3 Pro、当贝F5观影更沉浸!

An idea of solving div adapting to screen

InTouch advanced alarm (alarm filtering)

How to analyze qiime2 after obtaining picrust2 results

Actual combat of MySQL database design project of online mall system

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

蓝桥杯基础练习——矩阵的回形取数(C语言)

伺服驱动器在机器人上的研究与应用

QIIME2得到PICRUSt2结果后如何分析

Network design and planning of a company
随机推荐
Common development software download addresses
Introduction to web security ICMP testing and defense
帝国CMS整站|手机号/QQ靓号商城源码|适配移动端
KCon 2022 亮点及议程大揭秘!
Kcon 2022 highlights and agenda revealed!
GBASE 8s UDR内存管理_02_mi_dalloc
Global configuration and page configuration of wechat applet development
i3-status 配置
Improvement of wechat applet 29 hot search list ②
Imeta | sangerbox: interactive integrated clinical information analysis platform
Pymoo learning (6): termination conditions
Use of swift basic codable (jsonencoder jsondecoder)
微信小程序10-微搭模板
AAAI 2022 | GAN的结构有“指纹”吗?从伪造图像溯源生成网络结构
小程序毕设作品之微信校园维修报修小程序毕业设计成品(8)毕业设计论文模板
Wxss template style and WXS scripting language for wechat applet development
鸿蒙-大喵计算画板-视频
Istio exposes applications to the Internet
【DETR用于3D目标检测】3DETR: An End-to-End Transformer Model for 3D Object Detection
C# 合并集合