CN103679720A - Fast image registration method based on wavelet decomposition and Harris corner detection - Google Patents
Fast image registration method based on wavelet decomposition and Harris corner detection Download PDFInfo
- Publication number
- CN103679720A CN103679720A CN201310661197.9A CN201310661197A CN103679720A CN 103679720 A CN103679720 A CN 103679720A CN 201310661197 A CN201310661197 A CN 201310661197A CN 103679720 A CN103679720 A CN 103679720A
- Authority
- CN
- China
- Prior art keywords
- image
- wavelet decomposition
- corner
- matching
- approximate
- 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.)
- Pending
Links
- 238000000354 decomposition reaction Methods 0.000 title claims abstract description 56
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000001514 detection method Methods 0.000 title claims abstract description 21
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 35
- 230000009466 transformation Effects 0.000 claims description 35
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 claims description 8
- 230000008569 process Effects 0.000 abstract description 7
- 238000001914 filtration Methods 0.000 abstract description 4
- 239000011159 matrix material Substances 0.000 description 10
- 238000004364 calculation method Methods 0.000 description 7
- 238000013519 translation Methods 0.000 description 6
- 230000014616 translation Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 230000000875 corresponding effect Effects 0.000 description 3
- 238000006073 displacement reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000005070 sampling Methods 0.000 description 3
- 238000000844 transformation Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000008030 elimination Effects 0.000 description 2
- 238000003379 elimination reaction Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000013178 mathematical model Methods 0.000 description 2
- 238000005316 response function Methods 0.000 description 2
- 244000291564 Allium cepa Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004883 computer application Methods 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 238000011524 similarity measure Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000002187 spin decoupling employing ultra-broadband-inversion sequences generated via simulated annealing Methods 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Images
Landscapes
- Image Analysis (AREA)
Abstract
本发明公开了一种基于小波分解与Harris角点检测的快速图像配准方法,通过小波分解使得图像的大小缩小从而减少了运算量,提高了图像配准的实时性,且小波分解的过程为一个低通滤波的过程,能够处理噪声,此外本发明采用Harris角点检测算法进行角点配对,同时还对误匹配点角点进行了剔除使得抗噪、抗干扰能力强,进一步提高了图像匹配的准确度。
The invention discloses a fast image registration method based on wavelet decomposition and Harris corner point detection. The size of the image is reduced through wavelet decomposition, thereby reducing the amount of computation and improving the real-time performance of image registration. The process of wavelet decomposition is as follows: A low-pass filtering process can handle noise. In addition, the present invention uses the Harris corner detection algorithm for corner pairing, and at the same time eliminates the corners of mis-matching points, so that the anti-noise and anti-interference capabilities are strong, and the image matching is further improved. the accuracy.
Description
技术领域technical field
本发明涉及数字图像处理与模型辨识相关技术,适用于包括导航、机动目标跟踪、状态监控等图像处理与模式识别相关领域,具体涉及一种基于小波分解与Harris角点检测的快速图像配准方法。The invention relates to technologies related to digital image processing and model identification, and is suitable for image processing and pattern recognition related fields including navigation, maneuvering target tracking, state monitoring, etc., and specifically relates to a fast image registration method based on wavelet decomposition and Harris corner detection .
背景技术Background technique
图像配准是图像处理的一个基础问题。随着计算机技术的发展,图像配准算法得到了快速的发展,在遥感、军事、医疗、导航、成像制导、变迁检测等领域得到广泛的应用。Image registration is a fundamental problem in image processing. With the development of computer technology, image registration algorithms have developed rapidly, and have been widely used in remote sensing, military, medical, navigation, imaging guidance, transition detection and other fields.
目前,图像配准方法主要有两类:一类是基于区域的图像配准方法,是指利用两幅图像像素间的灰度值关系来确定变换模型的参数,该方法利用了图像的全部灰度信息,配准精度高,但计算量大,实时性差。目前常见的基于区域的图像配准算法有比值法、基于块匹配方法(又称基于模板配准算法)、网格匹配法等,这种方法适用于图像间只有水平、垂直平移的情况。At present, there are two main types of image registration methods: one is the region-based image registration method, which refers to using the gray value relationship between the pixels of two images to determine the parameters of the transformation model. degree information, the registration accuracy is high, but the calculation amount is large and the real-time performance is poor. At present, common region-based image registration algorithms include ratio method, block-based matching method (also known as template-based registration algorithm), grid matching method, etc. This method is suitable for situations where there are only horizontal and vertical translations between images.
另一类是基于特征的图像配准方法,其基本步骤如下:首先提取基准图像和待配准的图像特征集,然后进行特征匹配,最后利用配准的特征之间的关系估算出基准图像和待配准图像之间几何变换模型及其参数变量值。这种方法利用图像中的明显特征来,而不是利用图像中全部的信息计算图像之间的变换,对图像灰度的变化具有鲁棒性,能够适用于存在更复杂几何变换的图像之间的配准。常见的基于特征的图像配准算法有:Harris角点检测算法、SUSAN角点检测算法、SIFT尺度不变特征转换算法等。The other is a feature-based image registration method, the basic steps of which are as follows: first extract the feature set of the reference image and the image to be registered, then perform feature matching, and finally use the relationship between the registered features to estimate the reference image and The geometric transformation model and its parameter variable values between the images to be registered. This method uses the obvious features in the image instead of using all the information in the image to calculate the transformation between images. It is robust to changes in image grayscale and can be applied to images with more complex geometric transformations. Registration. Common feature-based image registration algorithms include: Harris corner detection algorithm, SUSAN corner detection algorithm, SIFT scale invariant feature transformation algorithm, etc.
目前,基于特征的图像配准算法中Harris角点检测算法是应用最广泛的图像配准方法,但是这种算法计算复杂,使得匹配实时性较差,此外,由于该方法存在角点误匹配问题,使得其抗噪、抗干扰能力差,从而导致图像匹配准确度差问题。At present, the Harris corner detection algorithm is the most widely used image registration method in the feature-based image registration algorithm, but this algorithm is computationally complex, which makes the real-time matching poor. , making its anti-noise and anti-interference ability poor, resulting in poor image matching accuracy.
发明内容Contents of the invention
有鉴于此,本发明提供了一种基于小波分解与Harris角点检测的快速图像配准方法,通过小波分解使得图像的大小缩小从而减少了运算量,提高了图像配准的实时性,且小波分解的过程为一个低通滤波的过程,能够处理噪声,此外本发明采用Harris角点检测算法进行角点配对,同时还对误匹配点角点进行了剔除使得抗噪、抗干扰能力强,进一步提高了图像匹配的准确度。In view of this, the present invention provides a fast image registration method based on wavelet decomposition and Harris corner detection, which reduces the size of the image through wavelet decomposition, thereby reducing the amount of computation and improving the real-time performance of image registration, and the wavelet The process of decomposing is a process of low-pass filtering, which can handle noise. In addition, the present invention uses Harris corner detection algorithm to carry out corner pairing, and also eliminates the corners of wrong matching points so that the anti-noise and anti-interference ability is strong, and further Improved image matching accuracy.
一种基于小波分解与Harris角点检测的快速图像配准方法,包括下列步骤:A fast image registration method based on wavelet decomposition and Harris corner detection, comprising the following steps:
步骤一、将基准图像和待配准图像分别从三维的真彩色图像转换为二维的灰度图像,将基准图像和待配准图的灰度图分别记为图像f1和图像f2;Step 1, converting the reference image and the image to be registered from a three-dimensional true color image to a two-dimensional grayscale image respectively, and recording the grayscale images of the reference image and the image to be registered as image f 1 and image f 2 respectively;
步骤二、对图像f1和图像f2进行N级小波分解,分别获得一个第N次小波分解时的近似图像,其中,图像f1进行N次分解后的近似图像称为LLNA,图像f2进行N次分解后的近似图像称为LLNB;Step 2: Perform N-level wavelet decomposition on image f1 and image f2 , and obtain an approximate image of the Nth wavelet decomposition respectively, wherein the approximate image after N-time decomposition of image f1 is called LLNA, and image f2 The approximate image after N times of decomposition is called LLNB;
步骤三、采用Harris角点检测算法对步骤二小波分解后得到的近似图像LLNA和LLNB进行角点提取;Step 3, using the Harris corner detection algorithm to extract corners from the approximate images LLNA and LLNB obtained after step 2 wavelet decomposition;
步骤四、采用NCC匹配算法对步骤三得到的近似图像LLNA提取的角点与近似图像LLNB提取的角点进行角点粗配准,获得匹配角点对;Step 4, using the NCC matching algorithm to roughly register the corner points extracted from the approximate image LLNA obtained in step 3 with the corner points extracted from the approximate image LLNB to obtain a pair of matching corner points;
步骤五、采用RANSAC算法对步骤四获得的角点对进行验证,剔除误匹配的角点对,得到正确的匹配角点对;Step 5. Use the RANSAC algorithm to verify the corner point pairs obtained in step 4, and eliminate the wrongly matched corner point pairs to obtain the correct matching corner point pairs;
步骤六、利用步骤五得到的匹配角点对进行几何变换获得模型变换参数。Step 6: Using the matching corner point pairs obtained in Step 5 to perform geometric transformation to obtain model transformation parameters.
较佳的,步骤二中的N等于2。Preferably, N in step 2 is equal to 2.
较佳的,步骤六中的几何变换为仿射变换。Preferably, the geometric transformation in step six is an affine transformation.
有益效果:Beneficial effect:
1)本发明首先,通过N级小波分解后,图像的大小缩小为原来的1/2N,所以,基于小波分解后的图像进行图像配准,大大缩短了计算复杂性,提高了图像配准的匹配实时性。1) In the present invention, firstly, after N-level wavelet decomposition, the size of the image is reduced to 1/2 N of the original, so image registration is performed based on the image after wavelet decomposition, which greatly reduces the computational complexity and improves image registration real-time matching.
其次,本发明与传统的基于Harris角点的图像配准算法相比,引进了小波分解和剔除误匹配点两个步骤,小波分解过程是一个低通滤波的过程,对含有噪声的图像进行小波分解,其实是对图像进行了去噪声处理,能够将不重要的细节信息处理掉,只保留重要的基本信息,从而降低了噪声干扰,提高了图像匹配准确度。采用RANSAC算法对角点对进行验证,剔除误匹配的角点对,提高了图像配准方法的抗噪和抗干扰能力,进一步提高了图像的匹配准确度。Secondly, compared with the traditional image registration algorithm based on Harris corner points, the present invention introduces two steps of wavelet decomposition and elimination of mismatching points. The wavelet decomposition process is a low-pass filtering process. Decomposition, in fact, is to denoise the image, which can process unimportant details and keep only important basic information, thereby reducing noise interference and improving image matching accuracy. The RANSAC algorithm is used to verify the corner point pairs, and the wrongly matched corner point pairs are eliminated, which improves the anti-noise and anti-interference ability of the image registration method, and further improves the matching accuracy of the image.
2)本发明实施例对图像进行了二级小波分解,能够压缩图像的同时不增加计算的复杂度,进一步保证了图像匹配的准确度和实时性。2) The embodiment of the present invention performs two-level wavelet decomposition on the image, which can compress the image without increasing the complexity of calculation, further ensuring the accuracy and real-time performance of image matching.
3)本发明实施例利用得到的匹配角点对采用仿射变换获得几何变换模型,该几何变换能够实现图像平移、旋转等多种变换,同时又无复杂的计算量,能够进一步保证图像匹配的准确度和实时性。3) The embodiment of the present invention utilizes the obtained matching corner point pairs to obtain a geometric transformation model using affine transformation. This geometric transformation can realize various transformations such as image translation, rotation, etc., and at the same time, there is no complicated calculation amount, which can further ensure the accuracy of image matching. accuracy and timeliness.
附图说明Description of drawings
图1为本发明的流程图;Fig. 1 is a flowchart of the present invention;
图2为小波分解得到的近似图像;Fig. 2 is the approximate image obtained by wavelet decomposition;
图3为基准图像和待配准图像的近似图像上提取的角点;Fig. 3 is the corner point extracted on the approximate image of the reference image and the image to be registered;
图4为采用NCC匹配算法对获得的匹配角点对;Figure 4 is a pair of matching corner points obtained by using the NCC matching algorithm pair;
图5为采用RANSAC算法剔除误匹配的角点对。Figure 5 shows the use of the RANSAC algorithm to eliminate incorrectly matched corner pairs.
具体实施方式Detailed ways
下面结合附图并举实施例,对本发明进行详细描述。The present invention will be described in detail below with reference to the accompanying drawings and examples.
本发明提供了一种基于小波分解与Harris角点检测的快速图像配准方法,该方法在计算机硬件环境下进行,Windows2000/XP;matlab或C语言或C++等任何一种语言环境软件均可实现,本实施例采用matlab语言环境,流程图如图1所示,具体包括下列步骤,:The present invention provides a kind of fast image registration method based on wavelet decomposition and Harris corner point detection, this method is carried out under computer hardware environment, Windows2000/XP; Matlab or C language or C++ etc. any kind of language environment software all can realize , present embodiment adopts matlab language environment, and flow chart as shown in Figure 1, specifically comprises the following steps:
步骤一、在matlab中输入两幅图像F1和F2,其中F1为基准图像,F2为待配准图像,采用matlab中的函数rgb2gray()分别将两幅图像分别从三维的真彩色图像转换为二维的灰度图像,将基准图像和待配准图的灰度图分别记为图像f1和图像f2。Step 1. Input two images F 1 and F 2 in matlab, where F 1 is the reference image and F 2 is the image to be registered. Use the function rgb2gray() in matlab to convert the two images from the three-dimensional true color The image is converted into a two-dimensional grayscale image, and the grayscale images of the reference image and the image to be registered are respectively recorded as image f 1 and image f 2 .
步骤二、对图像f1和图像f2进行N级小波分解,分别获得一个第N次小波分解时的近似图像,其中,图像f1进行N次分解后的近似图像称为LLNA,图像f2进行N次分解后的近似图像称为LLNB。Step 2: Perform N-level wavelet decomposition on image f1 and image f2 , and obtain an approximate image of the Nth wavelet decomposition respectively, wherein the approximate image after N-time decomposition of image f1 is called LLNA, and image f2 The approximate image after N times of decomposition is called LLNB.
例如,对图像f1进行一级小波分解时,首先用低通滤波器(L)和高通滤波器(H)对图像行向进行小波分解,得到的高频分量和低频分量数据;然后将得到的高频分量和低频分量数据的列向分别用低通滤波器(L)和高通滤波器(H)进行滤波,从而得到图像的低频部分,又称为图像的一级近似信息LL1A、图像沿水平方向的细节信息HL1A、图像沿垂直方向的细节信息LH1A;图像沿对角线方向的细节信息HH11。For example, when performing first-level wavelet decomposition on the image f 1 , first use the low-pass filter (L) and high-pass filter (H) to perform wavelet decomposition on the row direction of the image to obtain the high-frequency component and low-frequency component data; then the obtained The column direction of high-frequency component and low-frequency component data is filtered by low-pass filter (L) and high-pass filter (H) respectively, so as to obtain the low-frequency part of the image, which is also called the first-level approximation information LL1A of the image, image edge The detail information HL1A in the horizontal direction, the detail information LH1A in the vertical direction of the image, and the detail information HH11 in the diagonal direction of the image.
对图像进行二级小波分解即对获得的图像一级分解近似信息LL1A进行二次小波分解,获得图像的二级近似信息LL2A,图像沿水平方向的细节信息HL2A,图像沿垂直方向的细节信息LH2A,为图像沿对角线方向的细节信息HH2A。The second-level wavelet decomposition of the image is to perform the second-level wavelet decomposition on the obtained first-level decomposition approximation information LL1A of the image, and obtain the second-level approximation information LL2A of the image, the detail information HL2A of the image along the horizontal direction, and the detail information LH2A of the image along the vertical direction , is the detail information HH2A of the image along the diagonal direction.
当进行N级小波分解时,得到图像的N级近似信息;图像沿水平方向的细节信息HLNA;图像沿垂直方向的细节信息LHNA;图像沿对角线方向的细节信息HHNA。When N-level wavelet decomposition is performed, the N-level approximate information of the image is obtained; the detailed information of the image along the horizontal direction HLNA; the detailed information of the image along the vertical direction LHNA; the detailed information of the image along the diagonal direction HHNA.
这种分解是一种无损变焦,且近似分量是光滑的,因而小波分解具有压缩图像及抗噪声的优点,图像分解次数的选择非常重要,分解的层数越多,进行图像配准时计算复杂度越低、匹配效率越高,然而,分解次数太多的话会丢失大量的图像信息。因此,在对图像进行分解时,选择合适的分解层数不仅简化图像信息,同时保留了图像的重要信息,本实施例对图像进行二级小波分解,能够压缩图像的同时不增加计算的复杂度,进一步保证了图像匹配的准确度和实时性。This decomposition is a lossless zoom, and the approximate components are smooth, so wavelet decomposition has the advantages of compressing images and anti-noise. The choice of image decomposition times is very important. The more layers of decomposition, the more computational complexity for image registration. The lower the , the higher the matching efficiency. However, if the number of decompositions is too large, a large amount of image information will be lost. Therefore, when decomposing an image, selecting an appropriate number of decomposition layers not only simplifies the image information, but also retains the important information of the image. This embodiment performs two-level wavelet decomposition on the image, which can compress the image without increasing the complexity of calculation. , which further ensures the accuracy and real-time performance of image matching.
对图像f1和图像f2进行二级小波分解,分别获得小波分解后的近似图像,其中,图像f1进行N次分解后的近似图像称为LL2A,图像f2进行N次分解后的近似图像称为LL2B,如图2所示,左图为LL2A,右图为LL2B。Perform two-level wavelet decomposition on image f 1 and image f 2 to obtain approximate images after wavelet decomposition respectively. Among them, the approximate image of image f 1 after N times of decomposition is called LL2A, and the approximate image of image f 2 after N times of decomposition is called LL2A. The image is called LL2B, as shown in Figure 2, with LL2A on the left and LL2B on the right.
步骤三、采用Harris角点检测算法分别对步骤二小波分解后得到的近似图像LL2A和LL2B进行角点信息提取。Step 3: using the Harris corner detection algorithm to extract corner information from the approximate images LL2A and LL2B obtained after the wavelet decomposition in step 2, respectively.
Harris角点检测算法(曲喜文.一种改进的Harris角点检测方法.机电技术,2012,40-42)原理如下:The Harris corner detection algorithm (Qu Xiwen. An improved Harris corner detection method. Electromechanical Technology, 2012, 40-42) works as follows:
首先,将待检测的图像窗口w向任意方向移动微小的位移,假定图像窗口w内的目标像素的坐标是(x,y),在x和y方向移动的位移分别为u和v,则将点(x,y)在一个(u,v)正方形窗口中的灰度变化量定义为:First, move the image window w to be detected by a small displacement in any direction, assuming that the coordinates of the target pixel in the image window w are (x, y), and the displacements in the x and y directions are u and v respectively, then set The grayscale variation of a point (x, y) in a (u, v) square window is defined as:
其中:w(x,y)为窗函数,这里选用高斯窗口,以提高抗干扰能力;I(x,y),I(x+u,y+v)是目标像素的灰度函数;o(u2+v2)是位移无穷小量;Ix和Iy为目标像素的一阶灰度梯度,其中,Among them: w(x, y) is the window function, the Gaussian window is selected here to improve the anti-interference ability; I(x, y), I(x+u, y+v) is the gray function of the target pixel; o( u 2 +v 2 ) is the infinitesimal amount of displacement; I x and I y are the first-order gray gradient of the target pixel, where,
写成矩阵形式:Written in matrix form:
则
其中:M是目标像素的自相关矩阵;设λ1和λ2是M的两个特征值,λ1和λ2的值的大小决定了该目标像素为角点、边缘或平坦区域:Among them: M is the autocorrelation matrix of the target pixel; Let λ 1 and λ 2 be two eigenvalues of M, the size of the value of λ 1 and λ 2 determines that the target pixel is a corner point, an edge or a flat area:
(1)角点:λ1和λ2的值都比较大;(1) Corner point: the values of λ 1 and λ 2 are relatively large;
(2)边缘:λ1和λ2的值,一个大,一个小;(2) Edge: the values of λ 1 and λ 2 , one big and one small;
(3)平坦区:λ1和λ2都很小。(3) Flat region: Both λ 1 and λ 2 are small.
为了避免对自相关矩阵M进行特征值分解,定义角点响应函数CRF为:In order to avoid the eigenvalue decomposition of the autocorrelation matrix M, the corner response function CRF is defined as:
CRF=det(M)-k*trace2(M)CRF=det(M)-k*trace 2 (M)
其中,det(M)为矩阵M的行列式;trace(M)为矩阵M的迹(矩阵对角线元素的和);k为经验值,通常取0.04。(毛雁明,兰美辉,王运琼,冯乔生.一种改进的基于Harris的角点检测方法,计算机技术与发展,2009.05)Among them, det(M) is the determinant of matrix M; trace(M) is the trace of matrix M (the sum of matrix diagonal elements); k is an empirical value, usually 0.04. (Mao Yanming, Lan Meihui, Wang Yunqiong, Feng Qiaosheng. An Improved Harris-Based Corner Detection Method, Computer Technology and Development, 2009.05)
本实施例对两幅图像采用Harris算法提取角点时,角点判断的准则为:When the present embodiment adopts the Harris algorithm to extract corner points for two images, the criterion for corner point judgment is:
当角点响应函数CRF的值大于某个预先设定的阈值时,即为候选的角点,否则不是角点,阈值的大小根据所需角点的多少来决定。When the value of the corner response function CRF is greater than a preset threshold, it is a candidate corner, otherwise it is not a corner, and the threshold is determined according to the number of required corners.
因此,要确保角点的数目足够多,就需要设置合适的阈值,根据经验可知,角点的数目在200左右时,就能保证图像配准时有足够的角点对,因此,通过多次实验,针对本实施例图像中角点阈值设置为0.000149044。Therefore, to ensure that the number of corner points is large enough, it is necessary to set an appropriate threshold. According to experience, when the number of corner points is around 200, it can ensure that there are enough corner point pairs for image registration. Therefore, through multiple experiments , the corner threshold in the image of this embodiment is set to 0.000149044.
对图2中的两幅图像进行Harris角点提取,并将提取的角点在图像上做上标记,得到图3所示的角点图像。The Harris corner points are extracted from the two images in Figure 2, and the extracted corner points are marked on the images to obtain the corner point images shown in Figure 3.
Harris算子是一种有效的点特征提取算子,有以下几个优点:The Harris operator is an effective point feature extraction operator, which has the following advantages:
①计算简单:Harris算子中只用到灰度的一阶差分以及滤波,操作简单;① Simple calculation: only the first-order difference of gray level and filtering are used in the Harris operator, and the operation is simple;
②提取的点特征均匀而且合理;② The extracted point features are uniform and reasonable;
③稳定:Harris算子的计算公式中只涉及到一阶导数,因此,对图像旋转、灰度变化、噪声影响和视点变换不敏感,是比较稳定的一种点特征提取算子。③ Stability: The calculation formula of the Harris operator only involves the first-order derivative. Therefore, it is not sensitive to image rotation, gray level changes, noise effects and viewpoint changes, and is a relatively stable point feature extraction operator.
步骤四、采用NCC匹配算法对步骤三得到的近似图像LL2A提取的角点与近似图像LL2B提取的角点进行角点粗配准,获得匹配角点对。Step 4: Use the NCC matching algorithm to roughly register the corner points extracted from the approximate image LL2A obtained in step 3 with the corner points extracted from the approximate image LL2B to obtain matching corner point pairs.
NCC匹配算法是一种经典的匹配算法,该方法是在基准图像和待配准图像中以提取的角点为中心,构造M×N的模板,分别获得模板图像(对应基准图像以角点为中心构造的M×N模板图像)和背景图像(对应待配准图像以角点为中心构造的M×N模板图像),通过计算模板图像和背景图像的互相关值来确定匹配的程度,互相关的最大值决定了模板图像在背景图像中的位置和相似程度,进而得到基准图像和待配准图像上角点的相关程度。The NCC matching algorithm is a classic matching algorithm. The method is to construct an M×N template centered on the extracted corner points in the reference image and the image to be registered, and obtain the template images respectively (corresponding to the reference image with the corner points as The M×N template image constructed at the center) and the background image (corresponding to the M×N template image constructed around the corner of the image to be registered), the degree of matching is determined by calculating the cross-correlation value of the template image and the background image, and the cross-correlation The maximum value of the correlation determines the position and similarity of the template image in the background image, and then obtains the correlation degree of the corner points on the reference image and the image to be registered.
在实际匹配应用中,模板图像和背景图像的相似性通过度量函数来度量,本实施例采用归一化积相关匹配度量函数C来度量,其定义为In actual matching applications, the similarity between the template image and the background image is measured by a metric function, and this embodiment uses a normalized product correlation matching metric function C to measure, which is defined as
其中,f(xi,yj)为基准图像上某一点(xi,yj)处的灰度值,为待配准图像上某一点处的灰度值。分别为基准图像和待配准图像上M×N的模板上灰度均值,其值为:Among them, f( xi ,y j ) is the gray value at a certain point ( xi ,y j ) on the reference image, A point on the image to be registered gray value at . Respectively, the mean value of the gray level on the M×N template on the reference image and the image to be registered, and its value is:
其中:m和n分别为图像的行和列。Among them: m and n are the rows and columns of the image, respectively.
C为互相关系数,当C=1时,说明基准图像和待配准图像上相应的模板是完全相关的,当C=0时,表示不相关。在实际应用中,由于光线、噪声对图像的影响,要使图像完全相关是很难的,因此这里的相关性存在一定的误差。实验中,取C大于0.8时,则认为两个模板是匹配的,否则是不匹配的。(陈卫兵.几种图像相似性度量的匹配性能比较[J].计算机应用,2010(1))。C is the cross-correlation coefficient. When C=1, it means that the reference image and the corresponding template on the image to be registered are completely related. When C=0, it means that they are not related. In practical applications, due to the influence of light and noise on the image, it is difficult to make the image completely correlated, so there is a certain error in the correlation here. In the experiment, when C is greater than 0.8, the two templates are considered to match, otherwise they do not match. (Chen Weibing. Comparison of Matching Performance of Several Image Similarity Measures [J]. Computer Applications, 2010(1)).
本实施例采用上述算法对步骤三中的近似图像LL2A提取的角点信息与近似图像LL2B提取的角点信息进行角点粗配准,获得匹配角点对,如图4所示。In this embodiment, the above algorithm is used to perform rough registration of corner points between the corner point information extracted from the approximate image LL2A in step 3 and the corner point information extracted from the approximate image LL2B to obtain matching corner point pairs, as shown in FIG. 4 .
步骤五、采用RANSAC算法对步骤四获得的角点对进行验证,剔除误匹配的角点对,如图5所示,得到正确的匹配角点对,提高了图像配准方法的抗噪和抗干扰能力,进一步提高了图像的匹配准确度。Step 5. Use the RANSAC algorithm to verify the corner point pairs obtained in step 4, and remove the wrongly matched corner point pairs. As shown in Figure 5, the correct matching corner point pairs are obtained, which improves the anti-noise and anti-noise of the image registration method. The ability to interfere further improves the matching accuracy of images.
从图3可知,角点对的配准并不准确,有正确的角点对,也存在误匹配的角点对,因此,为了提高角点对配准的精度,需要进行误匹配角点对的剔除。It can be seen from Figure 3 that the registration of corner point pairs is not accurate, there are correct corner point pairs, and there are also incorrectly matched corner point pairs. Therefore, in order to improve the accuracy of corner point pair registration, it is necessary to perform mismatch of elimination.
RANSAC是“Random Sample Consensus(随机采样一致性)”的缩写,是在1981年由Fischler和Bolles最先提出的,它是从一组包含异常数据的数据集中迭代估计数学模型的参数,得到有效数据的算法。RANSAC一般采用比较少的点估计出模型,再利用剩余的点来验证模型,这样就减轻存在严重错误点时异常数据对模型参数估计的影响。RANSAC is the abbreviation of "Random Sample Consensus (Random Sample Consensus)", which was first proposed by Fischler and Bolles in 1981. It iteratively estimates the parameters of the mathematical model from a set of data sets containing abnormal data to obtain valid data. algorithm. RANSAC generally uses relatively few points to estimate the model, and then uses the remaining points to verify the model, thus reducing the impact of abnormal data on model parameter estimation when there are serious error points.
RANSAC算法的基本假设为:The basic assumptions of the RANSAC algorithm are:
(1)数据由“局内点”组成;(1) The data consists of "intra-office points";
(2)“局外点”是不能适应该模型的数据;(2) "Outlier points" are data that cannot adapt to the model;
(3)除此之外的数据属于噪声。(3) Data other than this is noise.
这里所说的局内点(inliers)是指正确的数据,异常点也称为局外点(outliers),是指偏离正常范围,无法适应数学模型的数据。这些异常点通常是由于噪声、错误的测量方法或对数据的错误假设产生的。The inliers mentioned here refer to the correct data, and the abnormal points are also called outliers, which refer to the data that deviate from the normal range and cannot adapt to the mathematical model. These outliers are usually due to noise, wrong measurements, or wrong assumptions about the data.
RANSAC算法的基本思想描述如下:The basic idea of RANSAC algorithm is described as follows:
1)考虑一个初始化模型参数所需的最小样本数n和一个样本集P,集合P的样本数S*大于n,然后从集合P中随机抽取包含n个样本的子集S初始化模型M;1) Consider a minimum number of samples n required to initialize the model parameters and a sample set P, the number of samples S* of the set P is greater than n, and then randomly select a subset S containing n samples from the set P to initialize the model M;
2)将余集CPs=P/S与模型M误差小于某一设定阈值t的样本集及子集S作为模型M的内点集S*,称为该模型M的一致集;2) The sample set and subset S whose error between the residual set C P s=P/S and the model M is less than a certain threshold t is taken as the internal point set S* of the model M, which is called the consistent set of the model M;
3)若模型M的内点集个数大于Q(其中Q表示正确模型所含一致集的最小个数),则认为是正确的模型参数,并利用内点集S*采用最小二乘等方法重新计算新模型,随机抽取新的子集S',并重复(2)和(3)两个步骤;3) If the number of interior point sets of the model M is greater than Q (where Q represents the minimum number of consistent sets contained in the correct model), it is considered to be the correct model parameter, and the least square method is used to use the interior point set S* Recalculate the new model, randomly select a new subset S', and repeat (2) and (3) two steps;
4)在完成一定的抽样次数后,若未找到一致集则算法失败,否则选取抽样后得到的最大一致集的模型M来判断内外点,算法结束。4) After completing a certain number of sampling times, if no consistent set is found, the algorithm fails. Otherwise, the model M of the largest consistent set obtained after sampling is selected to judge the internal and external points, and the algorithm ends.
其中,步骤2)中阈值t是用来判断样本集是否在模型误差内,一般需要采取人工干预的方式来设置合适的阈值,一般取0.001~0.01;Among them, the threshold t in step 2) is used to judge whether the sample set is within the model error. Generally, manual intervention is required to set an appropriate threshold, which is generally 0.001 to 0.01;
步骤3)中的随机抽取样本集次数,记为k,它决定着模型参数的精度;The number of randomly drawn sample sets in step 3), denoted as k, determines the accuracy of the model parameters;
其中:m是计算约束模型所需的最小匹配点对数量,在这里我们选用四个点对来计算基本矩阵,所以m=4;Among them: m is the minimum number of matching point pairs required to calculate the constraint model, here we choose four point pairs to calculate the basic matrix, so m=4;
p为我们期望达到的概率,比如令P=0.98,也就意味着我们可以找到m个正确匹配点对的概率为98%;p is the probability we expect to achieve, for example, let P=0.98, which means that the probability that we can find m correct matching point pairs is 98%;
e是正确的数据比例,它是未知的,它会随着程序的运行不断更新,比如在第一次选取了4个点对,计算出模型M,我们判断出满足M的内点,这些内点在匹配点对集合中占40%,那么e就等于0.4,我们第二次又选取了另外4个点对计算出M,我们判断出满足M的内点,这些内点在匹配点对集合中占70%,那么e就更新到0.7,依此类推。e is the correct data ratio, it is unknown, it will be updated continuously with the operation of the program, for example, after selecting 4 point pairs for the first time and calculating the model M, we judge the interior points that satisfy M, these interior points Points account for 40% of the set of matching point pairs, then e is equal to 0.4, and we select another 4 point pairs to calculate M for the second time, and we judge the inliers that satisfy M, and these inliers are in the matching point pair set accounted for 70%, then e is updated to 0.7, and so on.
步骤六、利用步骤五得到的匹配角点对进行几何变换获得模型变换参数。Step 6: Using the matching corner point pairs obtained in Step 5 to perform geometric transformation to obtain model transformation parameters.
图像配准就是找出两图像中的同一目标对象的空间位置关系,从而确定图像间的匹配关系,在进行图像配准之前,需要选择正确的变换模型。图像的配准依赖于所选择的几何变换模型,常见的获得几何变换模型的方法有刚体变换、相似变换、仿射变换和投影变换等,由于仿真变换能够实现图像的平移、旋转、尺度缩放等多种变换,同时又无复杂的计算量,能够进一步保证图像匹配的准确度和实时性。因此,本实施例中选用仿射变换。Image registration is to find out the spatial position relationship of the same target object in two images, so as to determine the matching relationship between images. Before image registration, it is necessary to select the correct transformation model. Image registration depends on the selected geometric transformation model. Common methods for obtaining geometric transformation models include rigid body transformation, similarity transformation, affine transformation, and projective transformation. Since the simulation transformation can realize translation, rotation, and scaling of images, etc. A variety of transformations without complicated calculations can further ensure the accuracy and real-time performance of image matching. Therefore, affine transformation is selected in this embodiment.
假设待配准图像上一点的坐标(u,v)与基准图像上一点的坐标(x,y)为一对匹配的角点对,写成齐次坐标的表示形式分别为(u',v',w')与(x,y,1),则待配准图像经仿射变换变换到基准图像的公式为:Assuming that the coordinates (u, v) of a point on the image to be registered and the coordinates (x, y) of a point on the reference image are a pair of matching corner points, the expressions written as homogeneous coordinates are (u', v' ,w') and (x,y,1), the formula for transforming the image to be registered to the reference image through affine transformation is:
上式中是具有8个自由度的变换矩阵。In the above formula is a transformation matrix with 8 degrees of freedom.
根据上面得到的角点匹配点集,采用随机采样一致性就能够估计出这8个参数:According to the set of corner point matching points obtained above, these 8 parameters can be estimated by using random sampling consistency:
将这些参数带入式(3),可得:Putting these parameters into formula (3), we can get:
根据上式可知,共有8个未知数,为了求解这8个未知数,至少需要4对配准的角点。According to the above formula, there are 8 unknowns in total. In order to solve these 8 unknowns, at least 4 pairs of registered corner points are needed.
根据上面得到的角点对,得到的变换模型矩阵为:According to the corner point pairs obtained above, the obtained transformation model matrix is:
上面得到的仿射模型变换参数,只是针对小波分解后的近似图像进行的角点配准得到的,原来两幅图像配准时的伸缩系数、旋转角度与他们分别进行小波分解后的两幅近似图像的伸缩系数、旋转角度分别相等;The affine model transformation parameters obtained above are only obtained by the corner registration of the approximate images after wavelet decomposition. The expansion coefficient and rotation angle of the original two images when they are registered are the same as the two approximate images after wavelet decomposition. The expansion coefficient and rotation angle are equal respectively;
若原图像配准时的平移量为(4Δtx,4Δty)时,则进行一次小波分解后的两幅近似图像的平移量为(2Δtx,2Δty),进行二次小波分解后的两幅图像的平移量为(Δtx,Δty),因此,原来的两幅图像的仿射变换模型矩阵为:If the translation of the original image registration is (4Δt x ,4Δt y ), the translation of the two approximate images after the first wavelet decomposition is (2Δt x ,2Δt y ), and the two images after the second wavelet decomposition The translation amount of is (Δt x ,Δt y ), therefore, the affine transformation model matrix of the original two images is:
这样,就能获得两幅图像的模型变换参数。In this way, the model transformation parameters of the two images can be obtained.
综上所述,以上仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。To sum up, the above are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310661197.9A CN103679720A (en) | 2013-12-09 | 2013-12-09 | Fast image registration method based on wavelet decomposition and Harris corner detection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310661197.9A CN103679720A (en) | 2013-12-09 | 2013-12-09 | Fast image registration method based on wavelet decomposition and Harris corner detection |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103679720A true CN103679720A (en) | 2014-03-26 |
Family
ID=50317171
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310661197.9A Pending CN103679720A (en) | 2013-12-09 | 2013-12-09 | Fast image registration method based on wavelet decomposition and Harris corner detection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103679720A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104751458A (en) * | 2015-03-23 | 2015-07-01 | 华南理工大学 | Calibration angle point detection method based on 180-degree rotating operator |
TWI548566B (en) * | 2014-05-23 | 2016-09-11 | 國立臺北科技大學 | Real-time optical flow estimation of whole image using multi-thread processing |
CN107123227A (en) * | 2017-07-06 | 2017-09-01 | 合肥科大立安安全技术股份有限公司 | A kind of embedded image flame detector and its recognition methods based on two waveband |
CN104008542B (en) * | 2014-05-07 | 2017-10-20 | 华南理工大学 | A kind of Fast Corner matching process for specific plane figure |
CN107547881A (en) * | 2016-06-24 | 2018-01-05 | 上海顺久电子科技有限公司 | A kind of auto-correction method of projection imaging, device and laser television |
CN108230375A (en) * | 2017-12-27 | 2018-06-29 | 南京理工大学 | Visible images and SAR image registration method based on structural similarity fast robust |
CN109285140A (en) * | 2018-07-27 | 2019-01-29 | 广东工业大学 | A kind of printed circuit board image registration evaluation method |
CN109345513A (en) * | 2018-09-13 | 2019-02-15 | 红云红河烟草(集团)有限责任公司 | Cigarette package defect detection method with cigarette package posture calculation function |
WO2019127049A1 (en) * | 2017-12-26 | 2019-07-04 | 深圳配天智能技术研究院有限公司 | Image matching method, device, and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101216939A (en) * | 2008-01-04 | 2008-07-09 | 江南大学 | Multi-resolution medical image registration method based on quantum behavioral particle swarm optimization |
CN101238993A (en) * | 2008-02-01 | 2008-08-13 | 哈尔滨工业大学 | Medical Ultrasound Image Registration Method Based on Integer Lifting Wavelet Multiresolution Analysis |
KR20100044043A (en) * | 2008-10-21 | 2010-04-29 | 충북대학교 산학협력단 | Smd test method using the discrete wavelet transform |
CN202134044U (en) * | 2011-07-06 | 2012-02-01 | 长安大学 | An Image Stitching Device Based on Corner Block Extraction and Matching |
-
2013
- 2013-12-09 CN CN201310661197.9A patent/CN103679720A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101216939A (en) * | 2008-01-04 | 2008-07-09 | 江南大学 | Multi-resolution medical image registration method based on quantum behavioral particle swarm optimization |
CN101238993A (en) * | 2008-02-01 | 2008-08-13 | 哈尔滨工业大学 | Medical Ultrasound Image Registration Method Based on Integer Lifting Wavelet Multiresolution Analysis |
KR20100044043A (en) * | 2008-10-21 | 2010-04-29 | 충북대학교 산학협력단 | Smd test method using the discrete wavelet transform |
CN202134044U (en) * | 2011-07-06 | 2012-02-01 | 长安大学 | An Image Stitching Device Based on Corner Block Extraction and Matching |
Non-Patent Citations (2)
Title |
---|
陈锦盛: "基于DSP的图像拼接技术研究", 《万方学位论文数据库》, 2 March 2012 (2012-03-02) * |
黄洋: "全景图像拼接算法研究", 《万方学位论文数据库》, 21 November 2013 (2013-11-21) * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104008542B (en) * | 2014-05-07 | 2017-10-20 | 华南理工大学 | A kind of Fast Corner matching process for specific plane figure |
TWI548566B (en) * | 2014-05-23 | 2016-09-11 | 國立臺北科技大學 | Real-time optical flow estimation of whole image using multi-thread processing |
CN104751458A (en) * | 2015-03-23 | 2015-07-01 | 华南理工大学 | Calibration angle point detection method based on 180-degree rotating operator |
CN104751458B (en) * | 2015-03-23 | 2017-08-25 | 华南理工大学 | A kind of demarcation angular-point detection method based on 180 ° of rotation operators |
CN107547881A (en) * | 2016-06-24 | 2018-01-05 | 上海顺久电子科技有限公司 | A kind of auto-correction method of projection imaging, device and laser television |
CN107547881B (en) * | 2016-06-24 | 2019-10-11 | 上海顺久电子科技有限公司 | A kind of auto-correction method of projection imaging, device and laser television |
CN107123227A (en) * | 2017-07-06 | 2017-09-01 | 合肥科大立安安全技术股份有限公司 | A kind of embedded image flame detector and its recognition methods based on two waveband |
WO2019127049A1 (en) * | 2017-12-26 | 2019-07-04 | 深圳配天智能技术研究院有限公司 | Image matching method, device, and storage medium |
CN108230375A (en) * | 2017-12-27 | 2018-06-29 | 南京理工大学 | Visible images and SAR image registration method based on structural similarity fast robust |
CN108230375B (en) * | 2017-12-27 | 2022-03-22 | 南京理工大学 | Fast and Robust Visible Light Image and SAR Image Registration Method Based on Structural Similarity |
CN109285140A (en) * | 2018-07-27 | 2019-01-29 | 广东工业大学 | A kind of printed circuit board image registration evaluation method |
CN109345513A (en) * | 2018-09-13 | 2019-02-15 | 红云红河烟草(集团)有限责任公司 | Cigarette package defect detection method with cigarette package posture calculation function |
CN109345513B (en) * | 2018-09-13 | 2021-06-01 | 红云红河烟草(集团)有限责任公司 | Cigarette package defect detection method with cigarette package posture calculation function |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103679720A (en) | Fast image registration method based on wavelet decomposition and Harris corner detection | |
CN103310453B (en) | A kind of fast image registration method based on subimage Corner Feature | |
CN107301661B (en) | High-resolution remote sensing image registration method based on edge point features | |
CN103236064B (en) | A kind of some cloud autoegistration method based on normal vector | |
CN102750537B (en) | Automatic registering method of high accuracy images | |
CN102236798B (en) | Image matching method and device | |
CN102651132B (en) | Medical image registration method based on intersecting cortical model | |
CN103093434B (en) | Non-local wiener filtering image denoising method based on singular value decomposition | |
CN101924871A (en) | Video Object Tracking Method Based on Mean Shift | |
CN113298853B (en) | Step-by-step progressive two-stage medical image registration method | |
CN108932699B (en) | Transform domain-based 3D matching harmonic filtering image denoising method | |
CN106991695A (en) | A kind of method for registering images and device | |
CN102819839B (en) | High-precision registration method for multi-characteristic and multilevel infrared and hyperspectral images | |
CN114092531B (en) | Infrared-visible light image registration method and system | |
CN103679193A (en) | FREAK-based high-speed high-density packaging component rapid location method | |
CN105957054A (en) | Image change detecting method | |
CN104834931A (en) | Improved SIFT algorithm based on wavelet transformation | |
CN105513094A (en) | Stereo vision tracking method and stereo vision tracking system based on 3D Delaunay triangulation | |
CN104504723A (en) | Image registration method based on remarkable visual features | |
CN106485741A (en) | A kind of method of the non-firm point set registration retaining partial structurtes | |
CN107944497A (en) | Image block method for measuring similarity based on principal component analysis | |
CN115578428A (en) | A Method and System for Infrared and Visible Image Registration Considering Mode Differences | |
CN102324043A (en) | Feature Descriptor Based on DCT and Image Matching Method for Optimal Spatial Quantization | |
CN109785372A (en) | Basis matrix robust estimation method based on soft decision optimization | |
CN112927169A (en) | Remote sensing image denoising method based on wavelet transformation and improved weighted nuclear norm minimization |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140326 |