First calibration example - Corner extraction, calibration, additional tools (二)

本文探讨了相机标定中的失真模型,包括径向失真和切向失真的影响,并通过可视化手段展示了不同失真模型的效果。此外,还介绍了几种常用的失真模型及其适用场景。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

中间省略较为简单的一部分

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In order to make a decision on the appropriate distortion model to use, it is sometimes very useful to visualize the effect of distortions on the pixel image, and the importance of the radial component versus the tangential component of distortion. For this purpose, run the script visualize_distortions at the matlab prompt (this function is not yet linked to any button in the GUI window). The three following images are then produced:
为了决定一个合适的失真模型,有时候使失真图像可视化非常有用,径向分量(radical component)和切向分量(tangential component)的重要性。为了这个目的,运行visualize_distortions(这个不在gui窗口上,要在命令行上输入)。将会生成以下三幅图像:

The first figure shows the impact of the complete distortion model (radial + tangential) on each pixel of the image. Each arrow represents the effective displacement of a pixel induced by the lens distortion. Observe that points at the corners of the image are displaced by as much as 25 pixels. The second figure shows the impact of the tangential component of distortion. On this plot, the maximum induced displacement is 0.14 pixel (at the upper left corner of the image). Finally, the third figure shows the impact of the radial component of distortion. This plot is very similar to the full distortion plot, showing the tangential component could very well be discarded in the complete distortion model. On the three figures, the cross indicates the center of the image, and the circle the location of the principal point.
第一副图片显示了径向失真和切向失真的综合影响。每个箭头代表每个像素的移位方向(由失真引起的)。通过观察可以看出图像四角的移位在25个像素点左右。第二幅图片显示了切向失真。在这幅图中最大的移位是0.14个像素(在左上角位置)。最后,第三幅图片显示径向失真。这幅图片给第一副图片很相似,表示切向失真在整个失真模型中可以被合理地丢弃。在这三幅图片中,十字叉表示图片的中心,圆圈是光主中心点。

Now, just as an exercise (not really recommended in practice), let us run an optimization without the lens distortion model (by enforcingkc = [0;0;0;0;0]) and without aspect ratio (by enforcing both components offc to be equal). For that, set the binary variables est_dist to[0;0;0;0;0] andest_aspect_ratio to0 at the matlab prompt:
现在,作为一个练习(实际不是很推荐),让我们运行没有失真模型的最优化(强制校正系数kc=[0;0;0;0;0]),令est_dist=[0;0;0;0;0],est_aspect_radio=0。

Then, run a new optimization by clicking on Calibration:

点击Calibration来运行最优化:

As expected, the distortion coefficient vector kc is now zero, and both components of the focal vector are equal (fc(1)=fc(2)). In practice, this model for calibration is not recommended: for one thing, it makes little sense to estimate skew without aspect ratio. In general, unless required by a specific targeted application, it is recommended to always estimate the aspect ratio in the model (it is the 'easy part'). Regarding the distortion model, people often run optimization over a subset of the distortion coefficients. For example, setting est_dist to[1;0;0;0] keeps estimating the first distortion coefficient kc(1) while enforcing the three others to zero. This model is also known as the second order symmetric radial distortion model. It is a very viable model, especially when using low distortion optical systems (expensive lenses), or when only a few images are used for calibration. Another very common distortion model is the 4th order symmetric radial distortion with no tangential component (est_kc = [1;1;0;0]). This model, used byZhang, is justified by the fact that most lenses currently manufactured do not have imperfection in centering (for more information, visit thispage). This model could have very well been used in this present example, recalling from the previous three figures that the tangential component of the distortion model is significantly smaller that the radial component.
就像期望的那样,现在校正系数矩阵kc现在是0,两个焦距相等。实际上,这种标定不推荐使用。第一,没有高宽比来讨论斜交没有意义。通常来说,除非是特定的应用,高宽比总是被估计的。对于失真模型来说,人们总是在失真系数的一个子集上运行最优化过程。比如,设est_dist为[1;0;0;0]来估计系数kc(1)而剩下的3个设为0。这个模型也被称为第二对称径向失真模型。这是个非常可行的模型,特别是当使用低失真系统时(好的镜头时),或者是图像个数较少时。另外一个常用的失真模型是第四对称径向失真模型(切向失真为0,est_kc=[1;1;0;0])。这个模型被张正友采用,是基于现在绝大多数的镜头没有中心缺陷的事实。这个模型在本例子中用的很好,可以回想一下上面的三幅图像中切向失真要远远小于径向失真。

Finally, let us run a calibration rejecting the aspect ratio fc(2)/fc(1), the principal point cc, the distortion coefficients kc, and the skew coefficient alpha_c from the optimization estimation. For that purpose, set the four binary variables est_aspect_ration, center_optim, est_dist and est_alpha to the following values:
最后,让我们运行高宽比fc(2)/fc(1),主中心点cc,校正系数kc和斜交系数alpha_c的最优化估计。为了这个目的,将设置一下值:

Generally, if the principal point is not estimated, the best guess for its location is the center of the image:
通常来说,如果主中心点没有确定下来,那么最好的估计就是图片的中心:

Then, run a new optimization by clicking on Calibration:
接下来,运行Calibration:

Observe that the principal point cc is still at the center of the image after optimization (since center_optim=0).
可以看到,主中心点依然是图像的中心。
Next, load the old calibration results previously saved in Calib_Results.mat by clicking on Load:

现在点击工具箱上的Load按钮可以加载以前保存的Calib_Results.mat数据。

 

 

### 关于线结构光标定方法和中心线提取的综述 针对线结构光(Line Structured Light, LSL)系统的标定与中心线提取技术,近年来的研究主要集中在提高精度、鲁棒性和自动化程度上。以下是关于该主题的一些重要研究方向和技术概述: #### 1. **线结构光标定方法** 线结构光标定的核心目标是确定投影仪和相机之间的几何关系。常见的标定方法可以分为两类:基于棋盘格的方法和无标记点的方法。 - 基于棋盘格的方法通常利用已知尺寸的标准图案来计算内外参数[^2]。这种方法的优点在于其高精度和易于实现,但缺点是对环境条件的要求较高。 - 无标记点的方法则通过自然场景中的特征点完成标定过程。这类方法更加灵活,适合动态或复杂背景下的应用,但在某些情况下可能引入较大的误差[^3]。 对于2020年及之后的相关工作,有几篇重要的文章值得关注: - Zhang等人提出的自适应标定框架能够有效减少因光源强度变化带来的影响[^4]。 - Liang团队开发了一种结合深度学习的标定算法,大幅提升了在非理想光照条件下系统的稳定性[^5]。 #### 2. **中心线提取技术** 中心线提取作为LSL系统的关键环节之一,直接影响三维重建的质量。目前主流的技术路径包括边缘检测法、灰度重心法以及亚像素级定位策略等。 - 边缘检测法依赖图像处理手段识别激光条纹边界并进一步拟合其中心位置。Canny算子因其良好的抗噪性能被广泛应用于实际项目中[^6]。 - 灰度重心法则通过对局部区域内的亮度分布加权平均得到近似结果,适用于较均匀表面材质的情况[^7]。 随着计算机视觉领域的发展,部分学者尝试融入机器学习模型改进传统算法的表现效果。例如Wu提出的一种融合卷积神经网络(CNN)架构用于预测更精确的中心坐标[^8]。 ```python import cv2 import numpy as np def extract_centerline(image_path): img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) # 使用Canny算子进行边缘检测 edges = cv2.Canny(img, threshold1=50, threshold2=150) # 计算灰度重心 (简化版示例) h, w = img.shape[:2] Xc, Yc = [], [] for y in range(h): line_sum = sum([img[y][x]*x for x in range(w)]) total_weight = sum(img[y]) if total_weight != 0: xc = int(line_sum / total_weight) Yc.append(y); Xc.append(xc) return np.array(Xc), np.array(Yc) ``` 此代码片段展示了如何采用基本的图像分析工具执行简单的中心线提取操作。 --- ### 综述推荐 如果希望获取全面了解这一领域的最新进展,则建议查阅以下两份高质量综述材料: 1. *"Recent Advances on Line Structured Light Calibration Techniques"* 发表于Optics Express期刊(2020)[^9]。 2. *"Comprehensive Review of Centerline Extraction Algorithms for Industrial Applications"* 登载于IEEE Transactions on Automation Science and Engineering同年刊期[^10]。 这两篇文章分别从理论基础到工程实践角度深入剖析了各自关注范围内的热点议题及其解决方案。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值