CN105678757B - A kind of ohject displacement measuring method - Google Patents
A kind of ohject displacement measuring method Download PDFInfo
- Publication number
- CN105678757B CN105678757B CN201511034482.3A CN201511034482A CN105678757B CN 105678757 B CN105678757 B CN 105678757B CN 201511034482 A CN201511034482 A CN 201511034482A CN 105678757 B CN105678757 B CN 105678757B
- Authority
- CN
- China
- Prior art keywords
- coordinate
- template
- image
- interpolation
- matching
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000006073 displacement reaction Methods 0.000 title claims abstract description 33
- 238000012545 processing Methods 0.000 claims abstract description 5
- 230000009194 climbing Effects 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 description 20
- 238000005259 measurement Methods 0.000 description 13
- 238000005516 engineering process Methods 0.000 description 5
- 238000013507 mapping Methods 0.000 description 5
- 238000000691 measurement method Methods 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000002940 Newton-Raphson method Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000001066 destructive effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000002068 genetic effect Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000009659 non-destructive testing Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000012887 quadratic function Methods 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/02—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种物体位移测量方法,包括以下步骤:1、选取第一帧图像P1和第一帧后的任意一帧图像M1;2、对图像进行灰度化处理;3、得到P2和M2;4、在P1中框出特定区域作为模板T1;5、得到与T1相似的匹配区域;6、实现像素级匹配;7、计算n*n区域的每个像素点相关系数,选取拟合得到的曲面的最大值的坐标作为匹配点;8、得到在M2中对应的坐标位置;9、利用模版T1,选取在P2中对应的模板T2;10、计算T2在每个点上的相关系数;11、将最佳匹配点对应的坐标值与模板在P1中的坐标进行比较;12、重复步骤4~11计算位移的统计平均值,以统计平均值作为最终位移结果。具有计算效率高等优点。
The invention discloses a method for measuring object displacement, comprising the following steps: 1. Selecting the first frame image P1 and any frame image M1 after the first frame; 2. Performing grayscale processing on the image; 3. Obtaining P2 and M2; 4. Frame a specific area in P1 as the template T1; 5. Obtain a matching area similar to T1; 6. Realize pixel-level matching; 7. Calculate the correlation coefficient of each pixel in the n*n area, and select the fitting The coordinates of the maximum value of the obtained surface are used as matching points; 8. Obtain the corresponding coordinate position in M2; 9. Use the template T1 to select the corresponding template T2 in P2; 10. Calculate the correlation coefficient of T2 at each point ; 11. Comparing the coordinates corresponding to the best matching point with the coordinates of the template in P1; 12. Repeating steps 4-11 to calculate the statistical average value of the displacement, using the statistical average value as the final displacement result. It has the advantages of high computational efficiency.
Description
技术领域technical field
本发明涉及一种数字图像的亚像素位移测量技术,特别涉及一种物体位移测量方法,该物体位移测量方法可以广泛应用于物体的位移、变形和应变的测量,还可以对物体进行振动分析。The invention relates to a sub-pixel displacement measurement technology of a digital image, in particular to an object displacement measurement method, which can be widely used in the measurement of displacement, deformation and strain of an object, and can also perform vibration analysis on the object.
背景技术Background technique
以实验为手段,采用光学测量的方法,以研究位移、应力和应变为主要任务的光测力学,是结合了多个学科技术为一体的交叉学科,它在很多测试和检测领域得到了广泛的应用,并发挥着举足轻重的作用。Optical Mechanics, which uses experiments as a means and uses optical measurement methods to study displacement, stress and strain as its main task, is an interdisciplinary subject that combines multiple disciplines and technologies. It has been widely used in many testing and inspection fields. application and play a pivotal role.
数字图像相关法(Digital Image Correlation Method,DICM)作为一种光测力学技术,具有全场测量、无损、对测量环境要求较低等优点。得到了快速的发展。近些年来,对于数字图像相关技术理论和工程应用,很多学者进行了大量的研究工作,取得了一定的研究成果。随着不断完善,其应用领域越来越宽广,必将在工程领域中发挥越来越重要的作用。Digital image correlation method (Digital Image Correlation Method, DICM), as a photomechanical technology, has the advantages of full-field measurement, non-destructive, and low requirements for the measurement environment. developed rapidly. In recent years, many scholars have done a lot of research work on the theory and engineering application of digital image related technology, and achieved certain research results. With continuous improvement, its application fields are getting wider and wider, and it will play an increasingly important role in the engineering field.
相关运算是数字图像相关技术中的关键问题,提高数字图像相关方法的测量精度是工程质量无损检测的迫切要求。通过提升硬件来提高测量精度的代价是昂贵而不现实的,而从优化算法的角度出发,提高图像亚像素定位精度的思想是经济可行的。整像素搜索的算法目前已经很成熟和完善,相对而言,计算耗时比较少,而亚像素级定位是计算精度的关键,也是其中比较费时的环节,它直接影响相关搜索的效率、计算精度和稳定性。Correlation calculation is a key issue in digital image correlation technology, and improving the measurement accuracy of digital image correlation method is an urgent requirement for non-destructive testing of engineering quality. It is expensive and unrealistic to improve the measurement accuracy by upgrading the hardware, but from the perspective of optimization algorithm, the idea of improving the image sub-pixel positioning accuracy is economically feasible. The algorithm of integer pixel search is very mature and perfect. Relatively speaking, the calculation time is relatively less, and the sub-pixel level positioning is the key to calculation accuracy, and it is also a time-consuming link. It directly affects the efficiency and calculation accuracy of related searches. and stability.
大多数的相关搜索算法的整像素定位精度是一致的,只是在计算量、计算效率、抗噪声性能、稳定性等方面有些差异,因此决定数字图像相关方法的计算精度的主要因素是亚像素定位精度,常见的方法有亚像素灰度插值法、曲面拟合法、坐标轮换法、牛顿—拉普森法、拟牛顿法、梯度法、频域相关法、遗传算法、神经网络算法等等,这些算法能达到的定位精度从0.005到0.1像素不等。Most of the correlation search algorithms have the same integer pixel positioning accuracy, but there are some differences in the amount of calculation, calculation efficiency, anti-noise performance, stability, etc. Therefore, the main factor determining the calculation accuracy of digital image correlation methods is sub-pixel positioning. Accuracy, common methods include sub-pixel grayscale interpolation method, surface fitting method, coordinate rotation method, Newton-Raphson method, quasi-Newton method, gradient method, frequency domain correlation method, genetic algorithm, neural network algorithm, etc. The positioning accuracy that the algorithm can achieve ranges from 0.005 to 0.1 pixels.
灰度插值法要求对离散的灰度场通过插值的方法进行亚像素级重构,最简单的灰度插值法是最近邻域插值法和双线性插值法这两种插值方法精度很低,插值重构会产生模糊。精度比较高的插值方法有拉格朗日插值、立方插值、双三次样条插值、五次样条插值。通过对离散的灰度场通过插值的方法,使得数字图像成为近似的连续图像,然后进行精搜索,选取相关系数最大的位置作为最优匹配位置。这种方法计算量巨大,效率较低。The grayscale interpolation method requires sub-pixel reconstruction of the discrete grayscale field through interpolation. The simplest grayscale interpolation method is the nearest neighbor interpolation method and the bilinear interpolation method. These two interpolation methods have very low precision. Interpolation reconstruction produces blur. Interpolation methods with relatively high precision include Lagrangian interpolation, cubic interpolation, bicubic spline interpolation, and quintic spline interpolation. By interpolating the discrete gray-scale field, the digital image becomes an approximate continuous image, and then performs a fine search to select the position with the largest correlation coefficient as the optimal matching position. This method has a huge amount of calculation and low efficiency.
发明内容Contents of the invention
本发明的目的在于克服现有技术的缺点与不足,提供一种物体位移测量方法,该物体位移测量方法满足了实际工程中测量高精度的要求,保证了计算效率的合理性。The object of the present invention is to overcome the shortcomings and deficiencies of the prior art, and provide a method for measuring object displacement, which meets the requirements of high-precision measurement in actual engineering and ensures the rationality of calculation efficiency.
本发明的目的可以通过下述技术方案实现:一种物体位移测量方法,主要包括以下步骤:The object of the present invention can be achieved through the following technical solutions: a method for measuring object displacement mainly comprises the following steps:
S1:固定图像采集设备的位置,然后利用图像采集设备采集待测量目标的连续移动图像;图像采集设备的位置不能够变动,以获取反应目标移动的图像;选取第一帧图像(P1)和第一帧后的任意一帧图像(M1);S1: Fix the position of the image acquisition device, and then use the image acquisition device to collect continuous moving images of the target to be measured; the position of the image acquisition device cannot be changed to obtain an image that reflects the movement of the target; select the first frame image (P1) and the second frame Any frame of image after one frame (M1);
S2:若图像为彩色图像,则先对其进行灰度化处理;S2: If the image is a color image, first perform grayscale processing on it;
S3:利用插值算法对P1和M1进行插值k倍,插值后分别得到P2和M2;S3: Use an interpolation algorithm to interpolate P1 and M1 by k times, and obtain P2 and M2 respectively after interpolation;
S4:在P1中框出一包含明显特征的特定区域作为模板(T1),记下模板图 T1的左上角点在P1中的坐标(x0,y0);S4: frame a specific area containing obvious features in P1 as a template (T1), and record the coordinates (x 0 , y 0 ) of the upper left corner of the template map T1 in P1;
S5:利用爬山法在M1中进行匹配,得到与T1大致相似的匹配区域;S5: Use the hill-climbing method to perform matching in M1, and obtain a matching area roughly similar to T1;
S6:在上一步得到的区域内,利用SDA\SSD算法精确匹配得到模版图像的坐标(x1,y1),实现像素级匹配;S6: In the area obtained in the previous step, use the SDA\SSD algorithm to accurately match the coordinates (x 1 , y 1 ) of the template image to achieve pixel-level matching;
S7:以(x1,y1)为中心,计算n*n区域的每个像素点的相关系数,利用获得的相关系数进行曲面拟合,选取拟合后曲面的最大值的坐标作为匹配点(x2,y2);S7: With (x 1 , y 1 ) as the center, calculate the correlation coefficient of each pixel in the n*n area, use the obtained correlation coefficient to perform surface fitting, and select the coordinates of the maximum value of the fitted surface as the matching point (x 2 ,y 2 );
S8:将步骤S7得到的M1中的匹配坐标位置(x2,y2)映射到M2中,得到在M2中对应的坐标位置(x3,y3);S8: Map the matching coordinate position (x 2 , y 2 ) in M1 obtained in step S7 to M2 to obtain the corresponding coordinate position (x 3 , y 3 ) in M2;
S9:利用在P1中选取的模版图(T1),选取其在P2中对应的模板图(T2);S9: Utilize the template image (T1) selected in P1 to select its corresponding template image (T2) in P2;
S10:在M2中,以(x3,y3)为起始点,重复步骤S6,找到最佳匹配点的坐标,以该坐标为中心,选取m*m的矩形区域,计算T2在每个点上的相关系数;S10: In M2, with (x 3 , y 3 ) as the starting point, repeat step S6 to find the coordinates of the best matching point, take the coordinates as the center, select a rectangular area of m*m, and calculate T2 at each point The correlation coefficient on
S11:利用在上一步获得的相关系数进行曲面拟合,选取拟合后的最大值的坐标(x4,y4)作为最佳匹配点,并将该坐标值映射回M1中对应的坐标值(x5,y5),并将(x5,y5)与模板的在P1中的坐标(x0,y0)进行比较,,以实现目标的精确位移测量(Δx,Δy);S11: Use the correlation coefficient obtained in the previous step to perform surface fitting, select the coordinate (x 4 , y 4 ) of the fitted maximum value as the best matching point, and map the coordinate value back to the corresponding coordinate value in M1 (x 5 , y 5 ), and compare (x 5 , y 5 ) with the coordinates (x 0 , y 0 ) of the template in P1, so as to achieve accurate displacement measurement (Δx, Δy) of the target;
S12:把以上步骤S4至步骤S11循环执行p次,每次选取不同的模板图,计算出位移的统计平均值,以该值作为最终位移结果。S12: Perform the above step S4 to step S11 cyclically p times, select a different template map each time, calculate the statistical average value of the displacement, and use this value as the final displacement result.
以上步骤S5、S6、S10中计算相关系数的NCC算法采用的计算公式如下:The calculation formula adopted by the NCC algorithm for calculating the correlation coefficient in the above steps S5, S6, and S10 is as follows:
以上公式中,rxy是以点(x,y)为原点的m*n子区域跟模版图像之间的相关系数,Sx,y表示的是待匹配图像中以点(x,y)为原点截取的m*n子区域,Sx,y(i,j)指该子区域上坐标(i,j)点的灰度值,指该子区域上灰度的平均值。Tx,y(i,j)指模版上坐标(i,j)点的灰度值,指模板上的灰度的平均值。m,n分别代表模板的列数和行数。In the above formula, r xy is the correlation coefficient between the m*n sub-region with the point (x, y) as the origin and the template image, and S x, y represents the point (x, y) in the image to be matched. The m*n sub-area intercepted at the origin, S x, y (i, j) refers to the gray value of the coordinate (i, j) point on the sub-area, Refers to the average value of the gray level on the sub-region. T x,y (i,j) refers to the gray value of the coordinate (i,j) point on the template, Refers to the average value of the grayscale on the template. m and n represent the number of columns and rows of the template, respectively.
以上步骤S7、S11中,进行曲面拟合的方法有二次曲面拟合法、三次曲面拟合法、高斯曲面拟合法、二维拉格朗日法曲面拟合;一般情况下取二次曲面拟合法即可。二次曲面拟合法采用的二元二次函数如下:In the above steps S7 and S11, methods for surface fitting include quadratic surface fitting, cubic surface fitting, Gaussian surface fitting, and two-dimensional Lagrangian surface fitting; generally, quadratic surface fitting is used That's it. The binary quadratic function used in the quadratic surface fitting method is as follows:
r(xi,yi)=a0+a1xi+a2yi+a3x2+a4xiyi+a5yi 2,r(x i ,y i )=a 0 +a 1 x i +a 2 y i +a 3 x 2 +a 4 x i y i +a 5 y i 2 ,
式中,r(xi,yi)表示模板图在坐标(xi,yi)处计算得到的相关系数,系数a0~a5为该二次曲面的系数。二次曲面的最大值的坐标公式如下:In the formula, r( xi , y i ) represents the correlation coefficient calculated at the coordinates ( xi , y i ) of the template graph, and the coefficients a 0 to a 5 are the coefficients of the quadric surface. The coordinate formula for the maximum value of a quadric surface is as follows:
式中,x,y分别表示二次曲面的最大值的横坐标和纵坐标,系数a0~a5为该二次曲面的系数。In the formula, x and y respectively represent the abscissa and ordinate of the maximum value of the quadric surface, and the coefficients a 0 to a 5 are the coefficients of the quadric surface.
以上步骤S8中坐标映射的公式如下:The formula of the coordinate mapping in the above step S8 is as follows:
x′3=(x2-1)*n+1x′ 3 =(x 2 -1)*n+1
y′3=(y2-1)*n+1,y′ 3 =(y 2 -1)*n+1,
式中,坐标(x2,y2)表示步骤S7中得到的模板在M1中的匹配坐标位置,坐标(x'3,y'3)表示坐标映射的结果,坐标位置(x3,y3)表示模板在M2中对应的坐标位置。In the formula, the coordinate (x 2 , y 2 ) represents the matching coordinate position of the template obtained in step S7 in M1, the coordinate (x' 3 , y' 3 ) represents the result of the coordinate mapping, and the coordinate position (x 3 , y 3 ) represents the corresponding coordinate position of the template in M2.
以上步骤S9的具体方法如下:先将模板图T1的左上角点在P1的坐标(x0,y0) 映射到P2中的坐标,记为(x0',y0'),同时选取模板图T1右下角点在P1中的坐标,并将其映射到P2中的坐标,记为(x0",y0"),那么模板T2取为坐标(x0',y0')和坐标 (x0",y0")之间的矩形区域。坐标映射公式如下:The specific method of the above step S9 is as follows: first map the coordinates (x 0 , y 0 ) of the upper left corner point of the template map T1 in P1 to the coordinates in P2, denoted as (x 0 ', y 0 '), and at the same time select the template The coordinates of the lower right corner of the graph T1 in P1, and map it to the coordinates in P2, recorded as (x 0 ", y 0 "), then the template T2 is taken as the coordinates (x 0 ', y 0 ') and the coordinates A rectangular area between (x 0 ", y 0 "). The coordinate mapping formula is as follows:
x2=(x1-1)*k+1x 2 =(x 1 -1)*k+1
y2=(y1-1)*k+1,y 2 =(y 1 -1)*k+1,
其中,坐标(x1,y1)和(x2,y2)分别为P1和P2中对应的坐标,k表示在步骤 S3中插值的倍数。Wherein, the coordinates (x 1 , y 1 ) and (x 2 , y 2 ) are the corresponding coordinates in P1 and P2 respectively, and k represents the multiple of the interpolation in step S3.
以上步骤S11中,坐标映射公式如下:In the above step S11, the coordinate mapping formula is as follows:
式中,坐标(x4,y4)表示M2总的最佳匹配坐标,坐标(x5,y5)表示M1中的最佳匹配坐标,它由上述映射公式得到,k表示在步骤S3中插值的倍数。In the formula, the coordinates (x 4 , y 4 ) represent the overall best matching coordinates of M2, and the coordinates (x 5 , y 5 ) represent the best matching coordinates in M1, which are obtained from the above mapping formula, and k represents the Multiplier for interpolation.
以上步骤S11中,位移计算公式如下:In the above step S11, the displacement calculation formula is as follows:
式中,坐标(x5,y5)表示M1中的最佳匹配坐标,坐标(x0,y0)表示步骤S4中模板图T1的左上角点在P1中的坐标,Δx表示目标在横坐标方向上的精确位移,Δy表示目标在纵坐标方向上的精确位移。In the formula, the coordinates (x 5 , y 5 ) represent the best matching coordinates in M1, the coordinates (x 0 , y 0 ) represent the coordinates of the upper left corner point of the template graph T1 in step S4 in P1, and Δx represents the target in horizontal The precise displacement in the coordinate direction, Δy represents the precise displacement of the target in the ordinate direction.
在步骤S3、S7、S10和S12中的k、n、m和p的取值可为任意正整数,取值越大运算量越大,取值范围最好为[1,10]。The values of k, n, m, and p in steps S3, S7, S10, and S12 can be any positive integers, and the larger the value, the greater the computational complexity, and the value range is preferably [1,10].
在步骤S3、S7、S8、S9、S10和S11中,把经典的相关搜索的亚像素插值算法和曲面拟合法结合起来,极大地提高了亚像素级位移测量的精度;同时在插值前和插值后的图像中进行匹配,有效地降低了计算复杂度。In steps S3, S7, S8, S9, S10 and S11, the sub-pixel interpolation algorithm of classic correlation search and the surface fitting method are combined to greatly improve the accuracy of sub-pixel level displacement measurement; at the same time, before interpolation and interpolation Matching in the final image effectively reduces the computational complexity.
本发明的目的也可以通过下述技术方案实现:一种物体位移测量方法,包括以下步骤:(1)利用图像采集设备采集待测目标物的连续位移图像;(2)利用插值算法对所采集的图像进行插值;(3)在首帧中选取模板图,然后利用爬山法及SDA\SSD算法找到模板在后续图像中的粗略坐标位置;(4)对其进行拟合,得到相似性曲面,求取曲面峰值坐标,与原图中的坐标进行比较,计算出位移; (5)重复(3)~(4)步骤若干次,计算位移的平均值作为最终结果。本发明方法在工程应用时,多次选取模板图进行测量,同时在插值前和插值后图像中进行计算,并且将插值算法和曲面拟合算法巧妙结合起来,提高了计算的效率,实现了精确的亚像素级位移测量。The purpose of the present invention can also be achieved through the following technical solutions: a method for measuring object displacement, comprising the following steps: (1) utilizing image acquisition equipment to collect continuous displacement images of the target object to be measured; (2) utilizing an interpolation algorithm to collect (3) Select the template image in the first frame, and then use the hill-climbing method and SDA\SSD algorithm to find the rough coordinate position of the template in the subsequent image; (4) Fit it to obtain the similarity surface, Find the peak coordinates of the surface, compare with the coordinates in the original image, and calculate the displacement; (5) Repeat steps (3) to (4) several times, and calculate the average value of the displacement as the final result. When the method of the present invention is used in engineering, the template image is selected multiple times for measurement, and the calculation is performed in the image before and after interpolation at the same time, and the interpolation algorithm and the surface fitting algorithm are skillfully combined to improve the efficiency of calculation and realize accurate sub-pixel displacement measurement.
本发明相对于现有技术具有如下的优点及效果:Compared with the prior art, the present invention has the following advantages and effects:
曲面拟合法假设整像素位移相关搜索结果及其相邻点的相关系数矩阵可拟合为连续曲面,然后以该曲面的极值点位置作为变形后图像子区的中心位置。用于拟合的曲面类型有二次曲面、三次曲面、高斯曲面和二维拉格朗日曲面等。曲面拟合的方法计算精度高、抗噪声能力比较强。本发明把亚像素位移测量中的灰度插值法和曲面拟合法巧妙地结合起来,使得计算的精度有了很大的提高;同时通过首先在插值前的图片上计算模板的的匹配位置,然后再转移到插值后的图片上计算模板图的精确位置,这个方式的优点在于在移动前的图片进行匹配,模板图和原图的尺寸都较小,计算效率较高,相比直接在插值后的图片上计算模板图,计算效率有了很大的提高;并且选取多个匹配图,最后计算统计的均值,以获取更精确的结果。The surface fitting method assumes that the correlation coefficient matrix of the integer pixel displacement correlation search results and its adjacent points can be fitted into a continuous surface, and then the extreme point position of the surface is used as the center position of the deformed image sub-region. The types of surfaces used for fitting include quadratic surfaces, cubic surfaces, Gaussian surfaces, and two-dimensional Lagrangian surfaces. The surface fitting method has high calculation accuracy and strong anti-noise ability. The present invention cleverly combines the grayscale interpolation method and surface fitting method in the sub-pixel displacement measurement, so that the calculation accuracy has been greatly improved; at the same time, by first calculating the matching position of the template on the picture before interpolation, and then Then transfer to the interpolated image to calculate the precise position of the template image. The advantage of this method is that the image before moving is matched. The size of the template image and the original image are smaller, and the calculation efficiency is higher. Compared with directly after interpolation The template image is calculated on the image, and the calculation efficiency has been greatly improved; and multiple matching images are selected, and the statistical mean is finally calculated to obtain more accurate results.
附图说明Description of drawings
图1是爬山算法的具体实施流程图。Figure 1 is a flow chart of the specific implementation of the hill-climbing algorithm.
图2是本发明的具体实施流程图。Fig. 2 is a specific implementation flow chart of the present invention.
具体实施方式Detailed ways
下面结合实施例及附图对本发明作进一步详细的描述,但本发明的实施方式不限于此。The present invention will be further described in detail below in conjunction with the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.
实施例Example
如图2所示,一种物体位移测量方法,具体包括以下步骤:As shown in Figure 2, an object displacement measurement method specifically includes the following steps:
S1:固定图像采集设备的位置,然后利用图像采集设备采集待测量目标的连续移动图像;图像采集设备的位置不能够变动,以获取反应目标移动的图像;选取第一帧图像(P1)和第一帧后的任意一帧图像(M1);并且为了获得较高的测量精度,所获取的照片应该有足够高的质量。S1: Fix the position of the image acquisition device, and then use the image acquisition device to collect continuous moving images of the target to be measured; the position of the image acquisition device cannot be changed to obtain an image that reflects the movement of the target; select the first frame image (P1) and the second frame Any frame of image (M1) after one frame; and in order to obtain high measurement accuracy, the acquired photos should be of sufficiently high quality.
S2:若图像为彩色图像,则先对其进行灰度化处理;S2: If the image is a color image, first perform grayscale processing on it;
S3:利用插值算法对P1和M1进行插值k倍,插值后分别得到P2和M2;可以选择的插值算法很多,一般情况下利用立方卷积插值算法可以获取精度比较高的图片,插值的倍数应该根据计算效率的实际需要而定,一般取10倍即可。S3: Use the interpolation algorithm to interpolate P1 and M1 by k times, and obtain P2 and M2 respectively after interpolation; there are many interpolation algorithms that can be selected. Generally, the cubic convolution interpolation algorithm can be used to obtain pictures with relatively high precision, and the interpolation multiple should be It depends on the actual needs of computing efficiency, generally 10 times is enough.
S4:在P1中框出包含明显特征的特定区域作为模板(T1),记下模板图T1 的左上角点在P1中的坐标(x0,y0);模板的大小可根据计算效率的实际需要而定,一般取为41*41像素或51*51像素即可。S4: Frame a specific area containing obvious features in P1 as a template (T1), and record the coordinates (x 0 , y 0 ) of the upper left corner of the template map T1 in P1; the size of the template can be determined according to the actual calculation efficiency It depends on the needs, generally it is 41*41 pixels or 51*51 pixels.
S5:利用爬山法在M1中进行匹配,得到与T1大致相似的匹配区域;;S5: Use the hill-climbing method to match in M1, and get a matching area roughly similar to T1;
S6:在上一步得到的区域内,利用SDA\SSD算法精确匹配得到模版图像的坐标(x1,y1),实现像素级匹配;S6: In the area obtained in the previous step, use the SDA\SSD algorithm to accurately match the coordinates (x 1 , y 1 ) of the template image to achieve pixel-level matching;
S7:以(x1,y1)为中心,计算n*n区域的每个像素点的相关系数,利用获得的相关系数进行曲面拟合,选取拟合后曲面的最大值的坐标作为匹配点(x2,y2);曲面拟合方法的选取可根据具体的计算效率要求而定,一般情况下,选取二次曲面拟合法就可以满足要求。S7: With (x 1 , y 1 ) as the center, calculate the correlation coefficient of each pixel in the n*n area, use the obtained correlation coefficient to perform surface fitting, and select the coordinates of the maximum value of the fitted surface as the matching point (x 2 , y 2 ); the selection of the surface fitting method can be determined according to the specific calculation efficiency requirements. In general, the selection of the quadratic surface fitting method can meet the requirements.
S8:将步骤S7得到的M1中的匹配坐标位置(x2,y2)映射到M2中,得到在M2 中对应的坐标位置(x3,y3);S8: Map the matching coordinate position (x 2 , y 2 ) in M1 obtained in step S7 to M2 to obtain the corresponding coordinate position (x 3 , y 3 ) in M2;
S9:利用在P1中选取的模版图(T1),选取其在P2中对应的模板图(T2);S9: Utilize the template image (T1) selected in P1 to select its corresponding template image (T2) in P2;
S10:在M2中,以T2为模板图,以(x3,y3)为起始点,重复步骤S6,找到最佳匹配点的坐标,以该坐标为中心,选取m*m的矩形区域,计算T2在每个点上的相关系数;由于步骤S8所获取的匹配位置(x2,y2)已经很接近实际的匹配位置,所以本步骤在利用步骤S6搜索整像素点最优匹配点的坐标速度是非常快的。S10: In M2, take T2 as the template map and (x 3 , y 3 ) as the starting point, repeat step S6 to find the coordinates of the best matching point, take the coordinates as the center, select a rectangular area of m*m, Calculate the correlation coefficient of T2 at each point; since the matching position (x 2 , y 2 ) obtained in step S8 is already very close to the actual matching position, this step uses step S6 to search for the optimal matching point of the integer pixel point The coordinate speed is very fast.
S11:利用获得的相关系数进行曲面拟合,选取拟合后的最大值的坐标(x4,y4) 作为最佳匹配点,并将该坐标值映射回M1中对应的坐标值(x5,y5),并将(x5,y5) 与模板的在P1中的坐标(x0,y0)进行比较,以得到目标的精确位移(Δx,Δy);S11: Use the obtained correlation coefficient to perform surface fitting, select the coordinates (x 4 , y 4 ) of the fitted maximum value as the best matching point, and map the coordinates back to the corresponding coordinates in M1 (x 5 ,y 5 ), and compare (x 5 ,y 5 ) with the coordinates (x 0 ,y 0 ) of the template in P1 to obtain the precise displacement (Δx,Δy) of the target;
S12:重复以上S4~S11步骤p次,每次选取不同的模板图,计算出位移的统计平均值,以该值作为最终位移结果;具体需要重复多少次可根据实际要的计算效率而定。S12: Repeat steps S4 to S11 above p times, select a different template image each time, calculate the statistical average value of the displacement, and use this value as the final displacement result; how many times to repeat can be determined according to the actual calculation efficiency.
上述步骤S5中的爬山搜索法的性能受模版和待匹配图像大小、模版图像的灰度分布、计算相关系数的算法等非常多因素的影响。如图1所示,步骤S5可以进一步划分为:The performance of the hill-climbing search method in step S5 is affected by many factors such as the size of the template and the image to be matched, the gray distribution of the template image, and the algorithm for calculating the correlation coefficient. As shown in Figure 1, step S5 can be further divided into:
S5.1:根据待匹配子图和模版子图的相对大小关系,选取爬山法中所有初始爬山起点之间横向和纵向间距,在待匹配图像中生成所有的爬山起点。如果实际测量的目标移动范围较小,可以把所有初始爬山起点设定在坐标(x0,y0)附近,以提高爬山的速度。为了能够更精准地反应原图跟模版子图之间的相关度,选定的爬山起点应该尽可能均匀分布,且起点间的距离要适中。S5.1: According to the relative size relationship between the to-be-matched sub-image and the template sub-image, select the horizontal and vertical distances between all initial mountain-climbing starting points in the hill-climbing method, and generate all mountain-climbing starting points in the image to be matched. If the actually measured moving range of the target is relatively small, all initial climbing starting points can be set near the coordinates (x 0 , y 0 ) to increase the climbing speed. In order to more accurately reflect the correlation between the original image and the template sub-image, the selected starting points for climbing should be distributed as evenly as possible, and the distance between the starting points should be moderate.
S5.2:计算所有爬山起点的相关系数,并它们逆序排列。经过S5.1的合理选取起点,可以认为起点的相关系数大小跟其与相关系数的最大值之间的距离存在一定的正相关关系,依相关系数逆序检验这些起点能够更快地找到目标。S5.2: Calculate the correlation coefficients of all climbing starting points and arrange them in reverse order. After the reasonable selection of the starting point in S5.1, it can be considered that there is a certain positive correlation between the correlation coefficient of the starting point and the distance between it and the maximum value of the correlation coefficient. Checking these starting points in the reverse order of the correlation coefficient can find the target faster.
S5.3:根据对匹配精确度的要求,选择一个合适的相关系数上限,用来终止搜索过程。此外,在S5.1步骤合理选取了爬山起点的基础上,认为相关系数过小的点跟目标点的距离太远,可以直接舍弃。这个下限值的选取跟S5.1中起点的选取密切相关,实施例中取了0.25。S5.3: According to the requirements for matching accuracy, select an appropriate upper limit of the correlation coefficient to terminate the search process. In addition, based on the reasonable selection of the climbing starting point in step S5.1, it is considered that the point with too small correlation coefficient is too far away from the target point, so it can be discarded directly. The selection of this lower limit is closely related to the selection of the starting point in S5.1, and 0.25 is taken in the embodiment.
S5.4:确定好当前点后,依次计算周围3*3矩阵里各点的相关系数。若有相关系数更大的点,则把它当做新的起点继续查找,若没有则进入下一步。S5.4: After determining the current point, calculate the correlation coefficient of each point in the surrounding 3*3 matrix in turn. If there is a point with a larger correlation coefficient, use it as a new starting point to continue searching, if not, go to the next step.
S5.5:判断S5.4找到的最大相关系数有没有超过步骤S5.3设定的上限,若没有则计算检查下一个爬山起点,否则认为已经找到了符合要求的点,直接终止爬山过程。S5.5: Determine whether the maximum correlation coefficient found in S5.4 exceeds the upper limit set in step S5.3, if not, calculate and check the next starting point of mountain climbing, otherwise, consider that a point meeting the requirements has been found, and directly terminate the mountain climbing process.
上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiment is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the above-mentioned embodiment, and any other changes, modifications, substitutions, combinations, Simplifications should be equivalent replacement methods, and all are included in the protection scope of the present invention.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511034482.3A CN105678757B (en) | 2015-12-31 | 2015-12-31 | A kind of ohject displacement measuring method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511034482.3A CN105678757B (en) | 2015-12-31 | 2015-12-31 | A kind of ohject displacement measuring method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105678757A CN105678757A (en) | 2016-06-15 |
CN105678757B true CN105678757B (en) | 2018-04-13 |
Family
ID=56190053
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201511034482.3A Active CN105678757B (en) | 2015-12-31 | 2015-12-31 | A kind of ohject displacement measuring method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105678757B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107341773A (en) * | 2017-06-13 | 2017-11-10 | 浙江大学 | A kind of vignetting bearing calibration of multispectral image |
CN107590502B (en) * | 2017-09-18 | 2020-05-22 | 西安交通大学 | A Fast Matching Method for Dense Points in the Whole Field |
CN109672818B (en) * | 2017-10-16 | 2020-12-22 | 华为技术有限公司 | Method and device for adjusting image quality |
CN108387184A (en) * | 2018-03-20 | 2018-08-10 | 山西和信基业科技股份有限公司 | A kind of measurement method and system of deflection of bridge span |
CN108871185B (en) * | 2018-05-10 | 2020-12-29 | 苏州大学 | Method, apparatus, apparatus, and computer-readable storage medium for part inspection |
CN109883333A (en) * | 2019-03-14 | 2019-06-14 | 武汉理工大学 | A non-contact displacement strain measurement method based on image feature recognition technology |
CN110146024B (en) * | 2019-06-06 | 2023-03-14 | 重庆大学 | Double-precision displacement measurement method based on self-adaptive search |
CN110608676B (en) * | 2019-08-26 | 2021-10-26 | 中国科学院重庆绿色智能技术研究院 | Shear displacement measurement method, shear displacement measurement module and multi-parameter combined monitoring system |
CN111829439B (en) * | 2020-07-21 | 2021-06-25 | 中山大学 | High-precision translation measuring method and device |
CN113947689B (en) * | 2021-09-30 | 2023-10-10 | 西安交通大学 | A rapid measurement method of large structural motion based on computer vision |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101569543A (en) * | 2008-04-29 | 2009-11-04 | 香港理工大学 | Two-dimensional displacement estimation method for elasticity imaging |
CN103729849A (en) * | 2013-12-31 | 2014-04-16 | 南京航空航天大学 | Method for calculating digital image morphing initial value |
CN105203033A (en) * | 2015-10-08 | 2015-12-30 | 重庆平伟实业股份有限公司 | Method for measuring in-plane displacement of MEMS |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4909859B2 (en) * | 2007-09-28 | 2012-04-04 | 株式会社日立ハイテクノロジーズ | Inspection apparatus and inspection method |
US9147251B2 (en) * | 2012-08-03 | 2015-09-29 | Flyby Media, Inc. | Systems and methods for efficient 3D tracking of weakly textured planar surfaces for augmented reality applications |
-
2015
- 2015-12-31 CN CN201511034482.3A patent/CN105678757B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101569543A (en) * | 2008-04-29 | 2009-11-04 | 香港理工大学 | Two-dimensional displacement estimation method for elasticity imaging |
CN103729849A (en) * | 2013-12-31 | 2014-04-16 | 南京航空航天大学 | Method for calculating digital image morphing initial value |
CN105203033A (en) * | 2015-10-08 | 2015-12-30 | 重庆平伟实业股份有限公司 | Method for measuring in-plane displacement of MEMS |
Also Published As
Publication number | Publication date |
---|---|
CN105678757A (en) | 2016-06-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105678757B (en) | A kind of ohject displacement measuring method | |
CN109269430B (en) | Passive measurement method of diameter at breast height of multiple standing trees based on depth extraction model | |
JP3837575B2 (en) | Speeding up of super-resolution processing | |
CN104484648B (en) | Robot variable viewing angle obstacle detection method based on contour recognition | |
CN104182982B (en) | Overall optimizing method of calibration parameter of binocular stereo vision camera | |
CN100557634C (en) | A camera calibration method based on dual one-dimensional targets | |
CN106683173A (en) | A Method of Improving the Density of 3D Reconstruction Point Cloud Based on Neighborhood Block Matching | |
JPWO2004063991A1 (en) | Multi-parameter high-precision simultaneous estimation method and multi-parameter high-precision simultaneous estimation program in image sub-pixel matching | |
CN110136114B (en) | A kind of wavefront height measurement method, terminal equipment and storage medium | |
CN107133986B (en) | A Camera Calibration Method Based on Two-Dimensional Calibration Object | |
CN103646395B (en) | A kind of High-precision image method for registering based on grid method | |
CN112561807B (en) | End-to-end radial distortion correction method based on convolutional neural network | |
CN112381847B (en) | Pipeline end space pose measurement method and system | |
CN105654547A (en) | Three-dimensional reconstruction method | |
CN103679193A (en) | FREAK-based high-speed high-density packaging component rapid location method | |
CN111325828B (en) | Three-dimensional face acquisition method and device based on three-dimensional camera | |
CN106408596A (en) | Edge-based local stereo matching method | |
WO2022198901A1 (en) | Digital speckle correlation rapid implementation method for extracting seed points on basis of grid | |
CN106296587A (en) | The joining method of tire-mold image | |
WO2018133027A1 (en) | Grayscale constraint-based method and apparatus for integer-pixel search for three-dimensional digital speckle pattern | |
CN109583377A (en) | A kind of control method, device and host computer that pipeline model is rebuild | |
CN112907573B (en) | Depth completion method based on 3D convolution | |
CN112365529B (en) | Tunnel point cloud registration method and device based on gravity center deviation | |
CN103700135B (en) | A kind of three-dimensional model local spherical mediation feature extracting method | |
CN117671031A (en) | Binocular camera calibration method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |