Print

发布时间: 2018-10-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.170680
2018 | Volume 23 | Number 10




    计算机图形学    




  <<上一篇 




  下一篇>> 





圆形标志投影偏心差补偿算法
expand article info 吴建霖, 蒋理兴, 王安成, 谷友艺, 于彭
战略支援部队信息工程大学, 郑州 450001

摘要

目的 圆形标志目前正广泛地应用于各类视觉测量系统, 其圆心定位精度决定了测量系统的测量精度。当相机主光轴与标志表面不平行时, 圆被映射为椭圆, 圆心位置计算产生偏差。光轴与标志表面夹角较大或标志较大等情况下会产生较大的偏心差进而严重影响系统测量精度。为此, 提出一种基于三同心圆圆形标志的投影偏心差补偿算法。方法 算法基于三同心圆的圆形标志设计, 根据3组椭圆拟合中心坐标解算偏心差模型进行计算补偿。结果 针对圆形标志偏心差问题, 同心圆补偿算法取得良好效果, 有效提升了圆形标志定位精度。仿真结果表明, 在拍摄角度、拍摄距离、圆形标志大小不同的情况下, 偏心差在像素量级, 补偿后偏心差在10-11像素量级。实物实验结果表明, 若设计有直径分别为6 cm, 12 cm, 18 cm的三同心圆标志, 经解算补偿结果较以往两同心圆算法精度提高一倍, 偏心差值减小80%, 测量误差在0.1 mm左右。结论 本文提出了一种新的偏心差补偿算法, 利用三同心圆标志增加约束解算偏心差。与以往偏心差补偿算法相比, 此方法精度更高, 且无需预先平差解算相机与目标的距离、拍摄角等参数, 仅需要知道标志圆形半径比例及椭圆中心坐标即可计算补偿, 具有很高的实用性, 可用于改善基于非编码标志点的深度像匹配、基于圆形标志点的全自动相机标定方法、视觉导航定位等应用中。

关键词

偏心差; 三同心圆; 椭圆拟合; 像点误差; 视觉定位

Eccentricity error compensation for circular targets
expand article info Wu Jianlin, Jiang Lixing, Wang Ancheng, Gu Youyi, Yu Peng
Strategic Support Force Information Engineering University, Zhengzhou 450001, China

Abstract

Objective Currently, circular target is widely used in a multitude of vision measurement systems in which center positioning accuracy determines the accuracy of the measuring system.The projection of a circular feature is generally an ellipse and not a true circle because the main optical axis of a camera is not parallel with the feature surface.When the angle between the main optical axis of a camera and the feature surface is large, the eccentricity error will affect the accuracy of the measurement system extremely.Most of the research on eccentricity errors in the last two decades has examined quite a few methods and conducted experiments to derive the mechanism of eccentricity and attempted to correct the errors.Incidentally, the past studies used geometric parameters to calculate the eccentricity errors, which increased the complexity of the process.This paper introduces a new method for correcting the eccentricity error with the help of the three concentric circle targets. Method Most algorithms for eccentricity errors usually involve several geometric parameters, and calibration and bundle adjustment are always required to obtain these parameters.These algorithms increase the computational complexity and reduce the rate of convergence.Our method designs three concentric circles as the target, which has common center coordinates in the object plane and different centers in the image plane, which are on a line.The moment invariants of Zernike moment are used for the edge detection of the pixel level to obtain the precise positioning of the sub-pixel level edge.The center of the ellipse is determined with the least-square ellipse fitting.To achieve better results, the images of the concentric circle targets should include at least 20 pixels to ensure sufficient effective edge points.The ellipse center is easily calculated with the sub-pixel level edge, then we can use the three groups of ellipse centers to calculate the eccentricity error model.The three concentric circles in the error equation have the same six parameters.Thus, the corresponding parameters can be set into blocks as new variables, which in turn can be reduced to three unknown parameters.The error equations can be sufficiently solved with the help of the three concentric circles.Through the formulas derived in this study, the eccentricity errors can be solved completely.Obtaining geometrical parameters should be avoided and the nonlinear model should be solved. Result A possible solution for the correction of this systematic eccentricity error is proposed in this paper.The method can effectively improve the positioning accuracy of the circular target center.Simulation experiment results by using MATLAB show that the eccentricity errors can be compensated from the pixel level to the 10-11-pixel level when the targets are photos taken in different angles, distances, and sizes of the targets.This study designs a target that has three concentric circles and diameters of 6, 12, and 18 cm.To calculate the true center of the circles, a circle with a size of 2 mm is designed in the central area of the target.During image processing, we use the improved gray barycenter localization algorithm to calculate the center of the small circle.By comparison, its radius is extremely small, and the simulation experiment shows that its eccentric error is only 0.02 pixels, which can be ignored compared with the three concentric circles used in the experiment and regarded as the true value in the experiment.Experiment results show that the measurement errors can be controlled at 0.1 mm.Relative to the concentric circles method, the accuracy is two times than that of before and the eccentricity error is decreased by approximately 80%. Conclusion This paper presents a new eccentricity compensation method for calculating eccentricity error by using three concentric circle targets to add constraint.Unlike in previous eccentricity error correction methods, additional parameters should be estimated to correct the eccentricity error.Consequently, the computation complexity increases and convergence speed decreases.Prior knowledge about the geometric parameters of the measurement system (target and camera) are not needed; rather, the proportional relationship of the circles and ellipse center coordinates are the only information required.The experiment results show the efficiency of the proposed method for eccentricity error compensation.The algorithm can improve the location efficiency of circular targets.Consequently, the algorithm can enhance the effect on depth image matching that is based on non-coding markers, the precision of the automatic camera calibration method that is based on circular markers, and the robustness of the navigation and positional system.

Key words

eccentricity error; three concentric circles; ellipse fitting; image measurement errors; visual location

0 引言

在各类使用圆形人工标志的视觉测量系统中,圆形标志的中心定位精度直接影响系统整体的测量精度[1]。随着制造业迅猛发展,工程中对测量精度的要求越来越高,例如先进的数字工业摄影测量系统单点测量精度可达微米级,但随着量测尺寸增大,误差迅速增加。当相机主光轴与目标平面不垂直时,圆形标志的像为椭圆,而通常所使用的椭圆中心与标志圆心所成的像没有重合,存在偏差。当标志较大时,偏差尤为明显。因此,如何准确高效地进行偏心差补偿,成为值得关注的科学问题。

近年来,已有部分学者试图提出一些方法来减小偏心差对系统测量精度的影响。Dold[2]研究了不同大小的反光标志对测量的精度影响,证明了平差对偏心差有一定消除作用,但是对于较大的反光标志偏心差仍难以消除。Ahn等人[3]给出了完整的圆形标志偏心差的数学推导过程。Heikkila等人[4]从投影锥与目标平面和像平面之间的空间关系得出了投影偏差的计算式。廖祥春等人[5]从摄影测量的主合点与两平面的关系得出了偏差的计算方法, 并给出了模拟的计算结果。Zhang等人[6]推导了偏心差的模型,并模拟计算了不同情况下的偏心差。但上述模型均直接利用了空间几何关系,导致解析表达式和计算结果均较复杂。黄道明[7]直接从摄影测量的投影模型出发,推导出了偏心差计算的解析表达式,并模拟加入噪声计算不同情况下的偏心量,根据其实验结果推得若相机的成像平面与目标平面倾斜的角度大于某一角度临界值,其投影偏心差会迅速增大。李占利等人[8]通过分析透视投影过程中的像点误差,提出了一种计算圆中心像点的方法,其根据双目立体成像原理,根据标记目标的匹配关系进行空间圆法向的选取,从而得到与空间圆平行的圆平面,通过平行圆的圆心计算空间圆的圆心像点坐标。He等人[9]提出了同心圆的反光标志,对已有的偏心差模型做近似处理成线性模型进行求解。

以往大多数的偏心差校正算法在误差校正方程中一般都会涉及一些几何参数,而这些参数都需要标定或者光束法平差后才能得到,这会增加计算复杂度,降低收敛速度。He等人的方法虽然避免了对几何参数的求取,但是对于非线性的偏心差使用了线性模型来补偿。

一方面尽量避免几何参数的使用,另一方面对偏心差模型完全求解,基于以上两点需求,本文提出了一种三同心圆的偏心差补偿算法,利用三同心圆构造3个约束,对偏心差原始模型求解,根据三同心圆的3个圆心坐标解算偏心差,仿真实验中偏心差近乎为零。

1 圆形标志偏心差模型及补偿算法

1.1 圆形标志偏心差模型

圆形标志的偏心差形成过程如图 1所示,Ahn等人[3]给出了完整的圆形标志偏心差的数学推导过程。

图 1 坐标系和偏心差
Fig. 1 Co-ordinate systems and eccentricity errors ((a)object co-ordinate system and image co-ordinate system; (b)common side view of object and image planes)

选择合适的物空间辅助坐标系$xyz$,圆形标志在$xy$平面内,圆心在$x = {x_p}$处。相机光心$O'$$yz$平面内,$O'$$xyz$坐标系原点$O$的连线与$z$轴夹角为$\alpha $,距离为$d$。摄像机的光轴垂直于$x$轴。$\omega $$z$轴与$z'$轴夹角,即圆形标志法向量与光轴夹角。图 1(b)中可观察到偏心差$\varepsilon $。如果像平面$IP$和物平面$OP$不平行,那么圆形标志的圆心$C$在像平面上就不会与椭圆中心$B'$重合,而是在$C'$处。同样,像平面上的$B'$在物平面上对应的也不是$C$而是$B$

圆形标志圆心$C$对应的像点$C'$的坐标为

$ {{u'}_{C'}} = u'\left| {_{y = z = 0}^{x = {x_p}}} \right. = \frac{{c{x_p}}}{{d\cos \left( {\omega - \alpha } \right)}} $ (1)

$ {{v'}_{C'}} = v'\left| {_{y = z = 0}^{x = {x_p}}} \right. = - c\tan \left( {\omega - \alpha } \right) $ (2)

像平面椭圆中心点$B'$坐标为

$ \begin{array}{*{20}{c}} {{{u'}_{B'}} = \frac{1}{2}\left( {{{u'}_1} + {{u'}_2}} \right)\left| {_{v' = {{v'}_B}}} \right. = }\\ {\frac{{c{x_p}d\cos \left( {\omega - \alpha } \right)}}{{{d^2}{{\cos }^2}\left( {\omega - \alpha } \right) - {r^2}{{\sin }^2}\omega }}} \end{array} $ (3)

$ \begin{array}{*{20}{c}} {{{v'}_{B'}} = }\\ { - c\frac{{{d^2}\sin \left( {\omega - \alpha } \right)\cos \left( {\omega - \alpha } \right) + {r^2}\sin \left( \omega \right)\cos \left( \omega \right)}}{{{d^2}{{\cos }^2}\left( {\omega - \alpha } \right) - {r^2}{{\sin }^2}\left( \omega \right)}}} \end{array} $ (4)

图 1(b)观察可知,偏心差$\varepsilon $应为$B'C'$。所以其坐标可以表示为

$ {\varepsilon _{u'}} = {{u'}_{B'}} - {{u'}_{C'}} = \frac{{c\left( {{x_p}/l} \right){{\sin }^2}\left( \omega \right)}}{{{{\left( {l/r} \right)}^2} - {{\sin }^2}\left( \omega \right)}} $ (5)

$ {\varepsilon _{v'}} = {{v'}_{B'}} - {{v'}_{C'}} = \frac{{c\left( {d/l} \right)\sin \left( \omega \right)\cos \left( \alpha \right)}}{{{{\left( {l/r} \right)}^2} - {{\sin }^2}\left( \omega \right)}} $ (6)

根据式(5)(6)可知,求解偏心差坐标需要已知$c$${x_p}$$l$$\omega $$r$$d$$\alpha $7个参数,这需要先对相机标定和空间点坐标光束法平差求解才能得到所有参数具体数值,而使用这7个参数计算偏心差进行补偿校正后,为了获得更精确的坐标解通常会再次进行平差处理,该过程计算步骤复杂且误差影响不易评判。

在文献[9]的基础上,本文进一步提出不对偏心差模型做近似而是直接进行求解的方法,下一节将做具体推导。

1.2 三同心圆标志偏心差模型及解算

模型采用三同心圆标志作为测量点标志。当3个同心圆投影成3个椭圆,每个椭圆中心都不重合,同心圆中心像点为同一像点。根据文献[3]中总结的偏心差规律,各椭圆中心与圆形标志真实像点都在一条直线上。三同心圆标志可视为3个$c$${x_p}$$l$$\omega $$r$$d$$\alpha $参数都相同的圆形标志。根据式(5)(6)列出3组方程

$ \left\{ \begin{array}{l} {\varepsilon _{{{u'}_1}}} = {{u'}_{{{B'}_1}}} - {{u'}_{C'}} = \frac{{c\left( {{x_p}/l} \right){{\sin }^2}\left( \omega \right)}}{{{{\left( {l/{r_1}} \right)}^2} - {{\sin }^2}\left( \omega \right)}}\\ {\varepsilon _{{{v'}_1}}} = {{v'}_{{{B'}_1}}} - {{v'}_{C'}} = \frac{{c\left( {d/l} \right)\sin \left( \omega \right)\cos \left( \alpha \right)}}{{{{\left( {l/{r_1}} \right)}^2} - {{\sin }^2}\left( \omega \right)}} \end{array} \right. $ (7)

$ \left\{ \begin{array}{l} {\varepsilon _{{{u'}_2}}} = {{u'}_{{{B'}_2}}} - {{u'}_{C'}} = \frac{{c\left( {{x_p}/l} \right){{\sin }^2}\left( \omega \right)}}{{{{\left( {l/{r_2}} \right)}^2} - {{\sin }^2}\left( \omega \right)}}\\ {\varepsilon _{{{v'}_2}}} = {{v'}_{{{B'}_2}}} - {{v'}_{C'}} = \frac{{c\left( {d/l} \right)\sin \left( \omega \right)\cos \left( \alpha \right)}}{{{{\left( {l/{r_2}} \right)}^2} - {{\sin }^2}\left( \omega \right)}} \end{array} \right. $ (8)

$ \left\{ \begin{array}{l} {\varepsilon _{{{u'}_3}}} = {{u'}_{{{B'}_3}}} - {{u'}_{C'}} = \frac{{c\left( {{x_p}/l} \right){{\sin }^2}\left( \omega \right)}}{{{{\left( {l/{r_3}} \right)}^2} - {{\sin }^2}\left( \omega \right)}}\\ {\varepsilon _{{{v'}_3}}} = {{v'}_{{{B'}_3}}} - {{v'}_{C'}} = \frac{{c\left( {d/l} \right)\sin \left( \omega \right)\cos \left( \alpha \right)}}{{{{\left( {l/{r_3}} \right)}^2} - {{\sin }^2}\left( \omega \right)}} \end{array} \right. $ (9)

可将式(7)(8)(9)变换为

$ \left\{ \begin{array}{l} {\varepsilon _{{{u'}_1}}} = {{u'}_{{{B'}_1}}} - {{u'}_{C'}} = \\ - \frac{1}{2}c\left( {{x_p}/l} \right)\left( {\frac{1}{{\frac{l}{{{r_1}\sin \left( \omega \right)}} + 1}} - \frac{1}{{\frac{l}{{{r_1}\sin \left( \omega \right)}} - 1}}} \right)\\ {\varepsilon _{{{v'}_1}}} = {{v'}_{{{B'}_1}}} - {{v'}_{C'}} = \\ \frac{1}{2}\left( {\frac{{c\left( {d/l} \right)\cot \left( \omega \right)}}{{1 - l/\left( {{r_1}\sin \left( \omega \right)} \right)}} + \frac{{c\left( {d/l} \right)\cos \left( \omega \right)}}{{1 + l/\left( {{r_1}\sin \left( \omega \right)} \right)}}} \right) \end{array} \right. $ (10)

$ \left\{ \begin{array}{l} {\varepsilon _{{{u'}_2}}} = {{u'}_{{{B'}_2}}} - {{u'}_{C'}} = \\ - \frac{1}{2}c\left( {{x_p}/l} \right)\left( {\frac{1}{{\frac{l}{{{r_2}\sin \left( \omega \right)}} + 1}} - \frac{1}{{\frac{l}{{{r_2}\sin \left( \omega \right)}} - 1}}} \right)\\ {\varepsilon _{{{v'}_2}}} = {{v'}_{{{B'}_2}}} - {{v'}_{C'}} = \\ \frac{1}{2}\left( {\frac{{c\left( {d/l} \right)\cot \left( \omega \right)}}{{1 - l/\left( {{r_2}\sin \left( \omega \right)} \right)}} + \frac{{c\left( {d/l} \right)\cos \left( \omega \right)}}{{1 + l/\left( {{r_2}\sin \left( \omega \right)} \right)}}} \right) \end{array} \right. $ (11)

$ \left\{ \begin{array}{l} {\varepsilon _{{{u'}_3}}} = {{u'}_{{{B'}_3}}} - {{u'}_{C'}} = \\ - \frac{1}{2}c\left( {{x_p}/l} \right)\left( {\frac{1}{{\frac{l}{{{r_3}\sin \left( \omega \right)}} + 1}} - \frac{1}{{\frac{l}{{{r_3}\sin \left( \omega \right)}} - 1}}} \right)\\ {\varepsilon _{{{v'}_3}}} = {{v'}_{{{B'}_3}}} - {{v'}_{C'}} = \\ \frac{1}{2}\left( {\frac{{c\left( {d/l} \right)\cot \left( \omega \right)}}{{1 - l/\left( {{r_3}\sin \left( \omega \right)} \right)}} + \frac{{c\left( {d/l} \right)\cos \left( \omega \right)}}{{1 + l/\left( {{r_3}\sin \left( \omega \right)} \right)}}} \right) \end{array} \right. $ (12)

参数$c$${x_p}$$l$$\omega $$d$$\alpha $可视为常量,令$K = c\left( {{x_p}/l} \right)$$P = l/\sin \left( \omega \right)$$L = \left( {cd/l} \right)\cot \left( \omega \right)$,并联立方程组(10)(11)(12)求解得

$ \left\{ \begin{array}{l} {P^2} = \\ \frac{{\left( {{{u'}_{{{B'}_1}}} - {{u'}_{{{B'}_3}}}} \right)\left( {r_1^2 - r_2^2} \right)r_3^2 - \left( {{{u'}_{{{B'}_1}}} - {{u'}_{{{B'}_2}}}} \right)\left( {r_1^2 - r_3^2} \right)r_2^2}}{{\left( {{{u'}_{{{B'}_1}}} - {{u'}_{{{B'}_3}}}} \right)\left( {r_1^2 - r_2^2} \right) - \left( {{{u'}_{{{B'}_1}}} - {{u'}_{{{B'}_2}}}} \right)\left( {r_1^2 - r_3^2} \right)}}\\ K = \frac{{{{u'}_{{{B'}_1}}} - {{u'}_{{{B'}_2}}}}}{{\frac{1}{{\frac{{{P^2}}}{{r_1^2}} - 1}} - \frac{1}{{\frac{{{P^2}}}{{r_2^2}} - 1}}}}\\ L = \frac{{ - \left( {{{v'}_{{{B'}_1}}} - {{v'}_{{{B'}_2}}}} \right)}}{{\frac{1}{{\frac{{{P^2}}}{{r_1^2}} - 1}} - \frac{1}{{\frac{{{P^2}}}{{r_2^2}} - 1}}}} \end{array} \right. $ (13)

最后,经改正后的像点$C'$的坐标为

$ \left\{ \begin{array}{l} {u_c} = {{u'}_{{{B'}_1}}} - \frac{1}{2}\left( {\frac{K}{{\frac{P}{{{r_1}}} - 1}} - \frac{K}{{\frac{P}{{{r_1}}} + 1}}} \right)\\ {v_c} = {{v'}_{{{B'}_1}}} - \frac{1}{2}\left( {\frac{K}{{\frac{P}{{{r_1}}} + 1}} - \frac{K}{{\frac{P}{{{r_1}}} - 1}}} \right) \end{array} \right. $ (14)

由式(13)(14)可以看出,与其他算法不同的是本文算法中的坐标只与三同心圆标志半径及3个椭圆中心坐标有关,偏心差仅用三同心圆标志半径即可表示,且基于原始偏心差模型求解,而非近似求解,进一步提高了补偿精度。

2 仿真实验及分析

实验在给定圆形标志的边缘选取若干离散点,利用共线方程计算其在图像上的像点坐标,得到的坐标点集合通过椭圆拟合的方法得到标志图像中心,同时计算出标志中心在像片上的投影点坐标作为真实值,其与椭圆拟合中心坐标的欧氏距离即为椭圆偏心差。

不考虑像主点和相机畸变的影响,共线方程可表示为

$ \left( {\begin{array}{*{20}{c}} X\\ Y\\ Z \end{array}} \right) = \lambda \mathit{\boldsymbol{R}}\left( {\begin{array}{*{20}{c}} x\\ y\\ { - f} \end{array}} \right) + \left( {\begin{array}{*{20}{c}} {{X_s}}\\ {{Y_s}}\\ {{Z_s}} \end{array}} \right) $ (15)

式中,$f$为相机焦距,$\lambda $为比例系数,$\left( {X, Y, Z} \right)$为物方点坐标,$\left( {x, y} \right)$为像点坐标,$\left( {{X_s}, {Y_s}, {Z_s}} \right)$为摄站坐标,$\mathit{\boldsymbol{R}} = \left( {\begin{array}{*{20}{c}} {{a_1}}&{{a_2}}&{{a_3}}\\ {{b_1}}&{{b_2}}&{{b_3}}\\ {{c_1}}&{{c_2}}&{{c_3}} \end{array}} \right)$为旋转矩阵,转角顺序为${R_X}$${R_Y}$${R_Z}$。为便于研究,令$z = 0$,视圆形标志在$XY$平面上。

设圆形标志中心坐标为$\left( {{X_0}, {Y_0}, 0} \right)$,半径为$r$,以极坐标形式表示标志边界点为

$ \left\{ \begin{array}{l} X = {X_0} + r\cos \left( \theta \right)\\ Y = {Y_0} + r\sin \left( \theta \right)\\ Z = 0 \end{array} \right. $ (16)

边界点对应的共线方程记为

$ \left\{ \begin{array}{l} x = - f\frac{{{a_1}\left( {X - {X_s}} \right) + {b_1}\left( {Y - {Y_s}} \right) + {c_1}\left( {Z - {Z_s}} \right)}}{{{a_3}\left( {X - {X_s}} \right) + {b_3}\left( {Y - {Y_s}} \right) + {c_3}\left( {Z - {Z_s}} \right)}}\\ y = - f\frac{{{a_2}\left( {X - {X_s}} \right) + {b_2}\left( {Y - {Y_s}} \right) + {c_2}\left( {Z - {Z_s}} \right)}}{{{a_3}\left( {X - {X_s}} \right) + {b_3}\left( {Y - {Y_s}} \right) + {c_3}\left( {Z - {Z_s}} \right)}} \end{array} \right. $ (17)

$\theta $分为64份,计算64个点坐标,利用所有像点拟合椭圆,并计算椭圆中心点坐标${u_{\rm{e}}}\left( {{x_{\rm{e}}}, {y_{\rm{e}}}} \right)$,并计算标志中心实际对应的像点坐标,计算椭圆偏心差大小为$d = \left\| {{u_{\rm{e}}}-{u_{\rm{c}}}} \right\| = \sqrt {{{\left( {{x_{\rm{e}}}-{x_{\rm{c}}}} \right)}^2} + {{\left( {{y_{\rm{e}}}-{y_{\rm{c}}}} \right)}^2}} $

相机参数按照大恒相机MER-200-20GC设置,焦距$f$=20 mm,其靶面尺寸为1/1.8”,其具体为7.176 mm×5.319 mm,像素数为1 628×1 236,像元尺寸为4.4×4.4 μm,$X_0$=0 mm,$Y_0$=0 mm,$Z_0$=0 mm,$X_s$=1 000 mm,$Y_s$=1 000 mm,$Z_s$=2 000 mm,$R_X$=-30°,$R_Y$=30°,$R_Z$=30°,$r$=30 mm,$r_2$=15 mm,$r_3$=10 mm,暂不考虑相机畸变误差的影响,通过仿真得到圆形标志图像如图 2所示,半径$r_3$=10 mm对应椭圆偏心差大小为0.18 μm,半径$r_2$=15 mm对应椭圆偏心差大小为0.41 μm,半径$r$=30 mm对应椭圆偏心差大小为1.7 μm。

图 2 标志偏心差仿真结果
Fig. 2 The simulation result of target eccentricity errors ((a) three concentric circles target; (b) images of ellipse and eccentricity errors)

由于$f = l/\left( {1 + 1/\beta } \right)$$l = \sqrt {1\;{{000}^2} + 1\;{{000}^2} + 2\;{{000}^2}} $=2.449 5×103 mm,其中系统的放大倍率为$\beta $,物距为$l$$f$=20 mm时,$\beta $=0.008 2,可分辨的景物精度为:像素尺寸/放大倍率=0.004 4/0.008 2=0.536 6 mm,以半径$r_3$=10 mm对应椭圆偏心差大小为0.18 μm为例,0.000 18/0.004 4=0.040 9,误差影响在0.04个像素,高于目前圆心定位的精度0.02个像素,说明了偏心差在高精度测量中是不可以忽略的,且在上述条件下实际图像标志中也有0.536 6×0.04=0.021 9 mm的误差。

经仿真,采用本方法得到3个椭圆中心坐标分别为${u'_{B1'}}$=2.332 0,${v'_{B1'}}$=-0.073 3,${u'_{B2'}}$=2.330 8,${v'_{B2'}}$=-0.073 7,${u'_{B3'}}$=2.330 6,${v'_{B3'}}$=-0.073 7,${P^2}$=1.353 0×107$K$=23.759 0,$L$=-7.349 3,从而得到修正后坐标${u_c}$${v_c}$,其与标志圆心成像点坐标欧氏距离为8.969 2×10-16mm,从而消除了偏心差的影响。

进一步假设$XY$平面内均匀分布11×11个同心圆标志,通过仿真成像可以直观地观察不同角度、不同距离圆形标志椭圆偏心差变化情况。设参数$X_0$=0 mm,$Y_0$=0 mm,$Z_0$=0 mm,$X_s$=2 000 mm,$Y_s$=1 000 mm,$Z_s$=2 000 mm,$R_X$=0°,$R_Y$=45°,$R_Z$=0°,$r$=30 mm,$r_2$=20 mm,$r_3$=10 mm,焦距$f$=20 mm,相机设置不变。以(0, 0, 0)处圆形标志为中心,间隔200 mm设置系列标志。将均匀分布的同心圆标志所成的像部分放大如图 3所示。

图 3 平面内标志椭圆偏心差分布图
Fig. 3 The distribution curve of target eccentricity errors in the same plane

图 3给出了前4行的同心圆标志成像,其中矢量箭头长度及方向代表偏心差的大小及方向,矢量箭头长度适当进行比例放大,方便观察偏心差数值变化。从图 3可以看出,标志越靠近透视轴(像平面和标志平面交线),则椭圆偏心差越大。

由于偏心差受较多因素影响,为分别给出在不同角度、不同拍摄距离、不同标志大小下补偿算法的结果,选取11×11同心圆标志中心处的同心圆标志,设置原有参数不变,改变相机绕$x$轴旋转角度,依次增加5°,直到50°设置原有参数不变,改变$y$轴方向距离,依次增加100 mm,直到2 000 mm。设置原有参数不变,改变同心圆标志半径大小,比例关系不变,最小圆标志半径从10 mm开始依次增加2 mm直到30 mm。图 4给出了上述3个实验的结果,由于算法补偿后偏心差很小与补偿前不是一个数量级,在图 4中补偿后结果几乎为一直线,故补充表 1进行说明。

图 4 不同因素影响下偏心差补偿效果
Fig. 4 Effects of eccentricity errors compensation under different factors((a)different angles; (b)different distances; (c)targets of different sizes)

表 1 不同因素影响下偏心差补偿结果
Table 1 Effects of eccentricity errors compensation under different factors

下载CSV
/像素
序号 不同夹角补偿前/后 不同距离补偿前/后 不同标志大小补偿前/后
1 0.407/0.162×10-11 0.407/0.162×10-11 0.407/0.162×10-11
2 0.448/0.013×10-11 0.412/0.075×10-11 0.586/0.081×10-11
3 0.505/0.042×10-11 0.417/0.162×10-11 0.797/0.168×10-11
4 0.581/0.163×10-11 0.422/0.086×10-11 1.042/0.065×10-11
5 0.682/0.010×10-11 0.428/0.167×10-11 1.318/0.084×10-11
6 0.817/0.408×10-11 0.434/0.085×10-11 1.628/0.121×10-11
7 0.996/0.485×10-11 0.441/0.072×10-11 1.969/0.122×10-11
8 1.234/2.508×10-11 0.448/0.162×10-11 2.344/0.018×10-11
9 1.556/1.752×10-11 0.455/0.323×10-11 2.751/0.121×10-11
10 1.993/1.942×10-11 0.462/0.247×10-11 3.191/0.087×10-11
11 2.595/0.333×10-11 0.470/0.487×10-11 3.663/0.127×10-11

图 4中补偿前后变化对比明显。在表 1中可明显看到补偿前偏心差在像素级或子像素级,而补偿后偏心差在10-11像素级别。

在仿真阶段本文算法获得了非常良好的补偿效果,在摄站距离、拍摄角度、标志半径不同因素的影响下,补偿后偏心差都在10-11像素左右,可认为将偏心差完全消除。

经总结,算法计算步骤如下:

1) 相机采集同心圆标志图像,使用标定参数进行校正。

2) 图形进行预处理,提取椭圆图像部分获取亚像素级边缘。

3) 边缘点进行最小二乘拟合,剔除误差大于阈值的拟合点,进行二次拟合。对拟合椭圆求取中心坐标。

4) 将得到的3组椭圆中心坐标代入式(13)(14),得到补偿结果。

3 实物实验结果与分析

实验拍摄用相机选用工业相机MER-200-20GC,所使用的计算机配置为:CPU:Inter(R) Core(TM) i5-7300HQ CPU @ 2.50 GHz 2.50 GHz,内存:8.0 GB,显卡:NVIDIA GeForce GTX 1050,实验分析使用Matlab编程工具。

采用Zhang[10]标定方法对实验相机进行标定,得到相机内参和畸变系数为:中心点坐标为${\mathit{\boldsymbol{c}}_c}$=[832.280 212 402, 605.596 313 477],相机畸变${\mathit{\boldsymbol{k}}_c}$=[-0.023 084 910 58, 0.042 734 298 85, 0.000 281 557 877, -0.000 184 955 206 35, 0]、焦距${\mathit{\boldsymbol{f}}_c}$=826.668 395 996。使用这些参数对采集到的像片进行校正。

用相机围绕标志圆四周拍摄系列照片,采集到的图片如图 5所示。

图 5 实验采集图像
Fig. 5 The images of experiment

标志圆实际尺寸由外圆到内圆依次为18 cm、12 cm、6 cm,所设计同心圆半径比例为3 :2 :1。提取椭圆边缘的算法有很多[11-13],通过比较选用文献[11]的方法进行亚像素级边缘检测,得到的边缘点使用文献[14]的方法随机选取若干边缘点来拟合,将拟合结果误差大于阈值的点删掉,进行二次拟合,得到椭圆中心坐标。圆形标志中央设计了一个2 mm大小的圆,在处理图像过程中对其单独计算采用改进的灰度重心定位算法[15]计算其圆心坐标,由于其半径很小,通过仿真实验环境设置,估算偏心差在0.02个像素左右,相对实验用的同心圆标志来说可以忽略,故作为标志的圆心真值。

按照上述算法进行计算,得到同心圆标志的偏心差及文献[9]的两同心圆算法、本文算法的校正结果如表 2所示。其中分别计算了3个同心圆的偏心差大小,并将校正结果进行比较。

表 2 实物标志偏心差补偿结果
Table 2 Effects of eccentricity errors compensation with object targets

下载CSV
/像素
序号 大圆 中圆 小圆 文献[9] 三同心圆
1 13.111 0 5.607 4 1.380 3 0.475 3 0.251 3
2 11.018 9 4.661 5 1.091 3 0.482 0 0.221 7
3 9.795 5 4.151 4 1.056 4 0.473 3 0.259 7
4 10.278 4 4.472 5 1.104 9 0.470 7 0.263 5
5 12.339 8 5.209 8 1.162 4 0.568 5 0.295 5
6 11.182 0 4.783 1 1.087 0 0.481 6 0.247 0
7 6.778 7 2.839 4 0.567 4 0.301 8 0.149 1
8 10.582 3 4.730 4 1.092 1 0.508 0 0.211 6
9 14.145 7 6.063 3 1.414 7 0.415 9 0.141 8

进一步计算得出标志大圆偏心差的平均值为11.025 8像素,中圆偏心差的平均值为4.724 3像素,小圆偏心差的平均值为1.106 3像素,经文献[9]算法补偿后偏心差的平均值为0.464 1像素,经本文算法补偿后偏心差的平均值为0.226 8像素,按比例尺恢复为0.12 mm偏心差。结果表明,相对于文献[9]的算法,本文算法的精度提高了一倍,相对于小圆来说,其偏心差减小了80%。

4 结论

针对圆形标志圆心点透视投影变换过程中出现的偏心差问题,提出了一种采用三同心圆标志解算偏心差原始模型的计算补偿方法。首先对三同心圆标志图像采集,利用Zernike矩的方法获取3个椭圆的亚像素级边缘,采用最小二乘的方法对椭圆进行拟合求取中心坐标,代入推导出的补偿模型进行解算得到改正后中心坐标。仿真结果表明补偿模型简洁有效,近乎将偏心差消除。在实物实验中,本文算法精度较文献[9]方法精度提高了近一倍。精度没有达到仿真实验结果的原因主要是实物标志采用的是CAD设计,普通A4纸打印,喷墨不均匀引入误差,如果使用回光反射材料制作标志则可获得高精度边缘,偏心差可进一步减小。为更好地发挥算法效果,标志圆成像最好在20个像素以上,此时有效边缘点数目足够,可更好地做最小二乘拟合。

仿真实验和实物实验均验证了方法的有效性,可提高测量精度。在此基础上,研究在各种曲面条件下偏心差的去除值得后续深入研究,从而为进一步提高3维重建的精度提供科学依据。

参考文献

  • [1] Guo J, Liu X Y. Sub-pixel target location for camera calibration[J]. Transducer and Microsystem Technologies, 2008, 27(2): 106–108. [郭进, 刘先勇. 机器视觉标定中的亚像素中心定位算法[J]. 传感器与微系统, 2008, 27(2): 106–108. ] [DOI:10.3969/j.issn.1000-9787.2008.02.035]
  • [2] Dold J. Influence of large targets on the results of photogrammetric bundle adjustment[J]. International Society for Photogrammetry and Remote Sensing, 1996, 31: 119–123.
  • [3] Ahn S J, Warnecke H J, Kotowski R. Systematic geometric image measurement errors of circular object targets:mathematical formulation and correction[J]. Photogrammetric Record, 1999, 16(93): 485–502. [DOI:10.1111/0031-868X.00138]
  • [4] Heikkila J, Silven O.A four-step camera calibration procedure with implicit image correction[C]//Proceedings of 1997 IEEE Computer Society Conference on Computer Vision and Pattern Recognition.Puerto: IEEE, 1997.[DOI:10.1109/CVPR.1997.609468]
  • [5] Liao X C, Feng W H. Determination of the deviation between the image of a circular target center and the center of the ellipse in the image[J]. Journal of Wuhan Technical University of Surveying and Mapping, 1999, 24(3): 235–239. [廖祥春, 冯文灏. 圆形标志及其椭圆构像间中心偏差的确定[J]. 武汉测绘科技大学学报, 1999, 24(3): 235–239. ] [DOI:10.3969/j.issn.1671-8860.1999.03.011]
  • [6] Zhang G J, Wei Z Z. A position-distortion model of ellipse centre for perspective projection[J]. Measurement Science and Technology, 2003, 14(8): 1420–1426. [DOI:10.1088/0957-0233/14/8/331]
  • [7] Huang D M. Projection eccentric error of round target in close-range photogrammetry and simulation analysis[J]. Engineering Construction, 2011, 43(2): 10–13. [黄道明. 近景摄影测量中圆形目标的投影偏心差及模拟分析[J]. 工程建设, 2011, 43(2): 10–13. ] [DOI:10.3969/j.issn.1673-8993.2011.02.003]
  • [8] Li Z L, Liu M, Sun Y. Research on calculation method for the projection of circular target center in photogrammetry[J]. Chinese Journal of Scientific Instrument, 2011, 32(10): 2235–2241. [李占利, 刘梅, 孙瑜. 摄影测量中圆形目标中心像点计算方法研究[J]. 仪器仪表学报, 2011, 32(10): 2235–2241. ] [DOI:10.19650/j.cnki.cjsi.2011.10.012]
  • [9] He D, Liu X L, Peng X, et al. Eccentricity error identification and compensation for high-accuracy 3D optical measurement[J]. Measurement Science and Technology, 2013, 24(7): #075402. [DOI:10.1088/0957-0233/24/7/075402]
  • [10] Zhang Z. A flexible new technique for camera calibration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2000, 22(11): 1330–1334. [DOI:10.1109/34.888718]
  • [11] Zhu H, Zeng X J. Sub-pixel edge detection algorithm of Zernike moments and least-squares ellipse fitting[J]. Computer Engineering and Applications, 2011, 47(17): 148–150. [祝宏, 曾祥进. Zernike矩和最小二乘椭圆拟合的亚像素边缘提取[J]. 计算机工程与应用, 2011, 47(17): 148–150. ] [DOI:10.3778/j.issn.1002-8331.2011.17.040]
  • [12] Chen X W, Xu C H, Guo H T, et al. Universal sub-pixel edge detection algorithm based on extremal gradient[J]. Acta Geodaetica et Cartographica Sinica, 2014, 43(5): 500–507. [陈小卫, 徐朝辉, 郭海涛, 等. 利用极值梯度的通用亚像素边缘检测方法[J]. 测绘学报, 2014, 43(5): 500–507. ] [DOI:10.13485/j.cnki.11-2089.2014.0073]
  • [13] Wu P, Xu H L, Song W L, et al. A nonlinear quartic image interpolation based subpixel edge detection algorithm[J]. Journal of Harbin Engineering University, 2015, 36(2): 243–247. [吴鹏, 徐洪玲, 宋文龙, 等. 基于非线性四阶图像插值的亚像素边缘检测算法[J]. 哈尔滨工程大学学报, 2015, 36(2): 243–247. ] [DOI:10.3969/j.issn.1006-7043.201312057]
  • [14] Sheng D W, He X F, Lü Y. A cattle iris segmentation method based on least square principle[J]. Journal of Image and Graphics, 2009, 14(10): 2132–2136. [盛大玮, 何孝富, 吕岳. 基于最小二乘原理的牛眼虹膜分割方法[J]. 中国图象图形学报, 2009, 14(10): 2132–2136. ] [DOI:10.11834/jig.20091036]
  • [15] Shi S L, Yin D Y. Improved real-time grayscale centroid algorithm[J]. Opto-Electronic Engineering, 2013, 40(12): 18–24. [史少龙, 尹达一. 改进型灰度质心实时算法研究[J]. 光电工程, 2013, 40(12): 18–24. ] [DOI:10.3969/j.issn.1003-501X.2013.12.004]