# Infrared Ship Target Detection Based on Dual Channel Segmentation Combined with Multiple Features
## 3 Detection Algorithm
### Local Low Gray Region Extraction and Segmentation
#### 3.2.2 Dual-Channel Segmentation and Multi-Feature Discrimination  
From the detection results of local low grayscale regions, it can be seen that in areas with significant grayscale transitions, such as the sea-sky interface or the coastline, there are large grayscale differences. As a result, the convolution produces relatively large results, and some regions with a similar grayscale are not suppressed but are similar to the target, causing interference. Considering the overall nature of the background regions, this paper proposes a method to segment the image using two channels and fuse the segmentation results from both channels to achieve the final target detection. In this paper, the adaptive  
Figure 9: Local low gray regions detection results corresponding to images (**a**–**d**) in Figure 2.  
threshold segmentation method is adopted to achieve image segmentation, and the specific segmentation formulas are as follows:  
\[th=\mu+k*\sigma \tag{10}\]  
\[bw(i,j)=\left\{ \begin{matrix}1,&if\ result(i,j)>th,\\ 0,&else.\end{matrix} \right. \tag{11}\]  
where \(th\) expresses the segmentation threshold, and \(\mu\) and \(\sigma\) represent the mean and standard deviation of the input image _result_. The coefficient \(k\) is used for adjustment. In the first channel, the detection result of local low grayscale regions serves as the input image _result_. In the second channel, the input image \(img\) is the result of taking the complement of the pre-processed image \(orin\). The complement calculation is performed according to Equation (12). \[img(i,j)=255-orin(i,j) \tag{12}\]  
Due to the existence of regions with a similar grayscale to the target, further analysis and evaluation are needed to obtain the potential target regions. In this paper, four feature quantities, namely aspect ratio (_Ratio_), compactness (_Compactness_), rectangularity (_Rectangularity_) and area ratio (\(Area_{ratio}\)), are used to describe the shape characteristics of the potential targets. The expressions of each feature quantity are as follows:  
\[Ratio=\frac{width}{height} \tag{13}\]  
\[Compactness=\frac{(Perimeter)^{2}}{Area} \tag{14}\]  
\[Rectangularity=\frac{Area}{Rectangle} \tag{15}\]  
\[Area_{ratio}=\frac{up}{down} \tag{16}\]  
where _width_ and _height_ represent the width and height of the minimum enclosing rectangle of the candidate target region, _Perimeter_ and _Area_ express the perimeter and area of the candidate target, respectively. _Rectangle_ represents the area of the minimum enclosing rectangle, _up_ and _down_ represent the areas of the upper and lower parts when the candidate target is divided into two parts evenly. The aspect ratio criterion is employed to eliminate elongated strip-like interferences. Compactness and rectangularity measurements are utilized to filter out irregularly shaped interferences. Ship targets exhibit a characteristic of being \"smaller on top and larger on the bottom.\" By dividing the target region evenly into upper and lower parts, the upper part's area should be smaller than the lower part, and this ratio is used to further remove interference. Additionally, this paper focuses on patch targets with a relatively uniform grayscale distribution (larger than 9 \(\times\) 9 pixels), but the targets should not be too large. Larger targets tend to have clearer textures, leading to a non-uniform grayscale distribution and potential segmentation errors. Therefore, the number of pixels for the target is limited to a range of 81 to 1500 pixels in this study. Figure 10 depicts the multi-feature discrimination process, where the connected area within the red box represents the actual ship target, while the remaining areas correspond to interference. In more detail, (a) in the figure illustrates the result of the adaptive segmentation of (d) in Figure 9. Subsequently, (b) shows the outcome of applying an area threshold to (a). Moving forward, (c) showcases the result of evaluating the Ratio, Rectangularity, and Compactness of (b).