## 3 Target Image Optimization Processing
### Improved RANSAC Algorithm
Sample size:  
\[k=\frac{\log(1-p)}{\log(1-\omega^{n})} \tag{15}\]  
Among all matching points of the image to be extracted, \(n\) points are selected as sample points. According to the definition of the parallax gradient, two pairs of matching points are selected among all the extracted data points for calculation and comparison, and the model parameters of the data matching points that meet the requirements are selected; the matching points that do not meet the requirements are excluded. The standard deviation of \(k\) is then used to calculate the size of the standard deviation and compare the number of better matched points obtained for each group by  
\[SD(k)\frac{\sqrt{1-\omega^{n}}}{\omega^{n}} \tag{16}\]  
The points with the best quality of matched points are then brought into the model parameters, all outlier points are removed and the remaining points with higher matching rates are used to calculate the model parameters. Then, a reverse search is performed to determine the correct rate of point pair matching, set the queue value using Hamming distance as a similarity measure, eliminate the feature points that do not meet the conditions and then apply single response matrix verification to gain more accurate matching points. Figure 3: Flowchart of improved mis-matching RANSAC algorithm. Repeating the above steps, we finally obtain the largest number of pairs of correct matching points in the set. The image acquisition was performed using the camera in the middle of the trinocular vision system, and the relay was selected as the template reference for the feature matching experiments. Four cases of interference, rotation, interference plus rotation and scale change were designed. The experiments were conducted with the traditional SURF algorithm and the improved feature matching algorithm based on SURF+RANSAC, respectively, and the results are shown in Figure 4. The correct alignment rate is used to indicate the performance of the algorithm feature descriptors. The higher the correct rate, the higher the accuracy of recognizing the target by the algorithm using the template image, using the directional consistency principle to obtain the matching logarithm. The number of correct matching pairs, the total matching pairs and the algorithm matching time for the initial image and the image to be detected with environmental influence in five cases are counted, as shown in Table 1.  
Figure 4a,c,e,g show the matching results under different situations based on the traditional SURF algorithm, where the corresponding lines of left and right image matching are seriously skewed and quite misleading, with \"one point cor \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Scenes**} & \multirow{2}{*}{**Algorithm**} & **Total Number of** & **Correctly Matching** & **Correct Match** & \multirow{2}{*}{**Matching Time/s**} \\  & & **Matched Pairs** & **Logarithms** & **Rate/\%** & \\ \hline \multirow{2}{*}{Interference} & SURF & 123 & 74 & 60.38 & 1.913 \\  & Improvements & 96 & 93 & 97.32 & 1.482 \\ \hline \multirow{2}{*}{Rotation} & SURF & 138 & 109 & 78.75 & 1.620 \\  & Improvements & 99 & 92 & 93.78 & 1.113 \\ \hline \multirow{2}{*}{Rotation plus interference} & SURF & 103 & 70 & 67.89 & 1.749 \\  & Improvements & 92 & 89 & 96.98 & 0.948 \\ \hline \multirow{2}{*}{Scale change} & SURF & 113 & 87 & 77.32 & 1.561 \\  & Improvements & 98 & 96 & 97.90 & 1.215 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of the performance data of the two algorithms. Figure 4: Experimental comparison of two algorithms in different scenarios. and \"point to point cross matching [20]\". The matching results based on the improved algorithm of SURF+RANSAC combined with the principle of parallax gradient are shown in Figure 4b,d,f,h, which show intuitively that the feature point pairs of relay interface and label information and other details are more uniform, and there is no \"One-to-many\" phenomenon. The alignment effect is greatly improved, and the robustness is better.