opencv不失真图像带有一个奇怪的圆圈 [英] opencv undistortion image with a strange circle

查看:195
本文介绍了opencv不失真图像带有一个奇怪的圆圈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用opencv针孔模型来计算校准参数,然后使图像不失真。
问题是,未失真的图像中有一个奇怪的圆圈,如下所示。

I tried to use opencv pinhole model to calculate calibration params and then undistort images. The problem is, there is a strange circle in the undistorted image as below.

代码,原始图像和结果图像位于此处

The code, original and result images are here:

任何评论将不胜感激。

推荐答案

校准是一项比看起来更困难的任务。我认为主要问题是您仅在图像中心显示目标,因此失真参数发现了这种奇怪的参数优化。有趣的是,您可以优化哪些参数以及使用哪些标志(OpenCV的校准功能可以找到很多参数:fx,fy,cx,cy,k1,k2,p1,p2, k3,k4,k5,k6,s1,s2,s3,s4 ...)。

The calibration is a more difficult task than it looks first. I think the main problem is that you show the target in the center of the image only, so the distortion parameters have found this weird parameter optimization. What would be interesting to know is which parameters you allow to optimize and with which flags (there are a lot of parameters that can be found with calibration functions of OpenCV: fx,fy,cx,cy,k1,k2,p1,p2,k3,k4,k5,k6,s1,s2,s3,s4...).

我建议以下内容:

-在屏幕的所有部分尝试使用更多的图像,如果可能的话,请删除相当不错的图像压缩

-购买粘合纸,在其上打印目标,然后将其粘贴在一块玻璃上,再也不用担心纸板了。

-您可以稍微提高校准效果目标和拐角检测,请查看 findChessboardCornersSB 的文档。

-也许减少OpenCV估计的参数数量可能有助于规范化。在我的情况下,我将k3 = k4 = k5 = k6 =0。这是通过为失真系数( distCoeffs )提供一个带有零的矢量并给出标志CALIB_FIX_K3来实现的, CALIB_FIX_K4,等等。查看其他标志是否可以应用于您的系统(例如CALIB_FIX_ASPECT_RATIO)。

I would suggest the following:
- Try with more images, in all parts of the screen, if possible remove the image compression which is quite strong in your images.
- Buy adhesive paper, print the target on it and glue it on a piece of glass, forget about the cardboard.
- You can slightly improve the calibration target and the corner detection, look at the documentation of findChessboardCornersSB.
- Maybe reducing the number of parameters estimated by OpenCV could help to regularize. In my case I set k3 = k4 = k5 = k6 = 0. This is done by providing a vector with zeros for the distortion coefficients (distCoeffs) and give the flags CALIB_FIX_K3, CALIB_FIX_K4, etc. Look whether some other flags could apply to your system (e.g. CALIB_FIX_ASPECT_RATIO).

这篇关于opencv不失真图像带有一个奇怪的圆圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆