# Research on Two-Dimensional Digital Map Modeling Method Based on UAV Aerial Images
## 2 Feature Extraction and Registration Based on the C-SURF Algorithm
### Improved Canny Edge Detection Algorithm in the C-SURF Algorithm  
The Canny edge detection algorithm is an efficient and straightforward process with a small data footprint. However, when combined with Gaussian filtering during its application, it can weaken the edges, become overly sensitive to noise, and is prone to generating spurious edges. Therefore, before integrating it with the SURF algorithm, it is necessary to modify it by employing high-contrast filtering in place of Gaussian filtering. This modification aims to achieve noise reduction while effectively preserving edge information. The enhanced algorithm is divided into four steps: high-contrast image denoising, gradient calculation, feature extraction, and delayed edge tracking.  
1. High-Contrast Image Denoising The expression of high-contrast filtering is shown as Equation (1): \[h(x,y)=f(x,y)-\frac{\sum\limits_{ij}f(i,j,x,y)\omega(i,j,x,y)}{\sum\limits_{i,j} \omega(i,j,x,y)}\] (1) where \(h(x,y)\) represents the pixel value of the pixel point after H-B filtering, \(f(x,y)\) represents the pixel value of the pixel at coordinate \((x,y)\) in the source image, \(\omega(i,j,x,y)\) represents the weight coefficient of the mask in the filtering process, and \(\omega\) is shown as Equation (2): \[\omega(i,j,x,y)\] \[=e^{-\frac{[(x-i)^{2}+(y-j)^{2}]}{2\sigma_{d}^{2}}+\frac{[(f(x)-f(i,j)]]}{2 \sigma_{f}^{2}}]}\] (2)
2. Gradient calculation By iteratively calculating the pixel gradient magnitude \(G\) and the gradient direction \(\theta\), the extrema of the target function are identified, as shown in Equation (3): \[\left\{\begin{array}{l}G=\sqrt{G_{x}^{2}+G_{y}^{2}}\\ \theta=\tan^{-1}(\frac{G_{y}}{G_{x}})\end{array}\right.\] (3) where \(G_{x}\) and \(G_{y}\) represent the first-order partial derivatives of the pixel gradient in the \(x\) and \(y\) directions, respectively. (3) Feature Extraction The feature extraction process commences with non-maximum suppression, which involves calculating the magnitude of the target pixel in the direction of the gradient to suppress non-maximum values. This is followed by a comparison with pixels within the local neighborhood; if the magnitude of the target pixel exceeds that of its surrounding pixels, it is retained, otherwise, it is discarded. By employing a double-threshold method for image segmentation, all pixel points within the target image are categorized into three classes based on the magnitude of their gradient values: strong edge points with gradient values exceeding the high threshold, weak edges with gradient values between the two thresholds, and pixel points with gradient values below the low threshold. The weak edges require further processing, as they encompass not only genuine edges but also spurious edges induced by noise and grayscale variations. Conversely, the suppressed pixel points no longer appear in the target image. (4) Hysteresis Edge Tracking During the process of non-maximum suppression, weak edges are identified. To filter out the true edges, it is considered that genuine edges are typically connected to strong edges. Therefore, a 3 \(\times\) 3 rectangular window is employed to filter these weak edges. If a strong edge point is detected within this window, the pixel is retained as a true edge; otherwise, it is discarded as a spurious point. Continuous iterative tracking is utilized to confirm the true edges.