Abstract
This article presents a sea-sky-line detection algorithm in a sea-sky environment for unmanned surface vehicles. Obstacle detection is a vital branch for unmanned surface vehicles on the ocean. Because of the specificity and complexity of the marine navigation environment, we first apply semantic segmentation for marine images. The complete marine scene is divided into sky area, middle mixture area, and seawater area before sea-sky-line detection. Segmenting the marine environment is beneficial for narrowing the obstacle search area, accelerating the rate of obstacle detection, and improving detection accuracy. Therefore, a fast, robust, and accurate sea-sky image segmentation method is urgently required. Therefore, we present a method that lies in a probabilistic graphical model for segmenting marine images. The Gaussian mixture model is introduced as the probability distribution model for the marine image. The sky, middle mixture, and seawater areas are generated by three Gaussian models. The expectation–maximization algorithm is utilized to maximize the log-likelihood function, and the parameters of the Gaussian mixture probability density function that recover the marine image distribution are available after several iterations. Furthermore, to solve the problem of incorrect convergence direction caused by unsatisfactory initialization conditions, the gray level co-occurrence matrix is referenced to initialize the Gaussian components. The coarse segmentation results rely on the gray level co-occurrence matrix and are used to calculate the prior initialization parameters of Gaussian components and obtain the prior distribution information of marine images, which mitigates the harmful influence of poor initialization. The algorithm is tested on a data set consisting of the marine obstacle detection dataset (MODD) public data set and our collected images. The results on this data set demonstrate that the proposed method is more robust and that a superior initialization condition can effectively accelerate the convergence velocity of the iterative process for Gaussian components.
Introduction
Recently, with the development of robotic structure designing and fabricating, as well as the improvement in control automation technology, various specialized robots have been applied to diverse technical fields. 1 –3 As special surface robots, the unmanned surface vehicles (USVs) have received extensive attention and play an important role in military missions, such as reconnaissance, anti-submarine, patrol, and civil missions, including search and rescue, navigation, and surface environment detection. Sea-sky-line detection is commonly defined as one of the basic tasks of various sea surface missions, such as collision avoidance, maritime obstacle detection, and path following. 4 –6 While obstacle detection and obstacle avoidance are performed on the sea surface, the vision system is only devoted to detecting obstacles in the area that adjoins the sea-sky-line and sea area, without focusing on the whole marine environment. 7,8 Additionally, due to the random noise in the image, the cloud layer in the sky and background on the coast greatly increases the cost of computation and decreases the result detection accuracy. However, the interference information can be eliminated, and the accuracy of obstacle detection can be improved after the sea-sky-line is detected. In the process of maritime autonomous navigation and path planning, 9 –12 distant targets, such as ships and buoys, generally lie in the neighborhood of the sea-sky-line and break the linearity of the sea-sky-line. Locating the region of sea-sky-line and narrowing the search range, a target object in the distance can be recognized rapidly, and the precision can be enhanced. In the unmanned boat attitude measurement, detection of the sea-sky-line provides important information for the vehicles’ attitude measurement. The past evidence reveals that many difficulties are encountered when detecting the sea-sky-line. For example, the outline of the sea-sky-line is straight in general cases, but when there is a convex coast or distortion, the outline becomes curved. In addition, lighting, complex backgrounds, occlusions, sea waves, water reflection, and tilt also interfere with the final detection results. The USV is affected by the waves, and the vibration of the body will cause the attitude of the camera to change in real time, which increases the difficulty of segmentation for marine images. 13 –15 Many other offshore tasks have also greatly benefited from a sea-sky-line detection method, which is robust to many complicated situations. Therefore, many researchers are committed to achieving a fast and robust sea-sky-line detection method. The classic sea-sky-line detection algorithm mainly includes two types of methods: one type of algorithm is based on linear fitting, 16 –19 and the other is based on semantic segmentation. 20 –22 The linear fitting method for sea-sky-line detection has a fast velocity but low precision and poor robustness. Semantic segmentation algorithms are slower but provide benefits for subsequent tasks. More importantly, some semantic segmentation methods can also implement real-time detection.
In the past few years, many sea-sky-line detection methods have been proposed. Liang et al. 16 proposed a sea-sky-line detection method based on linear fitting. They adapted a clustering algorithm to filter candidate points and located the subregion that covers the sea-sky-line through texture features, which improves the robustness of detection results. However, the appearance of the sea-sky-line is not linear but curved in many situations, especially near the coast. Ma et al. 17 presented an algorithm based on a line segment detector (LSD) and Hough line detection, which is different from the traditional method framework. However, the region growing algorithm was applied in LSD 23,24 to generate a straight line, and the long line segment was often split into multiple line segments for obstacle occlusion and distant freighters. Sun and Fu 18 proposed a horizon line detection method named coarse-fine-stitched to solve the complex maritime environment, waves, light changes, and partial occlusions. Wang et al. 19 presented a saliency-based sea-sky-line detection method by computing the gradient orientation. They all focused on fitting a sea-sky-line with a straight line.
Kristan et al. 20 reported a probabilistic graphical model of the semantic segmentation model (SSM), which split marine images into sky, haze, and seawater regions via the Gaussian mixture model (GMM). Spatial consistency was regularized using a Markov random field to achieve a smoothed segmentation result. Bovcon et al. 21,22 incorporated boat pitch and roll measurements by utilizing the onboard inertial measurement unit for the SSM. The output probability distribution map was acquired by iterative calculation of the prior probability, and the initialization condition highly affected the generated distribution.
We proposed a sea-sky-line detection algorithm based on semantic segmentation, which detects the sea-sky-line precisely, even if the coastline is not in accord with a line segment. The framework for our approach is shown in Figure 1. Our main contribution is segmenting the marine image by utilizing the GMM and proposing a method for estimating the prior categorical distribution of the pixel samples. We roughly divide the marine scene into three blocks and then obtain the prior parameters of the probability density function described by the GMM. 25,26 The maximum posterior probability is determined by the expectation–maximization (EM) algorithm and acquires the probability distribution for pixels of marine images. As a secondary contribution, we propose a method for roughly segmenting marine images. According to the principle that regions in different classes have different texture information in marine images, regions with similar texture information are classified into the same class, and regions with wide differences in texture information are selected as target regions. Hough line detection is used in the target region for receiving the region-segment-line. Last, we visualize the texture feature of marine images and show the texture differences between different subregions. The proposed method is tested and validated on an unmanned measuring platform composed of radar, GPS, thrusters, an electronic compass, industrial personal computers, and cameras (Figure 1). The images are captured from a camera on the USV measurement platform during the actual navigation of the USV.

The framework of our approach for USVs. USV: unmanned surface vehicle.
The remainder of this article is structured as follows. The second section describes the sea-sky-line detection model and the segmentation of marine images. The third section introduces an initialization method for Gaussian mixture distribution. The experimental result is presented in the fourth section, and we conclude the article in the fifth section.
Sea-sky-line detection model
Marine images are segmented before detecting the sea-sky-line, and the Gaussian components are initialized by coarse segmentation. The detection model consists of four parts. The first part obtains the raw pixel prior information estimation. The marine image is roughly divided into three regions, and each region is assigned to one Gaussian model. The second part initializes the GMM by using prior information estimation. The third part takes advantage of the EM algorithm for semantic segmentation, which is an iterative process for achieving a convergent model. The last part extracts the seawater area and finds the segmentation boundary between the seawater and other areas as the detected sea-sky-line. The complete detection process is summarized in Algorithm 1.
Sea-sky-line detection algorithm.
Prior information estimation
We consider each pixel described by a five-dimensional vector

Prior segmentation information estimation for marine images. (a) Original image. (b) Rough segmentation image with classification of boundary labels abandoned.
Parameters initialization for GMM
To divide the marine image into three regions, three GMMs are used to recover the joint probability distribution map as follows
where
where
EM for semantic segmentation
To segment marine images more accurately, maximum likelihood estimation is introduced to maximize the posterior probability of observed data and calculate the parameters of the GMM
However, the GMM includes latent variables and cannot estimate the model parameters by directly using the maximum likelihood estimation method or the Bayesian estimation method. Generally, the EM algorithm is recommended to approximate the maximum likelihood estimation of the observed data. We utilize EM algorithm to maximum the posterior probability of Gaussian components. In step E, we calculate the posterior probability of latent variables according to the Gaussian components of the last iteration. In step M, we maximize the likelihood function to get the new parameters of Gaussian components.
In step E, we calculate the posterior probability
In step M, calculating the maximum posterior probability of the observed samples and updating the parameters of the mixed Gaussian probability density function
Yi is the label of Xi . Repeating the calculation of step E and step M until the parameters reach the convergence condition
The maximal posterior probability of the observed data Xi
can be solved by using the joint probability density function with convergent model parameters

(a) Semantic segmentation image. (b) Extraction of the seawater region by region growing.
Sea-sky-line extraction
We adopt the region growing algorithm to extract the seawater region and obtain a continuous region without discrete points (Figure 3(b)). The upper boundary of the seawater region is detected as the sea-sky-line (Figure 4).

The result of sea-sky-line detection.
Prior distribution estimation method
To acquire the prior distribution information of the pixel samples in marine images, we first assign each pixel sample to a class with less rigor and robustness, which resorts to the texture information of the subregions. One segmentation method based on subregion partition and texture features is used to achieve this effect.
The marine image is evenly divided into m subregions first. The gray level co-occurrence matrix (GLCM) of each subregion is calculated to describe texture information, and the texture feature for the jth subregion is depicted by a column vector
To reduce the computational complexity, the grayscale image for each subregion is quantized to an image fj with an N grayscale. The spatial relationship of the grayscale value is described as follows
where Gj
is the
The description vector of the GLCM can be expressed as
By comparing the GLCM representation vector of two adjacent subregions, we cluster all subregions into three larger subregions. We propose a novel texture comparison method for quantifying the level of texture difference between two regions. First, we compare the texture feature in multiple directions of the image and lower the grayscale of the pixels; therefore, a more imperceptible texture feature can be extracted without increasing the computation time. In addition, for the generalized texture feature in marine images, we multiply each vector element by a different coefficient when comparing the texture feature between two adjacent subregions. We calculate the texture difference according to the following formula
The texture difference between all adjacent subregions can be represented by a column vector
where First, edge detection was performed on the grayscale image. Next, the edge points in the geometric space were mapped to lines in the parameter space and voted in the parameter space. The points that obtain the most votes were selected in the parameter space and mapped back to geometric space to obtain the detection line.
We divided the image area above the detected line uniformly into two block regions and assigned each block region to a Gaussian model, and the region below the detected line initialized the third Gaussian model. Then, the prior probability distribution was calculated with a fixed Gaussian mixture probability density function.
Although the prior estimation increased part of the time cost in the initial process, a more accurate initialization condition was obtained, making the GMM easier to converge. Furthermore, a better initialization condition reduced the number of iterations in EM steps and computation time.
Experiments
To evaluate the performance of our detection method, we implemented and tested our algorithm on the test data set we collected and provided by Kristan et al. Our experimental section was divided into four parts. The first part was the visualization and analysis of the texture feature. The second part introduced the composition of test data and showed test results in the test set. In the third part, we compared our algorithm based on semantic segmentation to the traditional sea-sky-line detection method based on line detection. In the last part, we analyzed the validity of our initialization method. All experiments were performed on a notebook computer with an Intel i5-8250 U CPU with a single thread in Visual Studio.
By visualizing the texture feature of whole subregions in the marine image, we find that the texture features of subregions attached to the same block are similar (Figure 5). The bulge of the sky area is in the upper right corner of the visualization image. Correspondingly, the middle mixture area is in the central zone, and the sea area is in the lower-left corner. This phenomenon is mainly due to the grayscale values of each classification area being distinct, so the texture features generated from each region are distributed in dispersed locations of texture space, which demonstrates the validity of initializing the Gaussian components with texture information.

The visualization of texture features in different subregions.
A comprehensive assessment system has a profound impact on the evaluation of objective characteristics of things 27 ; we measure the proposed approach qualitatively and quantitatively in the test data. The test images contain various adverse situations, including haze, highlights, clouds, distortion, truncation, waves, water reflection, and various intricate backgrounds (see Figure 6). It is common for a test image to include several complex situations. Our approach works well in a majority of environments (Figures 7 and 8). For the scenes where the background is very simple, and the waves are not obvious, the sea-sky-line based on linear fitting can work steadily and run faster than our method. However, our method can not only detect the sea-sky-line in monotonous backgrounds, but our algorithm is robust for scenes with very complex backgrounds. In Figure 7, although the backgrounds of the coast are complex, our SSM can still segment the marine images well, which lays a good foundation for tracking targets and path planning.

Number of occurrences for different backgrounds.

The experimental results on test data. The first column is the original images with various complicated backgrounds in the test data. The second column is the segmentation images computed by our semantic segmentation algorithm. The extraction results of the seawater area by a region growing algorithm are represented in the third column. The last column is the sea-sky-line detection results of our method.

Some results of sea-sky-line detection. The first column is the input images. The second column is the detection results using linear fitting. The third column is the results of our approach.
A poor semantic segmentation result may affect precise detection. For example, there may be some deviation between the detected sea-sky-line and the real result due to the inaccuracy in semantic segmentation. We can adjust the number of subregions to increase the initialization precision of semantic segmentation. In addition, because the seawater area is usually a continuous area, even if the coastal background is not segmented accurately, we can still detect an excellent seawater boundary (as shown in the fourth row in Figure 7), which presents increased robustness of our method.
In Figure 8, some results of sea-sky-line detection are shown, which are achieved by two methods. The first detection method is based on linear fitting using Hough transform to detect the line that receives the most votes. The other is the approach that we proposed. From the results of the second column, we can see that the sea-sky-line detection method based on linear fitting is susceptible to haze, waves, sea clutter, harbors, and mountains. Hough detection obtains the incorrect line under complex environments. However, our approach can handle a variety of more complex situations and obtain the correct sea-sky-line. The ground-truth result of the sea-sky-line becomes a curve in the distorted image. It is unreasonable to use line segment detection under this situation. In addition, for high and thin obstacles, Hough detection generally ignores the obstacles because the obstacle does not show a mass of margin features. These marine obstacles are often ignored in Hough detection (the fourth row in Figure 8). From these test results, we can infer that our approach has stronger robustness and adaptability to sea-sky-line detection in complex backgrounds.
To verify the effectiveness of our initialization method for the segmentation result for the SSM, the GMM with the initialization method proposed in Kristan et al.
20
is compared to our initialization approach. The detection results and semantic segmentation results of some examples are shown in Figures 9 and 10, respectively. Kristan et al. constructed the initial distribution by vertically splitting the image into three regions,

Some results of sea-sky-line detection. The first column is the input images. The second column is the Gaussian components initialized by settled regions. The third column is our approach.

The comparison of semantic segmentation results. The first column shows the original images. The second column shows the output from the Gaussian models with the common initialization method. The last column presents our results.
The time consumption of two initialization models were also compared. We selected 150 sample images from the public data set and marine images that we captured and scaled every collected image to 72 by 72. The Gaussian components with different initialization forms were used for semantic segmentation and computed the average consumption on the test data set. The maximum number of iterations was set to 50, and the iteration convergence threshold was selected from
Comparison of time consumption for Gaussian components with different initialization methods.a
a The results are given by the average consumption computed on test data.
Conclusion
This article presents a sea-sky-line detection method based on a GMM and image texture features. The GMM is used to fit the probability distribution function of marine images and then update the parameters of the joint Gaussian distribution function by utilizing the iterative calculation of the EM algorithm. To avoid the unexpected convergence direction caused by an inferior initialization condition during the process of iterative calculation, a novel primitive semantic segmentation is applied to estimate a prior probability distribution of marine images. Texture features are extracted by calculating the GLCM of the image to establish a superior initialization distribution for GMM. The marine image is roughly divided into three block regions, and each Gaussian model is initialized by a region. Then, the GMM performs a more accurate pixel-level classification for the marine image. In addition to improving the accuracy of the model, a superior initialization condition can reduce the iterative computations of the model reaching the convergence condition. Eventually, we obtain a marine segmentation image consisting of three different colored regions. Extracting the region that is classified as seawater as the region of interest, the boundary of the region of interest (ROI) with other regions is identified as the sea-sky-line. The experimental results demonstrate the validity of our method. Although our method is robust, it cannot solve the reflection problem completely, which is also one of the existing difficulties in image segmentation of water scenes.
Now that marine image segmentation and sea-sky-line detection are realized, our future work will focus on obstacle detection in marine environments. After experiments and simulating the existing obstacle detection method, we found that the existing obstacle detection methods cannot effectively solve the problems of reflection and illumination. We will explore more efficient means for improving the detection methods for obstacle detection in marine environments.
Footnotes
Acknowledgments
The authors would like to thank Kristan et al. for providing the data sets.
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: This research was funded by the National Natural Science Foundation of China (grant numbers 61525305 and 61625304), the Shanghai Natural Science Foundation (grant numbers 17ZR1409700 and 18ZR1415300), and the basic research project of Shanghai Municipal Science and Technology Commission (grant number 16JC1400900).
