Image Registration Algorithm Based on Parallax Constraint and Clustering Analysis

To resolve the problem of slow computation speed and low matching accuracy in image registration, a new image registration algorithm based on parallax constraint and clustering analysis is proposed. Firstly, Harris corner detection algorithm is used to extract the feature points of two images. Secondly, use Normalized Cross Correlation (NCC) function to perform the approximate matching of feature points, and the initial feature pair is obtained. Then, according to the parallax constraint condition, the initial feature pair is preprocessed by K-means clustering algorithm, which is used to remove the feature point pairs with obvious errors in the approximate matching process. Finally, adopt Random Sample Consensus (RANSAC) algorithm to optimize the feature points to obtain the final feature point matching result, and the fast and accurate image registration is realized. The experimental results show that the image registration algorithm proposed in this paper can improve the accuracy of the image matching while ensuring the real-time performance of the algorithm.


Introduction
Image processing is to obtain valid information as much as possible by processing a limited number of images. Image registration is a basic problem in image processing. It refers to the process of matching two or more pictures containing the same information through spatial domain transform. To get more information about a scene, the priority is to register two or more images that contain the same scene. However, when images with large amount of information have a high real-time requirement, the results of image registration are often unsatisfactory. Therefore, how to ensure the registration speed and improve the registration accuracy is the focus of this paper.
The image registration method has been appreciated by researchers. Professor Lowe first proposed the Scale-Invariant Feature Transform (SIFT) algorithm and improved it in 2004 [1]. The feature descriptor extracted by this algorithm has good stability for scale transform, illumination, and rotation, so the registration accuracy is high and the robustness is good. However, there is a problem that the registration efficiency is not high due to the large amount of calculation in the feature point description. Qizhi Xu et al. proposed a blob-like structure to improve the registration accuracy of the SIFT algorithm on satellite imagery [2]. Bin Li  distance strategy and the improved RANSAC based on the existing energy function [3]. Jianwei Fan et al. combined with sparse representation when registering SAR images [4].
According to the literature [5], feature matching is the most important and indispensable step in the overall image registration process. The quality of the matching is related to the success of the final registration results. Therefore, most scholars focus on finding a better way to complete the work of feature matching. The method of feature matching can be divided into two categories: region-based method and feature-based method. Normally, the image contains a large amount of available information, including feature points (high curvature points, corner points, etc.), straight lines, edges, contours, closed areas and statistical features (center of gravity, geometric moments), and so on. Among them, the feature points in the image registration process have their own unique advantages, so most feature-based image registration algorithms are based on point features [6].
Corner point is a very important local feature in the image, that is in the image of the larger curvature of the two places or the intersection of multiple lines. Corner points contain a wealth of two-dimensional structure information, easy to be detected, and can adapt to changes in ambient light, it is preferred feature of many of the features matching algorithm. Therefore, this paper uses the corner point feature to research the image matching algorithm .
The main chapters of the paper are arranged as follows: (1) Combining the research background and current status of image registration, the research direction is determined as the feature matching algorithm based on corner point by analyzing the current research hotspot. (2) Introduce the main idea in each feature matching stage of the improved algorithm and give the algorithm flow. (3) Compare the proposed method with the unimproved algorithm, it is proved that the proposed algorithm has obvious improvement in matching speed and accuracy, and then the conclusion is drawn.

Harris Corner Detection
Harris feature point is the point where the brightness of the image changes abruptly in multiple directions. By detecting the change of the brightness of the image in a window, the feature point can be separated from other pixels, usually using an autocorrelation matrix which is similar to the image brightness differential point detection operator: In (2.1), x I and y I are the partial derivatives of x and y directions, ( , ) x y Z is the normalized kernel function, and the higher weight is given to the pixels near the center point.
In the experiment, the Gaussian kernel is used, that is where V is the variance of the Gaussian kernel. Let 1 O and 2 O detect the eigenvalues of the operator. When the matrix A is at the feature point position, it will has two nonnegative eigenvalues at the same time, and the Harris discriminate is The constant α usually evaluate to 0.04. If a pixel is a local maximum and R is greater than the set threshold, it is a Harris feature point. u v are the i-th and j-th feature points to be matched in the two graphs respectively, The NCC function is used to describe the degree of correlation between the feature points [7]. The NCC function is defined as follows: Obviously, the value range of ij C is (-1,1), the higher the value of ij C , the higher the degree of correlation between i d and j d . For a given feature point, the matching set of points with the highest degree of correlation in all matching points are given.

Improved Approximate Matching and Preprocessing Algorithm
After the initial feature point matching, there will be a lot of false match points, to a large extent affected the fine match. The matching point pairs are mapped to the corresponding feature quantity space, such as the distance feature vector between the pair of points and the direction feature vector. In the eigenvector space, there is no obvious rule of the mismatched point pair distribution, and the correct matching point distribution is more concentrated. Therefore, the K-means clustering method is used to eliminate the misplaced point pairs.
The K-means clustering algorithm is to find a partition scheme of k clusters by iteration, and make the global error is minimal when the mean of the k clusters is used to represent the corresponding samples [8]. The K-means clustering algorithm is based on the criterion of least sum of square error. The cost function is: The basic idea of K-means clustering algorithm based on parallax constraint is described below: It can be observed that the distance feature vector of the correct matching point pair is very similar when the feature point matching is carried out. If the distance of the matching point pair is expressed by Euclidean distance, no more than 10 pixels; and the distribution of correct matching points is concentrated, and it is suitable to use K-means clustering to eliminate false matching points.
Assuming that the set of matches obtained in Section 2.1 is M : The K-means clustering algorithm is greatly influenced by the selection of the initial clustering center and the number of categories. In the case of value clustering, for example, the difference between the correct matching points is no more than 10 pixels. Therefore, 10 pixels is used as the classification limit, so that the difference between deu is less than 10 pixels, until the aggregation can not be continued. The Kmeans clustering is performed using the mean of each category as the center of the initial cluster.
Algorithm K-means clustering algorithm based on distance feature Step 1 Calculate the distance feature vector D according to the matching point set M , and the classification limit is clu d = 10.
Step 2 Perform a monotonically increasing sort of distance feature vector D .

Step 3 For each component
1 k d is marked as a class; otherwise, k d is marked as a new class. After determining all the components, we get the number of categories c , and the mean of each category is taken as the initial mean value 1 2 , , , c P P P c P , , that is, , represents the rest of position vectors in the i-th class after reclassification.
Step 4 For each component k d in D , calculate its distance from i P and merge it into the i P class with the smallest distance, Step 5 If the center points 1 2 , , , c P P P c P , no longer change and select the category i P with the largest number of components in the category, then the matching point set corresponding to the class i P is the correct match point set; otherwise, Step4 is recalculated until meeting the conditions.

Fine Matching by RANSAC
There are often some false match pairs in the initial match, so the mismatch is further eliminated by fine matching. Common optimization algorithms are Least Median of Squares (LMedS), M-estimator, RANSAC. In this paper, RANSAC algorithm is used for fine matching.
The basic idea of the RANSAC algorithm is as follows: first construct an objective function, then extract the initial value of the parameter in the function by extracting the minimum point set multiple times, divides all the data into "inliers" and "outliers" with the initial parameters, "inliers" is to meet the estimated parameters of the point, "outside point" on the contrary, finally use all the "inliers" to recalculate the objective function parameters.
In the RANSAC algorithm, F is the basic transformation matrix; m is the current number of samples; r is the current number of four points that are randomly selected to meet the condition (three points are non-collinear); M is the maximum number of samples; R is the maximum number of four points that are randomly selected to meet the condition (three points are non-collinear); N is the number of samples required to get p , p is the probability that at least one random choice contains s "inliers" after N times sampling, and p > 0.95 usually. N and p satisfy the following relation: Where s is the number of feature points per sample, and s = 8; ' H represents the probability that a selected feature point is an "inliers". In the algorithm; t is the distance threshold; Gui is the criterion of "inliers" and "outliers"; bin is a set of most "inliers"; and bnin is the number of bin .

Experimental Results And Analysis
In order to verify the effectiveness of the proposed algorithm, we selected two images that were rotated and translated to carry out simulation experiments.

Experiments on Harris corner detection and approximate matching
As shown in Figure 1 and Figure 2, the number of feature points of the improved algorithm is greatly reduced. In the preprocessing of the improved algorithm, some of the correct matching points are also removed along with the wrong match point, but the number of remaining matching points is enough, it does not affect subsequent matching process.    Figure 4 show the effect of rough matching between two algorithms. In the rough matching result of the improved algorithm, the distance feature vectors of most matching points are similar, which will be beneficial to the process of fine matching.

Experiments on fine matching
The fine matching results are given in Figure 5 and Figure 6, it can be seen that the improved algorithm promote the precision of image registration and reduce the impact of the wrong matching point pairs effectively.

Figure 5.
Fine matching of unimproved algorithm Figure 6. Fine matching of improved algorithm It can be observed from Table 1 that the time of K-means clustering matching algorithm based on Euclidean distance of parallax constraint is reduced by 22% compared with the unimproved algorithm, and after the features matching of K-means clustering, time of RANSAC matching is greatly shortened, only 9.64% of the unimproved algorithm. The proposed algorithm improves the speed of image registration. were left. Finally, the number of matching points by the two algorithms is 127 pairs and 120 pairs respectively. The accuracy rate of two algorithms are presented in Table 3. The wrong matching points of the improved algorithm are reduced by half compared with the unimproved algorithm, and the accuracy rate is increased to 98.33%.

Conclusion
In order to overcome the shortcomings of traditional feature point matching method in real time and poor precision, firstly Harris corner instead of SIFT DoG corner is uesd to improve registration speed, and feature point matching optimization scheme based on parallax constraint and clustering analysis is proposed. The K-means clustering algorithm is introduced into the feature point rough matching, which effectively simplifies the initial matching set and eliminates most of the wrong matching. The experimental results show that the matching algorithm is correct and efficient, and the precision and speed of feature matching process are improved in image registration.