fisheye

OpenCV undistorts only a central part of fisheye image

只谈情不闲聊 提交于 2019-11-28 02:06:29
I'm trying to perform fisheye camera calibration via OpenCV 3.4.0 (C++, MS Windows). I used cv::fisheye::calibrate to make K and D (camera matrix and radial distortion coeffitients matrix). Then I used cv::fisheye::initUndistortRectifyMap to produce maps for X and Y coordinates. And finally I used cv::remap to undistort image from fisheye camera via maps from initUndistortRectifyMap. Everything looks right, but OpenCV dewarps only a central part of fisheye image. Edges are moved outside. I'd like to dewarp the whole image. I tried to change focal length in K matrix manually, and got

OpenCV fisheye calibration cuts too much of the resulting image

社会主义新天地 提交于 2019-11-27 23:52:36
问题 I am using OpenCV to calibrate images taken using cameras with fish-eye lenses. The functions I am using are: findChessboardCorners(...); to find the corners of the calibration pattern. cornerSubPix(...); to refine the found corners. fisheye::calibrate(...); to calibrate the camera matrix and the distortion coefficients. fisheye::undistortImage(...); to undistort the images using the camera info obtained from calibration. While the resulting image does appear to look good (straight lines and

Getting Zend_Navigation menu to work with jQuery's Fisheye

拜拜、爱过 提交于 2019-11-27 11:30:46
I'm using Zend_Navigation (sweet addition to the framework, btw) to build my menu, after which it should be rendered in the page (self-evidently). I first set the container somewhere in the controller: // $pages is the array containing all page information $nav = new Zend_Navigation($pages); $this->view->navigation($nav); Then, in the layout, it is rendered like this: echo $this->navigation()->menu(); which works perfectly. Now: I want the menu to be rendered a little differently. The page I'm building uses the jQuery Fisheye-plugin to build a Mac-like Dock-menu. However, this plugin needs a

OpenCV undistorts only a central part of fisheye image

一世执手 提交于 2019-11-26 23:38:20
问题 I'm trying to perform fisheye camera calibration via OpenCV 3.4.0 (C++, MS Windows). I used cv::fisheye::calibrate to make K and D (camera matrix and radial distortion coeffitients matrix). Then I used cv::fisheye::initUndistortRectifyMap to produce maps for X and Y coordinates. And finally I used cv::remap to undistort image from fisheye camera via maps from initUndistortRectifyMap. Everything looks right, but OpenCV dewarps only a central part of fisheye image. Edges are moved outside. I'd

How to simulate fisheye lens effect by openCV?

故事扮演 提交于 2019-11-26 17:33:26
I am looking for ways to create fisheye lens effect, looked at documentations for openCV, it looks like it contains Camera Calibration functions for radial distortions like fisheye. Is it possible to simulate fisheye distortion by openCV? If it is possible to do it by openCV, comparing to openGL, which one will generate better results? Thanks. I created this app using opencv. Is this the effect you are referring to? I basically coded the formula shown on wikipedia's "Distortion(optics)" I can show the code if needed Update : OK, so below is the actual code written in c++ using opencv (not

OpenGL实现鱼眼扭曲

谁说我不能喝 提交于 2019-11-26 10:17:31
这篇文章主要讲用opengl如何实现鱼眼扭曲。用opengl实现鱼眼扭曲在顶点着色器和片段着色器中都可以实现,只是如果在顶点着色器中实现,需要大量的三角形;所以从性能的角度出发,一般在片段着色器中实现鱼眼。 在片段着色器中实现鱼眼的步骤如下: (1): 设定纹理坐标(0.5, 0.5)为图片的中心点 (2): 在片段着色器中计算出当前纹理坐标和中心点纹理坐标之间的角度,步骤如下: 1. 用当前纹理坐标减去中心点纹理坐标,得到一个新的纹理坐标P 2. 将新的纹理坐标P的y值和x值,传入shader自带的atan函数,计算出角度 (3): 计算出当前纹理坐标和中心点纹理坐标之间的距离: radius = sqrt(p.x * p.x + p.y * p.y) (4): 对radius的值适当调整,比如:radius = pow(radius, 0.9); (5): 根据现有的radius,角度,使用三角形正弦和余弦公式,计算出一个新纹理坐标P,如下: p.x = radius * cos(theta); p.y = radius * sin(theta); (6): 这个新的纹理坐标P还不能直接使用,需要对x值和y值分别加上0.5 以上是鱼眼扭曲的基本步骤,在我的github中有专门的demo, 地址: fishEye ,有兴趣的同学可以参考下,希望对你有所帮助。 来源:

How to simulate fisheye lens effect by openCV?

给你一囗甜甜゛ 提交于 2019-11-26 06:06:33
问题 I am looking for ways to create fisheye lens effect, looked at documentations for openCV, it looks like it contains Camera Calibration functions for radial distortions like fisheye. Is it possible to simulate fisheye distortion by openCV? If it is possible to do it by openCV, comparing to openGL, which one will generate better results? Thanks. 回答1: I created this app using opencv. Is this the effect you are referring to? I basically coded the formula shown on wikipedia's "Distortion(optics)"