A sea-line detection method based on threshold segmentation and edge optimization

By combining threshold segmentation and edge optimization methods with preprocessing, threshold segmentation, edge detection, and probabilistic Hough transform, the accuracy problem of sea-line detection under complex sea conditions is solved, and efficient and accurate detection of sea-line data is achieved.

CN117237387BActive Publication Date: 2026-01-30ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310911940.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2026-01-30
Estimated Expiration
2043-07-24

AI Technical Summary

Technical Problem

Existing sea-line detection algorithms are susceptible to interference from lighting, waves, cloud textures, and sea surface obstacles under complex sea conditions, leading to a decrease in detection accuracy.

Method used

A threshold-based segmentation and edge optimization method is adopted, which combines preprocessing, threshold segmentation, edge detection and probabilistic Hough transform to optimize the edge image of the sea-line, eliminate interference and accurately locate the sea-line.

Benefits of technology

It can effectively eliminate interference from light, waves, cloud textures, and sea surface obstacles under complex sea conditions, thus achieving accurate detection of the sea-line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117237387B_ABST
    Figure CN117237387B_ABST
Patent Text Reader

Abstract

This invention discloses a sea-line detection method based on threshold segmentation and edge optimization. The method includes: acquiring and preprocessing the original sea-line image; dividing the detection region; selecting the detection region with the largest variance difference as the sea-line region to be detected and merging them into the final sea-line region; obtaining the optimal segmentation threshold and performing edge segmentation to obtain the sea-line edge image; performing dilation operation to obtain connected components and then performing black-and-white processing; performing edge segmentation; and detecting the sea-line until it is detected, thus achieving sea-line detection. The sea-line detection method proposed in this invention can effectively eliminate the influence of lighting, wave and cloud textures, and sea surface obstacles, enabling sea-line detection in complex sea surface environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for detecting sea-line elevation, which relates to the field of image processing, and specifically to a method for detecting sea-line elevation based on threshold segmentation and edge optimization. Background Technology

[0002] Classical sea-sky line detection algorithms are mainly divided into four categories: sea-sky line detection based on line fitting, sea-sky line detection based on transform domain, sea-sky line detection based on image segmentation, and sea-sky line detection based on gradient saliency. Line fitting-based sea-sky line detection algorithms first determine the measurement points of the sea-sky line and then fit a line using algorithms such as least squares. These algorithms have low computational cost and strong real-time performance, but the selection of measurement points is easily affected by wave and cloud textures and the sea surface background, making them only suitable for sea-sky images under ideal sea conditions. Transform domain-based sea-sky line detection algorithms map the input image to the transform domain for processing. After detection, the image is inversely transformed back to the spatiotemporal domain. Transform domain algorithms mainly include Hough transform, wavelet transform, and Randon transform. These algorithms can effectively detect sea-sky lines under complex sea conditions, but they have high computational cost and certain limitations in practical applications. Image segmentation-based sea-sky line detection algorithms divide the image into different regions using specific algorithms, and the boundaries of these regions are the sea-sky lines. Commonly used algorithms include thresholding, edge detection, and neural network methods. These algorithms are simple to implement, computationally inexpensive, and fast, and perform well on images with significant differences between the sea and sky. However, they are susceptible to noise and cannot accurately delineate the sea-sky boundary in images with complex sea-sky backgrounds. Gradient-based sea-sky boundary detection algorithms primarily rely on the significant gradient changes at the sea-sky junction. In ideal sea-sky environments, they can accurately and quickly detect the sea-sky boundary, but they are easily affected by waves, clouds, and changes in lighting, requiring interference suppression. Summary of the Invention

[0003] To address the problems existing in the background technology, this invention provides a sea-line detection method based on threshold segmentation and edge optimization. First, the original image undergoes preprocessing such as scaling, grayscale conversion, and median filtering. Then, the image is segmented, and the region containing the sea-line is located using the Otsu method. This new image is then combined with the adjacent regions to form a new image. The Canny operator is used to obtain image edges, and the connected components of the edge map are calculated to optimize the image boundary map and eliminate interference from sea surface obstacles. Finally, the sea-line is obtained through probabilistic Hough transform.

[0004] The technical solution adopted in this invention is:

[0005] The sea-line detection method based on threshold segmentation and edge optimization of this invention includes the following steps:

[0006] 1) Acquire the original image of the sea surface line, and obtain the preprocessed image after preprocessing the original image of the sea surface line; divide the preprocessed image into several detection areas evenly along the length direction of the sea surface line.

[0007] 2) Obtain the maximum inter-class variance and threshold of each detection region. Based on the maximum inter-class variance of each detection region, obtain the variance difference of each detection region. Take the detection region with the largest variance difference as the sea-line region to be detected. Merge the sea-line region to be detected and its two adjacent detection regions as the final sea-line region.

[0008] 3) Obtain the optimal segmentation threshold based on the final sea-line region, and perform edge segmentation processing based on the final sea-line region and its optimal segmentation threshold to obtain the sea-line edge image; perform dilation operation on the sea-line edge image, then calculate the connected components of the dilated sea-line edge image and perform black and white processing to obtain a black and white edge map.

[0009] 4) Perform the same edge segmentation process as in step 3) on the black and white edge image to obtain the sea-line boundary map; detect the sea-line based on the sea-line boundary map. If no sea-line is detected, return to step 2), and select the detection area with the largest variance difference among the remaining detection areas excluding the previously selected detection area as the sea-line area to be detected. Continue repeating steps 2)-4) until the sea-line is detected, thus achieving sea-line detection. Finally, the coordinates of the two endpoints of the sea-line are detected, and the straight line containing the two endpoints is taken as the sea-line.

[0010] In step 1), the preprocessing of the original image of the sea surface line specifically involves standardizing the original image of the sea surface line line to a preset size, converting it into a grayscale image, and then performing median filtering to remove noise to obtain the preprocessed image.

[0011] After inputting the original image, it undergoes standardization by scaling the image to a fixed size and then converting it to grayscale to ensure subsequent processes can proceed correctly. Simultaneously, median filtering is applied to eliminate noise points and prevent interference with threshold calculations. The basic principle of median filtering is to select an odd-numbered window (e.g., a 3x3 window) surrounding each pixel in the image, sort the pixel values ​​within that window, and select the median value as the pixel's value. Median filtering effectively removes noise bumps from images.

[0012] In step 2), obtaining the maximum inter-class variance for each detection region specifically involves using Otsu's method to obtain the maximum inter-class variance for each detection region. When using Otsu's method, all grayscale values ​​are iterated from 0 to 255, and the grayscale value corresponding to the maximum variance is used as the output threshold.

[0013] In step 2), the variance difference value of each detection region is obtained based on the maximum inter-class variance of each detection region. Specifically, for each detection region, the variance difference value of the detection region is obtained based on the maximum inter-class variance of the detection region and its two adjacent detection regions, as follows:

[0014]

[0015] Where, Δσ i σ is the variance difference of the i-th detection region; max1 σ max2 σ maxi σ maxi-1 σ maxi+1 σ maxI-1 and σ maxI These represent the maximum inter-class variances of the 1st, 2nd, i, i-1, i+1, I-1, and I detection regions, respectively, where I is the total number of detection regions, and I can specifically be 8.

[0016] In most cases, pixel changes in pure sea or sky areas are relatively smooth, and the variance is also relatively small. However, abrupt changes in pixel values ​​occur in the sea-sky boundary region, resulting in a relatively large variance. Therefore, the region with the largest calculated variance difference can be considered the area where the sea-sky line exists. Combining the two adjacent regions above and below this area to form a new sea-sky region can prevent the sea-sky line from tilting and exceeding the image range.

[0017] In step 2), the sea-line region to be detected and its two adjacent detection regions are merged to form the final sea-line region. When the sea-line region to be detected is the first detection region, the first three detection regions are merged to form the final sea-line region; when the sea-line region to be detected is the last detection region, the last three detection regions are merged to form the final sea-line region.

[0018] In step 3), the optimal segmentation threshold is obtained using the Otsu method based on the final sea-sky line region. Then, the sea-sky line edge image is obtained by edge segmentation processing using the Canny operator based on the final sea-sky line region and its optimal segmentation threshold. When using the Canny operator, the low threshold is set to 20, and the high threshold is the threshold calculated using the Otsu method on the new sea-sky line image.

[0019] In step 3), the sea-line edge image is dilated, and then the connected components of the dilated sea-line edge image are calculated and black-and-white processed. The black-and-white processing is to set the connected components with an area greater than a preset area threshold to white and the remaining connected components to black, and finally obtain the black-and-white edge image.

[0020] Optimizing the edge image by performing dilation avoids severe interference during straight-line detection of the edge image boundaries (including sea wave, cloud, and sea obstacle boundaries) calculated by the Canny operator, which can lead to inaccurate extraction of the sea-line horizon. This is because the boundaries of some interfering blocks are not closed; dilation can close and connect them, facilitating subsequent connected component calculations. Dilation essentially involves finding the maximum value locally. The image is convolved with a convolution kernel, and the maximum value of pixels within the kernel's area is calculated and assigned to a specified pixel. This increases the width of the edges. After dilation, connected components in the binarized image are calculated. Connected components with an area greater than a certain value are considered boundary maps containing the sea-line horizon and their grayscale value is set to 255 and retained. The remaining connected components are considered interference and their grayscale value is set to 0 and discarded. After this operation, the Canny operator is used to calculate the boundaries to obtain the optimized edge image.

[0021] In step 4), the detection of the sea-line based on the sea-line boundary map specifically involves using the probabilistic Hough transform method to detect the sea-line.

[0022] The probabilistic Hough transform randomly selects a set of pixels on the edge image for line detection, while specifying the minimum length of the line and the maximum pixel spacing that can be considered a line, which greatly improves the detection accuracy. Since the sea line is a straight line that runs through the entire image, the minimum length of the line is specified to be no less than 1 / 2 of the image width.

[0023] The beneficial effects of this invention are:

[0024] The sea-line detection method proposed in this invention can effectively eliminate the influence of light, wave and cloud textures as well as sea surface obstacles, and realize sea-line detection in complex sea environments. Attached Figure Description

[0025] Figure 1 This is a flowchart of the overall process for detecting sea-line terrain based on image segmentation;

[0026] Figure 2 This is a sea-line delineation map under different sea conditions detected by the method of the present invention, wherein, Figure 2 (a) is a diagram of the seascape taken when the camera lens was wet, and its edges after Canny operator edge segmentation and edge optimization. Figure 2 (b) is a sea-sky map taken with background interference from mountains and ships above the horizon, and a schematic diagram of its edge segmentation and edge optimization using the Canny operator. Figure 2 (c) is a schematic diagram of the seascape at sunset, after edge segmentation using the Canny operator and after edge optimization. Figure 2(d) is a schematic diagram of a sea-sky map where the differences between the sky and the sea surface are not obvious, and its edges after Canny operator edge segmentation and edge optimization. Figure 2 (e) is a schematic diagram of the sea-sky map with ship interference in the foreground and its edge segmentation and edge optimization using the Canny operator;

[0027] Figure 3 This is a map showing the sea-line division results under different sea conditions detected by the method of the present invention, wherein, Figure 3 (a) is a diagram showing the horizon line division of a sea-sky map taken when the camera lens was wet. Figure 3 (b) is the result of dividing the sea-sky line in a sea-sky map taken when there is background interference from mountains and ships above the sea-sky line. Figure 3 (c) is the result of dividing the sea-sky line at sunset. Figure 3 (d) is the result of dividing the sea-sky line in a sea-sky map where the difference between the sky and the sea surface is not obvious. Figure 3 (e) is the result of dividing the sea-sky line in the near view where there is ship interference.

[0028] Figure 4 This is a comparison chart of the sea-line detection results of the method proposed in this invention and different algorithms, wherein... Figure 4 (a) shows sea surface images under different sea conditions; Figure 4 (b) shows the detection results of the sea-sky line based on the Hough transform algorithm; Figure 4 (c) represents the detection result of the sea-line antenna based on the LSD linear fitting algorithm; Figure 4 Figure (d) shows the detection results of the sea-line area based on the method of the present invention. Detailed Implementation

[0029] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0030] The sea-line detection method based on threshold segmentation and edge optimization of this invention includes the following steps:

[0031] 1) Acquire the original image of the sea surface line, and obtain the preprocessed image after preprocessing the original image of the sea surface line; divide the preprocessed image into several detection areas evenly along the length direction of the sea surface line.

[0032] In step 1), the preprocessing of the original image of the sea surface line is specifically to standardize the original image of the sea surface line line to a preset size and then convert it into a grayscale image, and then perform median filtering to remove noise to obtain the preprocessed image.

[0033] After inputting the original image, it undergoes standardization by scaling the image to a fixed size and then converting it to grayscale to ensure subsequent processes can proceed correctly. Simultaneously, median filtering is applied to eliminate noise points and prevent interference with threshold calculations. The basic principle of median filtering is to select an odd-numbered window (e.g., a 3x3 window) surrounding each pixel in the image, sort the pixel values ​​within that window, and select the median value as the pixel's value. Median filtering effectively removes noise bumps from images.

[0034] 2) Obtain the maximum inter-class variance and threshold of each detection region. Based on the maximum inter-class variance of each detection region, obtain the variance difference of each detection region. Take the detection region with the largest variance difference as the sea-line region to be detected. Merge the sea-line region to be detected and its two adjacent detection regions as the final sea-line region.

[0035] In step 2), obtaining the maximum inter-class variance for each detection region specifically involves using Otsu's method to obtain the maximum inter-class variance for each detection region. When using Otsu's method, all gray values ​​are iterated from 0 to 255, and the gray value corresponding to the maximum variance is used as the output threshold.

[0036] In step 2), the variance difference value of each detection region is obtained based on the maximum inter-class variance of each detection region. Specifically, for each detection region, the variance difference value of the detection region is obtained based on the maximum inter-class variance of the detection region and its two adjacent detection regions, as follows:

[0037]

[0038] Where, Δσ i σ is the variance difference of the i-th detection region; max1 σ max2 σ maxi σ maxi-1 σ maxi+1 σ maxI-1 and σ maxI These represent the maximum inter-class variances of the 1st, 2nd, i, i-1, i+1, I-1, and I detection regions, respectively, where I is the total number of detection regions, and I can specifically be 8.

[0039] In most cases, pixel changes in pure sea or sky areas are relatively smooth, and the variance is also relatively small. However, abrupt changes in pixel values ​​occur in the sea-sky boundary region, resulting in a relatively large variance. Therefore, the region with the largest calculated variance difference can be considered the area where the sea-sky line exists. Combining the two adjacent regions above and below this area to form a new sea-sky region can prevent the sea-sky line from tilting and exceeding the image range.

[0040] In step 2), the sea-line region to be detected and its two adjacent detection regions are merged to form the final sea-line region. When the sea-line region to be detected is the first detection region, the first three detection regions are merged to form the final sea-line region; when the sea-line region to be detected is the last detection region, the last three detection regions are merged to form the final sea-line region.

[0041] 3) Obtain the optimal segmentation threshold based on the final sea-line region, and perform edge segmentation processing based on the final sea-line region and its optimal segmentation threshold to obtain the sea-line edge image; perform dilation operation on the sea-line edge image, then calculate the connected components of the dilated sea-line edge image and perform black and white processing to obtain a black and white edge map.

[0042] In step 3), the optimal segmentation threshold is obtained using the Otsu method based on the final sea-sky line region. Then, the edge segmentation image of the sea-sky line is obtained by using the Canny operator based on the final sea-sky line region and its optimal segmentation threshold. When using the Canny operator, the low threshold is set to 20, and the high threshold is the threshold calculated using the Otsu method on the new sea-sky line image.

[0043] In step 3), the sea-line edge image is dilated, and then the connected components of the dilated sea-line edge image are calculated and processed into black and white. The black and white processing is to set the connected components with an area greater than a preset area threshold to white and the remaining connected components to black, and finally obtain the black and white edge image.

[0044] Optimizing the edge image by performing dilation avoids severe interference during straight-line detection of the edge image boundaries (including sea wave, cloud, and sea obstacle boundaries) calculated by the Canny operator, which can lead to inaccurate extraction of the sea-line horizon. This is because the boundaries of some interfering blocks are not closed; dilation can close and connect them, facilitating subsequent connected component calculations. Dilation essentially involves finding the maximum value locally. The image is convolved with a convolution kernel, and the maximum value of pixels within the kernel's area is calculated and assigned to a specified pixel. This increases the width of the edges. After dilation, connected components in the binarized image are calculated. Connected components with an area greater than a certain value are considered boundary maps containing the sea-line horizon and their grayscale value is set to 255 and retained. The remaining connected components are considered interference and their grayscale value is set to 0 and discarded. After this operation, the Canny operator is used to calculate the boundaries to obtain the optimized edge image.

[0045] 4) Perform the same edge segmentation process as in step 3) on the black and white edge image to obtain the sea-line boundary map; detect the sea-line based on the sea-line boundary map. If no sea-line is detected, return to step 2), and select the detection area with the largest variance difference among the remaining detection areas excluding the previously selected detection area as the sea-line area to be detected. Continue repeating steps 2)-4) until the sea-line is detected, thus achieving sea-line detection. Finally, the coordinates of the two endpoints of the sea-line are detected, and the straight line containing the two endpoints is taken as the sea-line.

[0046] In step 4), the detection of the sea-line based on the sea-line boundary map is specifically performed using the probabilistic Hough transform method.

[0047] The probabilistic Hough transform randomly selects a set of pixels on the edge image for line detection, while specifying the minimum length of the line and the maximum pixel spacing that can be considered a line, which greatly improves the detection accuracy. Since the sea line is a straight line that runs through the entire image, the minimum length of the line is specified to be no less than 1 / 2 of the image width.

[0048] like Figure 1 The diagram shows the overall block diagram for sea-line detection. First, the original image is converted to grayscale and median filtering is applied to remove noise. Then, the image is divided into eight equal parts along the row direction. The threshold and maximum variance of each region are calculated using Otsu's method, and the variance difference between each region and its adjacent regions is calculated. The region with the largest difference is considered a potential sea-line area and combined with its adjacent region to form a new detection image. The threshold is calculated again using Otsu's method on the new image, and the Canny operator is applied to calculate the image edges. After dilation of the edge map, connected components in the image are calculated, retaining those with a pixel area greater than a certain value and blacking out the rest. The Canny operator is used again to delineate the boundaries to obtain a more optimized sea-line boundary map. A probabilistic Hough transform is applied to the image to calculate the sea-line. If sea-line detection fails, the region with the largest variance difference in the remaining regions is selected as the sea-line area, and sea-line detection is repeated until a satisfactory sea-line is found. This method can effectively eliminate the influence of lighting, wave and cloud textures, and sea surface obstacles, enabling sea-line detection in complex sea environments.

[0049] like Figure 2 As shown, this is a diagram illustrating the sea-line division under different sea conditions using the method proposed in this invention. Figure 2 As shown in (a), this is a seascape image taken when the camera lens is wet, along with its edge segmentation using the Canny operator and the edge optimization image. Raindrops interfere with the lens, and the seascape has a certain tilt angle. Figure 2 As shown in (b), this is a sea-sky map with background interference from mountains and ships on the horizon, along with its edge segmentation using the Canny operator and the edge optimization map; Figure 2 As shown in (c), this is a sunset image of the sea and sky, along with its edge segmentation and optimization using the Canny operator. Uneven illumination distribution causes interference. Figure 2 As shown in (d), this is a sea-sky image where the differences between the sky and the sea surface are not obvious, along with its edge segmentation using the Canny operator and the edge optimization image, and it contains interference from clouds and sea surface ripples; Figure 2 As shown in (e), this is a sea-sky image with near-field ship interference, along with its edge segmentation using the Canny operator and the edge optimization map. The method of this invention can accurately locate the sea-sky line position for various sea conditions, such as... Figure 3 of (a), Figure 3 (b) Figure 3 (c) Figure 3 (d) and Figure 3 As shown in (e), it can eliminate various interferences and accurately draw the position of the sea-line, and has excellent sea-line detection capability and strong anti-interference capability.

[0050] like Figure 4 The figure shown is a comparison of the method proposed in this invention with different algorithms. Figure 4 As shown in (a), these are images of the sea surface under different sea conditions; Figure 4 As shown in (b), this is the detection result of the sea-line area based on the Hough transform algorithm; Figure 4 As shown in (c), this is the detection result of the sea-line alignment based on the LSD straight-line fitting algorithm; Figure 4 As shown in (d), the sea-line detection results of the proposed method are presented. The experimental results show that, in an ideal sea surface environment, all three methods can detect the position of the sea-line well (e.g., ...). Figure 4 As shown in line 1). However, in complex sea conditions, such as wave and cloud disturbances (e.g. Figure 4 As shown in rows 2 and 3), sea surface obstacles (such as...) Figure 4 As shown in row 4), uneven lighting (such as...) Figure 4 As shown in line 5, the detection accuracy of traditional algorithms is significantly reduced. The algorithm proposed in this paper, however, can eliminate these effects and accurately locate the sea-line area, demonstrating strong robustness and superior performance.

[0051] This invention presents a sea-line detection method based on threshold segmentation and edge optimization. First, the original image is converted to a grayscale image and median filtering is applied to remove noise. Then, the image is divided into eight equal parts along the row direction. The threshold and maximum variance of each region are calculated using Otsu's method, and the difference in maximum variance between each region and its adjacent regions is calculated. The region with the largest difference is considered a potential sea-line boundary and is combined with its adjacent region to form a new detection image. The threshold is calculated again using Otsu's method on the new image, and the Canny operator is applied to calculate the image edges. After dilation of the edge map, connected components in the image are calculated, retaining those with pixel areas greater than a certain value and blacking out the rest. The Canny operator is used again to segment the edges to obtain a more optimized sea-line boundary map. Finally, a probabilistic Hough transform is performed on the image to calculate the sea-line boundary. This method can effectively eliminate the influence of lighting, wave and cloud textures, and sea surface obstacles, enabling sea-line detection in complex sea environments.

Claims

1. A sea-sky line detection method based on threshold segmentation and edge optimization, characterized in that: The method comprises the following steps: 1) Collecting a raw sea-sky line image, and obtaining a pretreatment image after pretreating the raw sea-sky line image; dividing the pretreatment image into a plurality of detection regions along the length direction of the sea-sky line; 2) Obtaining the maximum inter-class variance of each detection region, and obtaining the variance difference value of each detection region according to the maximum inter-class variance of each detection region; taking the detection region with the maximum variance difference value as a sea-sky line region to be detected, and merging the sea-sky line region to be detected and its two adjacent detection regions as a final sea-sky line region; 3) Obtaining a best division threshold value according to the final sea-sky line region, and performing edge division processing according to the final sea-sky line region and the best division threshold value to obtain a sea-sky line edge image; performing an inflation operation on the sea-sky line edge image, then calculating the connected domain of the sea-sky line edge image after the inflation operation and performing black and white processing to obtain a black and white edge map; 4) Performing the same edge division processing on the black and white edge map in step 3) to obtain a sea-sky line boundary map; performing sea-sky line detection according to the sea-sky line boundary map, and when no sea-sky line is detected, returning to step 2), taking the detection region with the maximum variance difference value in the remaining detection regions except for the detection region screened last time as a sea-sky line region to be detected and continuing to repeat steps 2) to 4) until the sea-sky line is detected, thereby realizing sea-sky line detection. In step 2), the variance difference value of each detection region is obtained according to the maximum inter-class variance of each detection region, specifically, for each detection region, the variance difference value of the detection region is obtained according to the maximum inter-class variance of the detection region and its two adjacent detection regions, and the specific process is as follows: wherein, is the variance difference value of the i-th detection region; , , , , , and is the maximum between-class variance of the 1st, 2nd, i-th, i-1st, i+1st, I-1st and I-th detection region, respectively, is the total number of detection regions. In step 3), the best division threshold value is obtained using the Otsu method according to the final sea-sky line region, and the edge division processing is performed using the Canny operator according to the final sea-sky line region and the best division threshold value to obtain the sea-sky line edge image.

2. The sky-line detection method based on threshold segmentation and edge optimization according to claim 1, characterized in that: In step 1), the pretreatment of the raw sea-sky line image specifically comprises the following steps: normalizing the raw sea-sky line image to a preset size, then converting the normalized image into a grayscale image, and then performing median filtering to remove noise to obtain the pretreatment image.

3. The sky-line detection method based on threshold segmentation and edge optimization according to claim 1, characterized in that: In step 2), the maximum inter-class variance of each detection region is obtained by using the Otsu method for each detection region.

4. The sky line detection method based on threshold segmentation and edge optimization according to claim 1, characterized in that: In step 2), the sea-sky line region to be detected and its two adjacent detection regions are merged as the final sea-sky line region, wherein when the sea-sky line region to be detected is the first detection region, the first three detection regions are merged as the final sea-sky line region; and when the sea-sky line region to be detected is the last detection region, the last three detection regions are merged as the final sea-sky line region.

5. The method of claim 1, wherein the method further comprises: In step 3), the inflation operation is performed on the sea-sky line edge image, then the connected domain of the sea-sky line edge image after the inflation operation is calculated and black and white processing is performed, and the black and white processing specifically comprises the following steps: taking the connected domain with an area greater than a preset area threshold value as white, and taking the remaining connected domains as black, thereby obtaining the black and white edge map.

6. The sky line detection method based on threshold segmentation and edge optimization according to claim 1, characterized in that: In step 4), the sea-sky line detection according to the sea-sky line boundary map specifically comprises the following steps: using the probabilistic Hough transform method to perform sea-sky line detection.