# Research on a Fast Image-Matching Algorithm Based on Nonlinear Filtering
## 2 Theoretical Analysis
### Adaptive RANSAC Algorithm  
The block diagram of the classical RANSAC algorithm consists of three stages: (1) the sampling modeling stage, where random samples are drawn to generate the model to be tested; (2) the model validation stage, where all the samples of the sample set are substituted into the model test one by one and the number of internal points is counted according to the error threshold \(\mathrm{w}\) of the internal point determination; (3) and deriving the optimal model stage, where the number of internal points is compared with the model obtained from each iteration after M iterations and the model with the highest number of internal points is selected as the optimal mapping model for the two sample sets, wherein the determination method is as follows: for a model to be tested, the data sample points that satisfy the model within the error range are the internal points [14]. The adaptive RANSAC algorithm utilized in this paper can dynamically adjust thresholds during the model fitting process. Figure 2 illustrates the process of eliminating mismatched points in the fastimage-matching algorithm based on nonlinear filtering. The computational process is as follows [15]:  
\[\left( \begin{array}{c}x_{1}\\ y_{1}\\ 1\end{array} \right)=\left( \begin{array}{ccc}a_{0}&b_{0}&\Delta x\\ a_{1}&b_{1}&\Delta y\\ 0&0&1\end{array} \right)\left( \begin{array}{c}x\\ y\\ 1\end{array} \right) \tag{6}\]  
where \((x,y)\) represents the coordinates of the original feature point corresponding to \((x_{1},y_{1})\), which representsthe target image feature point coordinates, where \(a_{0}\), \(a_{1}\), \(b_{0}\) and \(b_{1}\) correspond to the parameters of image scaling and image rotation, respectively, and \(\Delta x\) and \(\Delta y\) are the horizontal and vertical offsets of the image. Equation (6) can be calculated to conclude that the relationship between the original image and the matched image has six parameters, so it takes three feature points to be matched to obtain a unique solution. Therefore, this paper adopts the extraction of 3 feature point pairs for random sampling modelinand to ensure matching correctness, this paper sets the threshold of inner point determination to 1. The RANSAC algorithm is used to randomly select three sets of data among all the data to estimate the mapping relationship between the datasets, with confidence probability \(P\). To make sure that there are three sets of random samples in which all the matched pairs of points are endpoints, the number of sampling times M and the rate of endpoints \(e\) need to satisfy the following conditions [16]:  
\[(1-e^{3})^{M}=1-P \tag{7}\]  
The main implementation process of pre-verification is to first randomly select three sets of samples from the entire set of samples \(M\). If all three sets of sample data are inliers of the experimental model, then the remaining samples are tested in full. If the three setsdo not meet the conditions, another three sets of samples are randomly selected from the entire set of sample data for retesting. Figure 2: Schematic diagram of the adaptive RANSAC algorithm. The key to the pre-test [17] lies in choosing the appropriate pre-test samples. The evaluation index in this paper uses the Euclidean distance for the experiment, by obtaining the value of the Euclidean distance for the ascending order of the ranking; the higher the ranking in the front, the better the matching effect. The 100 pairs of feature point groups with the results ranked in the front are used as the starting samples for the pre-test part.