Abstract
Influenced by light reflection and water fog interference, ship infrared images are mostly blurred and have low signal-to-noise ratio. In this paper, an improved adaptive Canny edge detection algorithm for infrared image of ship is proposed, which aims to solve the threshold of the traditional Canny cannot be adjusted automatically and the shortcomings of sensitivity to noise. The contrast limited adaptive histogram equalization algorithm is adopted to enhance the infrared image, the morphological filter replaces the Gauss filter to smooth the image, and the OTSU algorithm is utilized to adjust the high and low thresholds dynamically. The experimental results show that the improved Canny algorithm, which can not only improve the contrast of the image and automatically adjust the threshold but also reduce the background sea clutter and false edges, is an effective edge detection method.
Keywords
Introduction
The infrared image, mainly describing thermal radiation of target and background, is widely used in the field of ship traffic management. However, most of the ship infrared images are blurred, have low signal-to-noise ratio (SNR), and polluted due to the limitations of detection device. Thus, a suitable edge detection method that can extract the ship’s edges accurately and clearly is essential. The general edge detection methods include differential operator method, template matching method, boundary and curve enhancement technology, wavelet edge detection, edge focusing, texture edge monitoring, neural network edge detection, and so on. Some algorithms process a whole infrared image without considering the prior information of the target region, which may lead to the failure detection of the target from the background. Some algorithms consider the prior information of the target region; however, these algorithms are too complex to meet the needs of the quasi real-time application of infrared reconnaissance. Ying-juan et al. 1 and Sharifi et al. 2 classified various edge detectors, by testing and comparing their advantages and insufficiencies. The traditional Canny algorithm is an effective optimal edge detector. 3 It is susceptible to noise pollution, but its Gauss variance value and dual threshold are not adaptive. 4 As a result, too much detailed edges are detected. In order to solve this problem, the OTSU algorithm, 5 which is proposed on the basis of the principle of least squares, is adopted to select the threshold automatically. In this article, an adaptive Canny algorithm is proposed by image enhancement and automatic calculation of the gradient adaptive edge detection. The adaptive Canny algorithm is applied to the ship infrared image edge detection and the experiment results show that the ship’s edges are detected more clearly with much less noises.
Traditional Canny algorithm
Three traditional criteria
The three criteria of the Canny edge detection algorithm, proposed by Canny 3 in 1986 based on optimization algorithm, are as follows:
Traditional Canny algorithm
Generally, there are four steps of the traditional Canny algorithm: Gauss filtering, gradient calculation, non-maximum suppression, and threshold and edge determination. 6
First, the Gauss filter, especially the two-dimensional Gauss function, is used to denoise the image. The formula of Gauss filter is shown as follows
where
where
As mentioned above,
The gradient vectors should be “non-maximum suppression” after calculating the gradient at each point of the image, that is, to make out all the local maximums to get rid of these non-maximum points of the local.8-adjacency pixels method is used in the Canny edge detection algorithm, that is, the interpolation results were compared with the center point in the 0/45/90/135 direction, if the center point of the gradient is less than the maximum value of the interpolation results, the maximum is set to 0; if the center point is greater than the maximum gradient interpolation results, the maximum is set to 1. The 8-adjacency pixels are shown in Table 1.
8-adjacency pixels.
Finally, the threshold is selected and the edges are connected. The traditional Canny algorithm adopts dual thresholds
Deficiency of the traditional Canny
The Gauss filter is used to smooth the image in the traditional Canny algorithm, in which the parameter
Furthermore, the high threshold
Improved Canny algorithm
Most of the ship infrared images are blurred, with noises caused by sea wave, fog, and other light reflection. In order to reduce these interferences effectively, this article adopts contrast limited adaptive histogram equalization (CLAHE) algorithm to enhance the ship infrared image and replaces Gauss filter with morphological filtering. Finally, the improved OTSU method is used to optimize the dual thresholds of gradient to achieve adaptive detection of ship edges in infrared images.
CLAHE algorithm
By adjusting the dynamic range of the images, the histogram equalization (HE) can improve the image contrast and gray tone to enhance the contrast effect. 10 Because the HE algorithm can make a global dynamic adjustment of the image, it is likely to increase the contrast of the random sea waves and reduce the contrast of the useful signals such as the ship contour, and reduce the gray level, resulting in the details loss of the ship.11,12 The CLAHE algorithm, 13 which equalizes the blocks of the image, can achieve better effects. The blocks of image share adjacent information fully by linear interpolation and can adjust local gray level adaptively. The specific steps of CLAHE algorithm are as follows:
where
where

Pixels redistribution.
Repeat the above distributing until all the pixels are sheared.
Step 6: reconstructing the pixel gray value. The gray values of the pixels in the center of each block are obtained and are taken as the reference points to calculate the gray values of each point in the output image by the bilinear interpolation method.
The original ship infrared image is shown in Figure 2(a), while Figure 2(b) and (c) are the comparison results of HE algorithm and CLAHE algorithm. It can be seen from the figures that the background sea wave and other noise are suppressed greater in Figure 2(c) than in Figure 2(b), and the edges of the ship are clearer, too.

Experimental results: (a) original infrared image, (b) HE algorithm result, and (c) CLAHE algorithm result.
Mathematical morphology filtering
On the basis of rigorous mathematical theory, the mathematical morphology filter processes the image nonlinearly.
14
The smoothing process of the image by mathematical morphology is actually an opening-and-closing operation.
15
Assuming that
where ◯ is an open operator and · is a closed operator. Thus, the smoothed image
In this article, the
The tiny and bright details of sea wave can be reduced effectively after mathematical morphology filtering, while the overall gray level distribution and large bright area are not affected.
High and low thresholds
The high and low thresholds of Canny algorithm are usually determined by OTSU algorithm, 5 which can obtain the optimal segmentation gray value on the basis of the gray histogram of the image. 6 It is noted that the gradient of the background sea wave in the image has the characteristics of the same amplitude, direction, and spatial correlation. In order to filter the false edges introduced by the waves around the ship, this article adaptively determines the high and low thresholds by OTSU algorithm based on the gradient histogram of the image.
The pixels in the image array after non-maximum suppression are divided into two categories: contour pixels and background pixels. Let
The cost function is defined as
The high threshold
Simulation results and discussion
In order to test and verify the effectiveness of the improved Canny algorithm, two ship infrared images with different gradient magnitudes were selected for experiments. The experimental results are shown below.
In the experiments,

Experimental results: (a) first original infrared image, (b) Canny algorithm result, (c) improved Canny algorithm result, (d) second original infrared image, (e) Canny algorithm result, and (f) improved Canny algorithm result.
Conclusion
Infrared radiation has merits such as good adaptability to environment, long transmission distance, and can penetrate fog, haze, water, and so on; therefore, it is suitable for ship management system. However, due to the limitation of the instrument and the complexity of the sea surface, the infrared images also have the problems of ambiguity, low SNR, and sea clutter. Since the traditional Canny algorithm requires artificial setting thresholds and sensitive to noise, this article proposed an improved Canny algorithm for ocean ship infrared image to detect edges adaptively. First, CLAHE algorithm is utilized to enhance the ship infrared image, then mathematical morphology filtering is used for smoothing the image. Finally, the improved OTSU method is used to optimize the high thresholds
Footnotes
Handling Editor: Jeng-Shyang Pan
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: The research was supported by Initial Scientific Research Fund of Fujian University of Technology (GY-Z12079), Pre-research Project of Fujian University of Technology (GY-Z13018), and Natural Science Foundation of Science and Technology Department of Fujian (2017 H11171120/2016H0028).
