Sea surface region extraction method and system fusing geometric constraints

Through the U-Net model combined with geometric constraints, the accuracy and robustness problems caused by environmental interference in sea surface area extraction are solved, and efficient sea surface area extraction is achieved under complex backgrounds, which is suitable for a variety of optical images.

CN120298442APending Publication Date: 2025-07-11NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510354997.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

When extracting sea surface areas, the prior art is affected by light intensity, weather factors and complex background interference, and the accuracy and robustness of the dividing line extraction are insufficient, especially in the lack of underlying interpretability and generalization of deep learning methods.

Method used

The U-Net model is used to combine geometric constraints, and the linear loss function and the binary cross entropy loss function are trained, and the sea surface area is extracted using linear regression, and the boundary line calibration is combined with a variety of non-intelligent methods to expand the training samples and introduce geometric constraint limitations.

Benefits of technology

It improves the extraction performance of sea surface areas in images with strong environmental interference, and is suitable for optical images from different sources, including the case where the camera is located, improving the accuracy and robustness of extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298442A_ABST
    Figure CN120298442A_ABST
Patent Text Reader

Abstract

The invention discloses a sea surface region extraction method and system fused with geometric constraints, and the method comprises the steps: predicting the probability that each pixel point is a boundary for a target sea surface optical image through employing a trained U-Net model, extracting the coordinates of the pixel point with the maximum probability in each column of the target sea surface optical image, and obtaining a target sea surface region; obtaining a boundary linear equation through linear regression; extracting a sea surface region in the target sea surface optical image according to the boundary linear equation; in the training of the U-Net model, a linear loss function is added, so that geometric constraints are introduced, and the extraction performance of the model on a sea surface region in an image which is strongly interfered by the environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical image processing, in particular to a method and system for extracting sea surface areas by integrating geometric constraints. Background Art

[0002] Extracting the sea surface area is a key step in applications such as the inversion of marine environmental information based on optical images, the recognition of sea surface targets, and the automatic driving of ships. The essence of sea surface area extraction lies in detecting the position of the dividing line in the image, so as to segment the sea surface area from other environmental areas. However, in practical applications, the reduction of image quality due to light intensity and weather factors, as well as the existence of complex interference factors such as clouds, strong reflections, and sea clutter in the sea surface or sky background, will directly affect the accuracy and robustness of the dividing line extraction.

[0003] Common methods for extracting the dividing line mainly use the fact that the dividing line area has a significant gradient or perform image segmentation using a gray threshold. These methods are simple and fast, but they are difficult to adapt to complex sea-air backgrounds and have certain limitations. Methods based on the transform domain such as wavelet transform and Hough transform are also an idea for extracting the dividing line. By converting the original graph to the corresponding transform domain and performing image processing in the transform domain, better anti-noise performance can be achieved, but their computational complexity is high, and if the parameters are not selected properly, new false features will be introduced. In recent years, some methods for extracting the dividing line based on deep learning have emerged, mainly including constructing an image semantic segmentation model using a convolutional neural network to perform pixel-level classification of the sky and sea surface in the image, and using the YOLO series of models to perform target recognition on the dividing line area. These two types of deep learning methods have shown good accuracy in dividing line extraction. However, due to their data-driven characteristics, deep learning methods need to be trained using a large amount of data to obtain better prediction performance. Such methods often lack low-level interpretability, so there are still certain challenges in their generalization in images with strong environmental interference, low quality, and lack of similar samples during training. Summary of the Invention

[0004] Object of the Invention: The object of the present invention is to provide a method and system for extracting sea surface areas by integrating geometric constraints, so as to improve the extraction performance of the model for sea surface areas in images strongly affected by the environment.

[0005] Technical Solution: For the target sea surface optical image, the method for extracting sea surface areas by integrating geometric constraints according to the present invention uses a trained U-Net model to predict the probability that each pixel point is the dividing line, where the dividing line is the dividing line between the sky area and the sea surface area, extracts the pixel point coordinates with the maximum probability in each column of the target sea surface optical image, and obtains the dividing line straight line equation through linear regression; extracts the sea surface area in the target sea surface optical image according to the dividing line straight line equation.

[0006] Further, collect sea surface optical images and perform demarcation line calibration to obtain an array of marked vertical coordinates (y 1t , y 2t ), establish a training set of sea surface optical images, and use the training set to train the U-Net model. The loss function of the U-Net model is the weighted sum of the binary cross-entropy loss function and the line loss function. The calculation method of the line loss function is as follows:

[0007] For a mask with shape (H, W), calculate the softmax weight w i,j of each pixel point, where i = 1, 2, …, H, j = 1, 2, …, W, and the mask stores the probability that each pixel point is the demarcation line;

[0008] Calculate the soft position for each column of the mask to obtain W scatter points, generate an array of normalized coordinates of the scatter points (j / W, y j ′ / H), and use the least squares method for linear regression to obtain the fitted line;

[0009] Calculate the normalized vertical coordinates of the fitted line in the first column and the W-th column of the target sea surface optical image to obtain an array of fitted vertical coordinates (y 1p , y 2p );

[0010] Calculate the mean root mean square error between the fitted vertical coordinates and the array of marked vertical coordinates as the line loss function.

[0011] Further, extract the coordinates of the pixel points with the highest probability in each column of the target sea surface optical image, and obtain the demarcation line equation through linear regression; extracting the sea surface area in the target sea surface optical image according to the demarcation line equation includes:

[0012] Extract the coordinates of the pixel points with the highest probability in each column of the target sea surface optical image, calculate their normalized coordinates, and fit the normalized coordinates to obtain the demarcation line equation;

[0013] The normalized vertical coordinates of the demarcation line equation in the first column and the last column of the target sea surface optical image are y 1m and y 2m respectively;

[0014] Taking the demarcation line as the boundary in the target sea surface optical image, the area above the demarcation line is the sky area, and the area below the demarcation line is the sea surface area. Taking the lower left corner of the target sea surface optical image as the origin (0, 0), the sea surface area in the target sea surface optical image is composed of (0, 0), (0, y 1m ), (1, y 2mThe quadrilateral region formed by () and (1, 0).

[0015] Furthermore, when training the U-Net model, the weight of the binary cross-entropy loss function is 1 and the weight of the straight-line loss function is 0 in the first to M1 rounds. In the rounds from M1 + 1 to M2, the weight of the binary cross-entropy loss function is 1 and the weight of the straight-line loss function linearly increases from 0 to 1. After the M2 + 1 round, the weights of both the binary cross-entropy loss function and the straight-line loss function are 1, where M1 < M2.

[0016] Furthermore, the acquisition of the sea surface optical image and the calibration of the demarcation line include calibrating the demarcation line through the first edge detection method, and the first edge detection method includes:

[0017] Convert the color gamut of the sea surface optical image and extract the luminance channel. After performing maximum-minimum normalization on the luminance channel, use the OTSU algorithm to obtain a binary image. Use the canny edge detection algorithm to obtain a binary map of the edge region. Perform Hough transform on the binary map of the edge region and then perform straight-line detection. Calibrate the straight line with the maximum length among the detected straight lines as the demarcation line.

[0018] Furthermore, visually inspect the demarcation line calibrated by the first edge detection method. For the sea surface optical image where there is a difference between the calibrated demarcation line and the true demarcation line, calibrate the demarcation line through the second edge detection method, and the second edge detection method includes:

[0019] Convert the sea surface optical image into a grayscale image. Calculate the average value of the top 1 / 9 region along the height direction of the grayscale image and denote it as low_in, and calculate the average value of the bottom 1 / 9 region and denote it as high_in. Map the pixel values in the grayscale image that are between low_in and high_in to the range [0, 1]. Set the pixel values lower than low_in to 0, and set the pixel values higher than high_in to 1. Use the canny edge detection algorithm to obtain a binary map of the edge region. Perform Hough transform on the binary map of the edge region and then perform straight-line detection. Calibrate the straight line with the maximum length among the detected straight lines as the demarcation line.

[0020] Furthermore, visually inspect the demarcation lines calibrated by the first edge detection method and the second edge detection method. For the sea surface optical image where there is a difference between the calibrated demarcation line and the true demarcation line, manually select several pixel points on the true demarcation line, and calibrate the straight line obtained by linear fitting as the demarcation line.

[0021] The sea area extraction system integrating geometric constraints according to the present invention includes a U-Net model. For a target sea surface optical image, the trained U-Net model is used to predict the probability that each pixel point is a demarcation line, and the coordinates of the pixel point with the maximum probability in each column of the target sea surface optical image are extracted. The straight line equation of the demarcation line is obtained through linear regression; the sea area is extracted from the target sea surface optical image according to the straight line equation of the demarcation line.

[0022] The electronic device according to the present invention includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is loaded into the processor, the sea area extraction method integrating geometric constraints according to the present invention is implemented.

[0023] The computer-readable storage medium according to the present invention stores a computer program, and when the computer program is executed by a processor, the sea area extraction method integrating geometric constraints according to the present invention is implemented.

[0024] Beneficial effects: Compared with the prior art, the advantages of the present invention are as follows: (1) The present invention uses a variety of non-intelligent methods for demarcation line calibration to ensure the accuracy of true value calibration in the dataset and at the same time expand the effective training samples; (2) The present invention considers the characteristic that the demarcation line between the sea area and the sky can be represented by a straight line, and adds a custom straight line fitting loss function to the traditional binary cross-entropy loss function, thereby introducing geometric constraint limitations in this deep learning network and improving the extraction performance of the sea area in images strongly interfered by the environment for this model. (3) The present invention can be applied to optical images from different sources, including near-shore land-based surveillance cameras, ship cameras, buoy cameras, etc. That is, in the case where the sea horizon is tilted due to the non-fixed carrier of the camera, the sea area can also be effectively extracted. Description of the Drawings

[0025] Figure 1 It is a flowchart of the sea area extraction method according to the present invention.

[0026] Figure 2 It is a flowchart of demarcation line calibration in an embodiment of the present invention.

[0027] Figure 3 It is an architecture diagram of the U-Net deep learning model in an embodiment of the present invention.

[0028] Figure 4 It is a comparison chart of sea area extraction results of four methods in an embodiment of the present invention. Detailed Embodiments

[0029] The technical solution of the present invention will be further described below with reference to the drawings.

[0030] AsFigure 1 As shown, the method for extracting the sea surface area integrating geometric constraints includes the following steps:

[0031] Step 1: Collect optical images of the sea surface. After judging the validity of the pictures, calibrate the demarcation line for each single-picture sample. As Figure 2 shown, it specifically includes the following steps:

[0032] Step 1.1: The method for judging the validity of the picture is to calculate the average value of the grayscale image of a single original picture. If this value is greater than 20, the picture is considered valid; otherwise, it is regarded as an invalid picture, and invalid pictures will not be calibrated and the sea horizon will not be extracted.

[0033] Step 1.2: Use the following steps to identify the demarcation line for each picture. First, convert the original RGB picture to the L*a*b* color gamut and extract its luminance channel. After normalizing the maximum value - minimum value, use the OTSU algorithm to obtain a binary image. Then use the canny edge detection algorithm to obtain a binary image of the edge area. After performing the Hough transform on it, perform line detection. Among the detected lines, the one with the maximum length is determined as the demarcation line corresponding to this picture.

[0034] Step 1.3: Manually check the demarcation line recognition result in Step 1.2. For pictures with differences from the visual result, use the following steps to perform a second recognition of the demarcation line. First, convert the original RGB picture to a grayscale image. Then calculate the average value of the top 1 / 9 area along the height direction of the grayscale image and record it as low_in, and calculate the average value of the bottom 1 / 9 area and record it as high_in. Then perform image intensity adjustment on the grayscale image, map the pixel values between low_in and high_in in the original grayscale image to between [0, 1], set the pixel values lower than low_in to 0, and set the pixel values higher than high_in to 1. Then use the sobel edge detection algorithm to obtain a binary image of the edge area. After performing the Hough transform on it, perform line detection. Among the detected lines, the one with the maximum length is determined as the demarcation line corresponding to this picture.

[0035] Step 1.4: Manually visually check the demarcation line recognition result in Step 1.3. For pictures with differences from the visual result, use the following steps to perform a third recognition of the demarcation line. Manually select no less than 6 pixel points on the demarcation line to obtain their pixel positions, and then use the least squares method for linear fitting to obtain the demarcation line.

[0036] Step 1.5: For the demarcation line obtained in the above steps, extrapolate to obtain its pixel positions in the first column and the last column of the picture, and then divide by the number of pixels in the picture height to obtain the normalized coordinates (0, y 1t ) and (1, y2t ), save the array (y 1t , y 2t ) as the ground truth label for each sea surface optical image sample.

[0037] Step 2: Construct a U-Net deep learning model, which predicts the probability of each pixel point in a single image input being a demarcation line based on semantic segmentation.

[0038] As Figure 3 shown, the architecture of the U-Net deep learning model includes an input layer, an encoding module, a bridging layer, a decoding module, and an output layer. The first layer is the input layer, followed by 3 encoding modules, then 2 bridging layers, then 3 decoding modules, and finally a convolutional layer composed of a 1×1 convolutional kernel as the model output.

[0039] Input layer: The input image is an RGB three-channel color image with a size of W×H pixels;

[0040] Encoding module: It consists of 1 convolutional module connected to 1 CBAM attention module and then connected to a 2×2 max pooling layer;

[0041] Decoding module: It consists of 1 transposed convolutional layer connected to 1 feature concatenation layer, and then connected to 1 convolutional module;

[0042] Bridging layer: It consists of 1 convolutional module;

[0043] Output layer: It uses a sigmoid activation function to output a single-channel mask with the same size as the input image, which is H×W pixels, and its value ranges from 0 to 1, representing the probability that the corresponding pixel point in the original image is a demarcation line.

[0044] Furthermore, the structure of the convolutional module mentioned in the above encoding module, bridging layer, and decoding module is as follows: a convolutional layer consisting of 1 convolutional kernel with a size of 3×3 and a quantity of n, connected to a batch normalization layer, connected to a RELU activation layer, connected to a convolutional layer consisting of 1 convolutional kernel with a size of 3×3 and a quantity of n, connected to a batch normalization layer, connected to a RELU activation layer, connected to an Inception module, and finally connected to a dropout layer. Among them, the Inception module adopts a dimension-reduced version of Inception-v1 including four branches: the first branch is a convolutional layer consisting of 1 convolutional kernel with a size of 1×1 and a quantity of n / 4; the second branch includes a convolutional layer consisting of 1 convolutional kernel with a size of 1×1 and a quantity of n, followed by a convolutional layer consisting of 1 convolutional kernel with a size of 3×3 and a quantity of n / 4; the third branch includes a convolutional layer consisting of 1 convolutional kernel with a size of 1×1 and a quantity of n / 2, followed by a convolutional layer consisting of 1 convolutional kernel with a size of 5×5 and a quantity of n / 2; the fourth branch includes a 3×3 max pooling layer, connected to a convolutional layer consisting of 1 convolutional kernel with a size of 1×1 and a quantity of n / 4; finally, these four branches are simultaneously connected to a concatenation layer.

[0045] For the value of the number of convolutional kernels n in the above convolutional module, the following principles are adopted:

[0046] ① In the first encoding module, the number of convolutional kernels n = N, where N should be an integer multiple of 4; in the second encoding module, the number of convolutional kernels n = 2×N, and in the third encoding module, n = 4×N;

[0047] ② In the convolutional module of the first bridging layer, n = 8×N, and in the convolutional module of the second bridging layer, n = 16×N;

[0048] ③ In the first decoding module, n = 8×N, in the second decoding module, n = 4×N, and in the third decoding module, n = 2×N.

[0049] Step 3: Construct a straight-line loss function considering the straight-line characteristics of the dividing line. Specifically, it includes the following steps:

[0050] Step 3.1: For a mask with a shape of (H, W), calculate the softmax weight w of the pixel at the i-th row and j-th column in its corresponding column i,j , where i = 1, 2, …, H, j = 1, 2, …, W; here, the softmax value is calculated instead of calculating the corresponding row number where the maximum value is located in each column, and the purpose is to ensure that the loss function is differentiable;

[0051] Step 3.2: For each column j = 1, 2, …, W of the mask, calculate a soft position Obtain W scatter points. The normalized abscissa of the scatter points is j / W, and the normalized ordinate is y j ′ / H.

[0052] Step 3.3: Perform linear regression on the normalized coordinates (j / W, y j ′ / H) of the scatter points obtained in Step 3.2 using the least squares method to obtain the slope and intercept of the fitted line. This fitted line represents the predicted dividing line;

[0053] Step 3.4: Calculate the positions of the fitted line in Step 3.3 at the first column j = 1 and the last column j = W of the picture, that is, the ordinate array (y 1p , y 2p ) of the starting point position of the dividing line;

[0054] Step 3.5: Calculate the average root mean square error between the ordinate array (y 1p , y 2p ) obtained in Step 3.4 and the marked true value (y 1t , y 2t ) as the line loss function.

[0055] Step Four: Train the model in Step Two using a dynamic weight adjustment strategy that combines binary cross-entropy loss and the custom line loss in Step Three.

[0056] Step 4.1: Select a part from the pictures calibrated in Step One as the training dataset. Read the original pictures in the training dataset, scale the original pictures so that their length and width are the same as the parameters W and H of the input layer of the model in Step Two. Read the true value array (y 1t , y 2t ) of the calibrated dividing line corresponding to the picture, and calculate the normalized coordinates in the height direction of the pixel points closest to the dividing line position in each column of the scaled picture where j = 1, 2,..., W. Then generate a single-channel mask image with the same size as the scaled picture. The value S i,j at the i-th row and j-th column of the mask image represents the probability that the pixel point is the dividing line, which is calculated using a normal distribution curve:

[0057]

[0058] where σ is 0.25, and perform normalization so that S i,j is between 0 and 1. If the value of S is closer to 1, it means the point is closer to the dividing line; conversely, if it is closer to 0, it means it is far from the dividing line.

[0059] Step 4.2, set the dynamic adjustment strategy for the loss function weights. In the first to M1 rounds, the weight of the binary cross-entropy loss function is 1, and the weight of the straight-line loss function is 0. In the rounds from M1 + 1 to M2, the weight of the binary cross-entropy loss function is 1, and the weight of the straight-line loss function linearly increases from 0 to 1. After the (M2 + 1)-th round, the weights of both the binary cross-entropy loss function and the straight-line loss function are 1, where M1 < M2.

[0060] Step 4.3, set the learning rate adjustment strategy, that is, when the loss has not improved in M3 consecutive rounds, the learning rate is halved;

[0061] Step 4.4, set the early stopping strategy, that is, when the loss has not improved significantly (less than the threshold eps) in M4 consecutive rounds, stop training in advance, where M3 < M4;

[0062] Step 4.5, start training and wait for the training to end.

[0063] Step Five, use the trained model to extract the sea area.

[0064] Input the picture of the sea area to be extracted into the optimal model trained in Step Four, and output a mask predicting the probability of each pixel point as the demarcation line. Find the row number i of the pixel point with the largest probability value in each column of the mask m , and calculate the normalized coordinates of these points where j = 1, 2, …, W, the straight-line equation obtained by linear fitting is the predicted demarcation line. Calculate the positions of this fitted straight line at the first column j = 1 and the last column j = W of the picture, that is, the normalized ordinate array (y 1m , y 2m ) of the starting point position of this demarcation line; the sea area is the quadrilateral area defined by (0, 0), (0, y 1m ), (1, y 2m ) and (1, 0).

[0065] Next, verify the method described in the present invention through specific experiments.

[0066] S1-1, download the historical image data of BuoyCam (buoy camera) at the public buoy station 46076 on the NDBC website. The data range is the hourly image data of 6 viewpoints during the period from February 5, 2024 to December 5, 2024. Each viewpoint is regarded as a single picture. First, judge the validity of the pictures. After converting the original RGB pictures into grayscale pictures, calculate their average values. If the value is less than 20, the pictures are regarded as invalid pictures. A total of 16,426 pictures are obtained for training and testing.

[0067] S1-2. Calibrate the sea surface image using the method described in Step 1.2. When detecting straight lines using the Hough transform, set the length of each detected straight line to be no less than 100 pixels, and the angle between it and the vertical direction of the image should be no less than 30 degrees. If multiple straight lines are detected, the distance between adjacent vertices of every two straight lines should be no less than 50 pixels.

[0068] S1-3. Conduct a manual visual inspection on the boundaries automatically detected in S1-2, and the sea horizon recognition results of 13,083 images are consistent with the visual inspection. For the remaining 3,343 images, calibrate them again using the method described in Step 1.3, where the settings in the straight line detection step based on the Hough transform are the same as those in S1-2.

[0069] S1-4. Conduct a manual visual inspection on the boundaries automatically detected in S1-3, and the boundary recognition results of 1,904 images are consistent with the visual inspection. For the remaining 1,439 images, manually select no less than 6 pixel points located on the sea horizon to obtain their pixel positions, and then use the least squares method for linear fitting to manually calibrate the boundary.

[0070] S1-5. Calculate the normalized coordinate positions of the boundaries in S1-2 to S1-4 and save the true value marks.

[0071] S2. Build a boundary recognition model based on the U-Net deep learning network, where N = 16, W = 256 pixels, H = 144 pixels, and the dropout rate in the dropout layer of the convolutional module is set to 0.1.

[0072] S3. Build a straight line loss function.

[0073] S4-1. Use the 14,987 images obtained in S1-2 and S1-3 as the training set, and the 1,439 images obtained in S1-4 as the test set.

[0074] S4-2. Set M1 = 50, M2 = 100, M3 = 10, M4 = 20, eps = 1e-7, set the training batch size to 16, and the maximum number of training epochs to 300.

[0075] S4-3. Start training using an NVIDIA RTX4090 GPU with 24GB of video memory. In this embodiment, the training automatically stops after 130 epochs, taking 1 hour, 43 minutes, and 19 seconds.

[0076] S5. Use the trained model to extract the sea surface area.

[0077] Figure 4The extraction results of the sea surface area under different complex environmental interference factors are shown, and a comparison is made with the non-intelligent methods in Step 1.1 and Step 1.2, as well as the prediction results of the optimal model obtained by training the classical U-Net model using only binary cross-entropy loss. Figure 4 In (a) - (d), they are respectively the non-intelligent method in Step 1.1, the non-intelligent method in Step 1.2, the classical U-Net model (using only binary cross-entropy loss), and the method of the present invention.

[0078] Figure 4 The green dashed line in each picture is the calibrated ground truth, and the red line is the prediction result using different methods. Each row represents the following 7 cases of complex environmental interference: 1) There is a large cloud area in the picture, forming a color gradient feature that is easy to confuse with the sea-sky boundary; 2) There is strong specular reflection on the sea surface and cloud interference near the boundary line; 3) There is a large area of strong specular reflection near some sea-sky boundary lines in the picture; 4) The light is insufficient in the picture and there is glow interference near the sea horizon; 5) There is blurring noise caused by raindrops in the picture; 6) The picture is overexposed, resulting in the disappearance of some sea-sky boundary features; 7) There are multiple interferences such as clouds, specular reflection, and rain and fog blurring noise in the picture. As Figure 4 shown, the non-intelligent method can hardly recognize the sea horizon under the above-mentioned interferences. Although the classical U-Net model can recognize the sea horizon, there are still significant errors compared with the ground truth. The method of the present invention can more accurately recognize the sea-sky boundary in the above pictures, thus ensuring the accurate extraction of the sea surface area.

[0079] Next, the performance of the method of the present invention in the test set is further evaluated by calculating the angle error E1, the area error E2 of the region, and the extraction rate. Among them, the extraction rate is the proportion of the number of samples in which the sea horizon is detected (regardless of whether it is accurate) using this method in the total number of samples in the test set; E1 is the absolute value of the difference between the slope angle of the predicted straight line and the slope angle of the calibrated ground truth; E2 includes the pixel point regions with classification errors (including the regions that should be the sea surface area but are predicted as the sky area, and the regions that should be the sky area but are predicted as the sea surface area), that is, the area between the predicted sea horizon and the calibrated sea horizon accounts for the proportion of the total image area. The specific calculation method uses the following formula:

[0080]

[0081] Table 1 Evaluation of the sea surface area extraction results of four methods

[0082]

[0083] As shown in Table 1, the statistics of the results of a total of 1,439 pictures in the test set are presented. In summary, it can be seen that the method of the present invention is superior to non-intelligent methods in terms of both accuracy and robustness in the extraction results of the sea surface area under the condition of different complex environmental interference factors, and also has an obvious improvement in accuracy compared with the intelligent method without geometric constraints.

[0084] The sea surface area extraction system integrating geometric constraints according to the present invention includes a U-Net model. For the target sea surface optical image, the trained U-Net model is used to predict the probability that each pixel point is a demarcation line, and the coordinates of the pixel point with the maximum probability in each column of the target sea surface optical image are extracted, and the demarcation line equation is obtained through linear regression; the sea surface area is extracted from the target sea surface optical image according to the demarcation line equation.

[0085] The electronic device according to the present invention includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is loaded into the processor, the sea surface area extraction method integrating geometric constraints is implemented.

[0086] The computer-readable storage medium according to the present invention stores a computer program, and when the computer program is executed by a processor, the sea surface area extraction method integrating geometric constraints is implemented.

[0087] The computer-readable storage medium may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory, or any other medium that can store program code in the form of instructions or data structures and can be accessed by a computer.

[0088] The processor is used to execute the computer program stored in the memory to implement each step in the method described in the above embodiments.

Claims

1. A method for extracting sea surface areas by integrating geometric constraints, characterized in that For the target sea surface optical image, use the trained U-Net model to predict the probability that each pixel is the boundary line, where the boundary line is the boundary between the sky region and the sea surface region. Extract the coordinates of the pixel with the maximum probability in each column of the target sea surface optical image, and obtain the boundary line equation by linear regression; extract the sea surface region from the target sea surface optical image according to the boundary line equation.

2. The method for extracting sea surface area integrating geometric constraints according to claim 1, wherein Collect optical images of the sea surface and perform boundary calibration to obtain an array of marked ordinate values (y 1t , y 2t ), establish a training set of optical images of the sea surface, and use the training set to train a U-Net model. The loss function of the U-Net model is the weighted sum of a binary cross-entropy loss function and a line loss function. The calculation method of the line loss function is as follows: For a mask with shape (H, W), calculate the softmax weight w of each pixel i,j , where i = 1, 2, …, H and j = 1, 2, …, W, and the probability that each pixel in the mask is a dividing line is stored in the mask; Calculate the soft position for each column of the mask Obtain W scatter points and generate a scatter point normalized coordinate array (j / W, y′ j / H), and use the least squares method for linear regression to obtain the fitting line; Calculate the normalized ordinate of the fitted straight line in the first column and the W-th column of the target sea surface optical image to obtain the fitted ordinate array (y 1p , y 2p ); Calculate the mean root mean square error between the fitted ordinate and the marked ordinate array as the linear loss function.

3. The method for extracting sea surface area incorporating geometric constraints according to claim 1, wherein The step of extracting the coordinates of the pixel with the maximum probability in each column of the target sea surface optical image and obtaining the boundary line equation by linear regression; Extracting the sea surface region from the target sea surface optical image according to the boundary line equation includes: Extract the coordinates of the pixel with the maximum probability in each column of the target sea surface optical image, calculate its normalized coordinates, and fit the normalized coordinates to obtain the boundary line equation; The normalized ordinate values of the boundary line equation in the first column and the last column of the target sea surface optical image are y 1m and y 2m ; The target sea surface optical image is bounded by a demarcation line. The area above the demarcation line is the sky region, and the area below the demarcation line is the sea surface region. Taking the lower left corner of the target sea surface optical image as the origin (0, 0), the sea surface region in the target sea surface optical image is a quadrilateral region composed of (0, 0), (0, y 1m ), (1, y 2m ) and (1, 0).

4. The method for extracting a sea area integrating geometric constraints according to claim 1, wherein When training the U-Net model, the weight of the binary cross-entropy loss function is 1 and the weight of the linear loss function is 0 in the first to M1 rounds. In the M1+1 to M2 rounds, the weight of the binary cross-entropy loss function is 1 and the weight of the linear loss function linearly increases from 0 to 1. After the M2+1 round, the weights of both the binary cross-entropy loss function and the linear loss function are 1, where M1 < M2.

5. The method for extracting sea surface area integrating geometric constraints according to claim 1, characterized in that The step of collecting the sea surface optical image and calibrating the boundary line includes calibrating the boundary line by the first edge detection method, and the first edge detection method includes: Convert the color gamut of the sea surface optical image and extract the luminance channel. After normalizing the maximum value - minimum value of the luminance channel, use the OTSU algorithm to obtain a binary image. Use the canny edge detection algorithm to obtain a binary image of the edge region. Perform Hough transform on the binary image of the edge region and then perform line detection. Mark the line with the maximum length among the detected lines as the boundary line.

6. The method for extracting sea surface area integrating geometric constraints according to claim 5, characterized in that Visually inspect the boundary line calibrated by the first edge detection method. For the sea surface optical image where there is a difference between the calibrated boundary line and the true boundary line, calibrate the boundary line by the second edge detection method, and the second edge detection method includes: Convert the sea surface optical image to a grayscale image. Calculate the average value of the top 1 / 9 region along the height direction of the grayscale image and denote it as low_in, and calculate the average value of the bottom 1 / 9 region and denote it as high_in. Map the pixel values between low_in and high_in in the grayscale image to between [0,1], set the pixel values lower than low_in to 0, and set the pixel values higher than high_in to 1; use the canny edge detection algorithm to obtain a binary image of the edge region. Perform Hough transform on the binary image of the edge region and then perform line detection. Mark the line with the maximum length among the detected lines as the boundary line.

7. The method for extracting sea surface area integrating geometric constraints according to claim 6, characterized in that Visually inspect the demarcation line calibrated by the first edge detection method and the second edge detection method. For the sea surface optical image where there is a difference between the calibrated demarcation line and the true demarcation line, manually select several pixel points on the true demarcation line, and calibrate the line obtained by linear fitting as the demarcation line.

8. A sea area extraction system integrating geometric constraints, characterized in that, It includes a U-Net model. For the target sea surface optical image, use the trained U-Net model to predict the probability that each pixel point is the demarcation line, extract the coordinates of the pixel point with the maximum probability in each column of the target sea surface optical image, and obtain the demarcation line equation by linear regression; extract the sea surface area in the target sea surface optical image according to the demarcation line equation.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it realizes the method for extracting the sea surface area by fusing geometric constraints according to any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it realizes the method for extracting the sea surface area by fusing geometric constraints according to any one of claims 1-7.