# Multiscale Feature-Based Infrared Ship Detection
## 2 Materials and Methods
### Multiscale Gradient Feature-Based Sea-Sky Line Extraction  
In the images captured by forward-looking infrared cameras, ships are typically located below the sea-sky line. Therefore, the extraction of the sea-sky line in the image can exclude the interference from the sky and shore background and simultaneously reduce the area to be detected from the global image to the area below the sea-sky line. The sea surface exhibits a different radiation intensity and depth of field from the sky and shore background. As a result, the grayscale difference between the areas above and below the sea-sky line in the infrared image is distinct and can be characterized using gradient features. However, due to the low spatial resolution of infrared images, neighboring pixels exhibit a certain  
Figure 1: Framework of the proposed method. The red line shows the position of the extracted sea-sky-line, and the blue bounding box represent CRs where ship might exists. degree of correlation. Consequently, the sea-sky line may not be sufficiently prominent when calculating the gradient image using a small-scale gradient operator. In our method, interlacing in both rows and columns is used to increase the scale of gradient calculations, which can be described as Equation (1):  
\[\left\{ \begin{array}{l}grad_{x}(i,j)=0.5\times\left|f(i-d_{1},j)-f(i+d_{1},j)+ f(i-d_{2},j)-f(i+d_{2},j)\right|\\ grad_{y}(i,j)=0.5\times\left|f(i,j-d_{1})-f(i,j+d_{1})+f(i,j-d_{2})-f(i,j+d_{2}) \right|\end{array} \right., \tag{1}\]  
where \(grad_{x}(i,j)\), \(grad_{y}(i,j)\) represent the gradient value in the horizontal and vertical direction, respectively. \(f(i,j)\) is the intensity value of the pixel \((i,j)\) in the input image. As shown in Figure 2, the results of large-scale gradient map are presented, in which the values of \(d_{1}\) and \(d_{2}\) are set as 3 and 4, respectively. It is evident that the sea-sky lines in the vertical gradient images are significantly enhanced, appearing as generally long, approximately horizontal straight lines that traverse the entire image. Consequently, the vertical gradient images can be cumulated along the horizontal direction to highlight the position of the sea-sky line, which can be represented as Equation (2):  
\[SumGrad_{y}(j)=\sum_{i=1}^{width}grad_{y}(i,j), \tag{2}\]  
where _width_ represents the number of the columns in the original image. According to Equation (2), the results of \(SumGrad_{y}\) are presented in Figure 3, in which three local maximum values are highlighted. From the above results, it is observed that when there is more interference near the actual sea-sky line, the value of \(SumGrad\) at the location of the real sea-sky line may not be the highest but is still one of the three peaks. Therefore, \(SumGrad_{y}\) can serve as an effective basis for extracting the candidate positions of the sea-sky line. The extraction process for \(Pos(i)\), the candidate position of the sea-sky line, is shown in Figure 4.  
The candidate positions derived from the previous processes may contain both cloud and clutter disturbances as well as the real sea-sky line, and so, further screening is necessary. As illustrated in Figure 2, cloud interference in the original image typically exists in the top area, while clutter interference occurs in the bottom area, with the real sea-sky line located in between. The grayscale changes more dramatically above the clouds and below the sea clutter, while it changes relatively gently above and below the sea-sky line. Therefore, a criterion for discriminating the sea-sky line can be proposed: the gradient values above the real sea-sky line are smaller, while the gradient values below it are larger. In contrast, the gradient values are larger above the cloud and smaller below it. Additionally, the gradient values are larger both above and below the sea clutter. Figure 2: Large-scale gradient map. (**a**) Original image. (**b**) Horizontal gradient map. (**c**) Vertical gradient map.