## Materials and Methods
### Harbor Candidate Extraction
#### 2.2.2 Harbor Candidate Extraction  
After extracting keypoints of SIFT, we will extract harbor candidates. It is a common method to use SIFT keypoints to match template images and target images [17], so we will use this method. Because the breakwaters of harbors are semi-closed and are also prominent in the sea, we use the breakwaters as the main keypoints of matching. First, we use the matching results between the template images and the test image to get the matched keypoints. In the traditional SIFT algorithm, each SIFT keypoint is described by a vector \(\
u\)=(\(\theta\), \(\sigma\), \(x\), \(y\)), where \(\theta\) is the direction of the feature vector, \(\sigma\) is the scale, \(x\), \(y\) are the spatial coordinates of the keypoint. In order to increase the robustness of keypoints matching, we use the gradient orientation modification SIFT (GOM-SIFT) algorithm and the scale restriction criteria algorithm, which are proposed by [PERSON] [17] to improve the matching rate. In this method, we are going to improve the gradient orientations: when the SIFT descriptor samples the image gradient orientations around the keypoints, we found that the grayscale intensities in the same region of some images were completely different, even that the intensity was opposite, so we use GOM-SIFT to modify the gradient direction. The following formula shows the process of modification:  
\[\beta(\alpha)=\left\{ \begin{array}{c}\alpha,\;\alpha\in[0,180]\\ 360-\beta,\alpha\in(180,360)\end{array} \right. \tag{12}\]  
where \(\alpha\) is gradient orientation and \(\beta\) is modified gradient orientation. However, GOM-SIFT can only remove some incorrect matched keypoints when the image is self-similitude, so we use scale restriction criteria to remove more mismatched keypoints. The definition of scale difference is as follows:  
\[SD(v_{1},v_{2})=\sigma_{1}-\sigma_{2} \tag{13}\]  
We assume that the spatial transformation between pairs of images is affine, and the dimensions of the corresponding local regions are equal, so the \(SD\) value of the correct matched pairs should be  
Figure 4: (**a**) Original image. (**b**) Traditional scale-invariant feature transform (SIFT) keypoints extraction. (**c**) Original image. (**d**) EC-SIFT keypoints extraction. close to a constant, which means that the \(SD\)'s standard deviation of the correct matched pairs should be smaller than the incorrect matched pairs. According to the above principles, we propose scale restriction criteria:  
\[a<SD(v_{1},v_{2})<b \tag{14}\]  
If a matched pair does not accord with the scale restriction criteria, this matched pair will be rejected. To determine the value of \(a\) and \(b\), we form a histogram of all \(SD\) values of matched pairs, the peak in the histogram of \(SD\) values is recorded as \(P_{SD}\), and then the values of \(a\) and \(b\) are obtained by \(P_{SD}\)-\(W\) and \(P_{SD}\)+\(W\), respectively, where \(W\) is a constant. After getting the matched keypoints through GOM-SIFT and scale restriction criteria, we remove some mismatched keypoints. Next, we will use the matched keypoints to extract harbor candidates. Since a harbor is a semi-closed structure, which is composed of regions such as breakwaters and docks, the matched keypoints belonging to the harbor regions should stay within a certain range. Therefore, we get some harbor candidates by dividing the matched keypoints into several groups based on their spatial location. In order to achieve it, we use a quality threshold (QT) clustering method [1], and the flow of the QT algorithm is shown in Figure 17. Quality threshold is an algorithm that classifies matched keypoints into high quality clusters; it ensures high quality clusters by limiting the diameter of the clusters. This method prevents dissimilar keypoints from being forced under the same cluster and ensures that only high-quality clusters are formed. The specific method is implemented as follows:  
1.