栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

python-opencv实现pinhole相机图像转fisheye相机图像

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

python-opencv实现pinhole相机图像转fisheye相机图像

dstImg np.zeros(img.shape, np.uint8) ux, uy w/2, h/2 # 传统图像的主点 principle point 也是鱼眼的主点 因为同分辨率的 for i in range(h): for j in range(w): dx, dy j-ux, i-uy # 传统图像的图像坐标 rc np.sqrt(dx**2 dy**2) # distance between the image point and the principal point theta np.arctan2(rc, self.focal_length) # θ is the angle between the principal axis and the incoming ray gama np.arctan2(dy, dx) # 图像点到图像主点的连线的角度 鱼眼和传统都一样 rf self.focal_length*theta xf rf*np.cos(gama) yf rf*np.sin(gama) x int(xf ux) # 原图j对应鱼眼的x y int(yf uy) # 原图i对应鱼眼的y dstImg[y][x] img[i][j] # cv2.imshow( a , dstImg) # cv2.waitKey() return(dstImg)
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/267869.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号