Methods, apparatus, equipment, and storage media for determining oil film regions in images.

By using neural networks and chaotic evolutionary optimization algorithms to process marine oil spill images, the problems of low efficiency and low accuracy of manual annotation were solved, and efficient and accurate identification of oil slick areas was achieved.

CN121544857BActive Publication Date: 2026-04-03SHENZHEN INST OF GUANGDONG OCEAN UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In marine oil spill monitoring, manually marking oil film pollution areas is inefficient and inaccurate. Furthermore, the oil film areas in the images are similar in grayscale to the seawater, making them difficult to distinguish and prone to misjudgment.

Method used

A neural network is used for color classification, and the Bresenham algorithm is used to update the contact points. The chaotic evolutionary optimization algorithm is used to perform ternary processing on the image to improve the clarity of the boundary and the determination of the oil film area.

Benefits of technology

It improves the clarity and accuracy of oil film area segmentation, reduces misjudgment, and enhances the ability to identify oil film areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544857B_ABST
    Figure CN121544857B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, device, and storage medium for determining oil slick regions in an image. The method includes: acquiring a first image of an oil slick at sea; preprocessing the first image to obtain a second image; inputting the second image into a neural network to obtain a third image; updating the original contact points in the third image to obtain a fourth image; improving and optimizing the boundaries in the fourth image to obtain a fifth image; and processing the fifth image using a chaotic evolutionary optimization algorithm to obtain a sixth image showing the ternary representation of the oil slick. The oil slick region is then determined based on the sixth image. The technical solution of this application uses a chaotic algorithm to optimize the ternary algorithm and uses a chaotic evolutionary optimization algorithm to process the fifth image to obtain a ternary representation of the oil slick at sea; this improves the clarity of image region segmentation and facilitates more accurate determination of the oil slick region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to a method, apparatus, device, and storage medium for determining oil film regions in an image. Background Technology

[0002] In marine oil spill monitoring, in order to monitor the oil film pollution area, it is necessary to collect seawater images and manually label the oil film pollution area on the collected images. Manual labeling is inefficient and difficult to handle when the number of images is huge. In addition, the grayscale of the oil film area in the image is similar to that of the seawater, which makes it difficult for humans to distinguish, easily leading to misjudgment and low accuracy. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus, device and storage medium for determining oil film regions in an image, so as to solve the problems of low efficiency and low accuracy of manual annotation.

[0004] According to a first aspect of the present disclosure, a method for determining an oil film region in an image is provided, comprising:

[0005] Acquire a first image of the oil slick at sea, which serves as the raw image to be processed;

[0006] The first image is preprocessed to obtain the second image;

[0007] The second image is input into the neural network to obtain a third image of the radar's effective detection range;

[0008] In the third image, the original contact points are obtained by traversing the pixels;

[0009] The original contact points are updated using the Bresenham algorithm to obtain the fourth image;

[0010] The boundaries in the fourth image are improved and optimized to obtain the fifth image;

[0011] The improvement and optimization of the boundaries in the fourth image includes:

[0012] The coordinates of the boundary points in the fourth image are smoothly adjusted.

[0013] The fifth image is processed using a chaotic evolutionary optimization algorithm to obtain a sixth image of the ternary effect of the marine oil slick;

[0014] The oil film region is determined based on the sixth image.

[0015] In a second aspect, an apparatus for determining an oil film region in an image includes:

[0016] The acquisition module is used to acquire a first image of the oil slick at sea, which serves as the raw image to be processed.

[0017] The preprocessing module is used to perform preprocessing operations on the first image to obtain the second image;

[0018] The radar effective detection area determination module is used to input the second image into the neural network to obtain a third image of the radar effective detection area;

[0019] The preliminary ROI extraction module is used to obtain the original contact points in the third image by traversing the pixels;

[0020] The original contact points are updated using the Bresenham algorithm to obtain the fourth image;

[0021] The regularization module improves and optimizes the boundaries in the fourth image to obtain the fifth image;

[0022] The improvement and optimization of the boundaries in the fourth image includes:

[0023] The coordinates of the boundary points in the fourth image are smoothly adjusted.

[0024] The classification module is used to process the fifth image using a chaotic evolutionary optimization algorithm to obtain a sixth image of the ternary effect of the marine oil slick;

[0025] The determination module is used to determine the oil film area based on the sixth image.

[0026] Thirdly, an electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements a method for determining an oil film region in an image.

[0027] Fourthly, a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the steps of a method for determining an oil film region in an image.

[0028] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0029] The above-mentioned technical solution of this application uses a chaotic algorithm to optimize the ternary algorithm and a chaotic evolutionary optimization algorithm to process the fifth image to obtain a ternary image of the marine oil slick; it improves the clarity of image region division, which is conducive to more accurately determining the smooth adjustment of pixel values ​​of boundary point pixels in the fourth image; in the fifth image, the edges are more regular, which is also conducive to determining the oil slick region.

[0030] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0032] Figure 1 This is a flowchart illustrating a method for determining an oil film region in an image according to an exemplary embodiment;

[0033] Figure 2 This is an original image shown according to an exemplary embodiment;

[0034] Figure 3 This is a structural diagram of a neural network according to an exemplary embodiment;

[0035] Figure 4 This is a schematic diagram illustrating sample annotation according to an exemplary embodiment;

[0036] Figure 5 This is a classification graph processed by a neural network according to an exemplary embodiment;

[0037] Figure 6 This is an image of the original contact point of an oil film area according to an exemplary embodiment;

[0038] Figure 7 This is an image illustrating a new contact point in an oil film region according to an exemplary embodiment;

[0039] Figure 8 This is a segmented image updated with an oil film region, as illustrated in an exemplary embodiment.

[0040] Figure 9 This is an image processed by an oil film region weighted smoothing algorithm according to an exemplary embodiment;

[0041] Figure 10 This is an updated original image shown according to an exemplary embodiment;

[0042] Figure 11 This is an image enhanced by a chaotic evolutionary optimization algorithm according to an exemplary embodiment;

[0043] Figure 12 This is an image of an oil film region according to an exemplary embodiment;

[0044] Figure 13 This is an example of converting an image back to polar coordinates, as illustrated in an exemplary embodiment.

[0045] Figure 14 This is a block diagram illustrating an oil film region determination device in an image according to an exemplary embodiment;

[0046] Figure 15 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0048] This application proposes a method for determining oil film regions in an image; see appendix. Figure 1 The method includes the following steps:

[0049] In step S102, a first image of the oil slick at sea is acquired, and the first image is used as the original image to be processed.

[0050] See appendix Figure 2 In this embodiment, marine radar can be used to detect the oil spill area at sea and obtain the first image of the oil slick at sea.

[0051] In step S104, the first image is preprocessed to obtain the second image.

[0052] In this embodiment, the preprocessing operations include, but are not limited to, quantity enhancement processing and image denoising processing.

[0053] In some embodiments, image preprocessing is defined as a series of targeted transformation and optimization operations performed on the original image before core tasks such as image analysis, feature extraction, and object detection are executed. Its core objective is to eliminate image noise and enhance the distinction between the target and the background. First, the original image data is transformed from polar coordinates to Cartesian coordinates to construct a unified spatial reference frame. For co-frequency interference noise, the Laplacian operator is used for accurate noise detection and extraction. Subsequently, the extracted noise is smoothed using a mean filtering algorithm to reduce its local fluctuations. Finally, edge filling methods are used to solve the problem of extracting complete image patches in the image edge regions. Non-standard sized image patches are standardized to ensure that the feature dimensions of all input samples are consistent.

[0054] In step S106, the second image is input into the neural network to obtain a third image of the radar's effective detection area.

[0055] In this embodiment, a neural network is used to classify the second image by color. The network learns the spatial location features and color features of the image to achieve accurate segmentation and obtain a third image. In the third image, the image is divided into a seawater background area of ​​the first color and a radar effective detection area of ​​the second color.

[0056] In this embodiment, the traditional single hidden layer and sigmoid activation function in the neural network are replaced with a double hidden layer and ReLU activation function.

[0057] In step S108, the original contact points are obtained in the third image by traversing the pixels.

[0058] The original contact points are updated using the Bresenham algorithm to obtain the fourth image;

[0059] The original contact point is the first pixel whose grayscale value changes when searched from top to bottom in each column.

[0060] In this embodiment, the original boundary of the radar effective detection area in the third image is updated to obtain the updated boundary of the radar effective detection area. The boundary of the radar effective detection area refers to the set of pixels belonging to the radar effective detection area. These pixels are located between the radar effective detection area and the ocean area, are adjacent to pixels in the ocean area, and have pixel values ​​that differ from those in the ocean area. These pixels constitute the boundary of the radar effective detection area.

[0061] The boundary of the effective radar detection area is not a smooth geometric straight line, but an irregular contour composed of a large number of discrete pixels. In practical processing, the edge is usually decomposed into several segments of straight lines with small slopes (piecewise linear fitting). The boundary update mechanism of the Bresenham algorithm selects the pixel with the smallest error for each straight line segment. This makes the extracted boundary pixels as close as possible to the actual edge of the effective radar detection area, avoiding the precision loss and computational cost of floating-point operations, and enabling faster operation on embedded devices. The generated boundary pixels are continuous and ordered, without any discontinuities, making subsequent radar effective detection area identification and region segmentation less prone to errors.

[0062] In step S110, the boundaries in the fourth image are improved and optimized to obtain the fifth image;

[0063] The improvement and optimization of the boundaries in the fourth image includes:

[0064] The coordinates of the boundary points in the fourth image are smoothed, or a morphological optimization algorithm is used to optimize the boundary of the oil film region.

[0065] In step S112, the fifth image is processed using a chaotic evolutionary optimization algorithm to obtain a sixth image of the ternary effect of the marine oil slick.

[0066] In this embodiment, the chaotic evolutionary optimization algorithm optimizes the ternary modeling algorithm using a chaotic algorithm. The ternary modeling algorithm is used for image classification. The image is divided into three categories, each represented by a different grayscale value, i.e., ternary modeling. Post-processing operations are then performed on the ternary image to achieve optimization.

[0067] The ternary transformation algorithm divides a grayscale image into three gray levels, simplifying the image into three categories of pixels: black, gray, and white. This allows for quick differentiation of oil film areas, marine background areas, and transitional areas. The threshold values ​​for ternary transformation are 0, 128, and 255, corresponding to white, gray, and black, respectively.

[0068] By using a chaotic algorithm to optimize the ternary algorithm, the two thresholds can be optimized, thereby improving the region segmentation effect in the sixth image.

[0069] In step S114, the oil film area is determined based on the sixth image.

[0070] The above-mentioned technical solution of this application uses a chaotic algorithm to optimize the ternary algorithm, and uses the optimized ternary algorithm to process the fifth image to obtain the ternary image of the marine oil slick; this improves the clarity of image region division and is conducive to more accurately determining the oil slick region.

[0071] In some embodiments, preprocessing the first image includes: performing a coordinate system transformation on the first image, transforming the image's polar coordinate system into a Cartesian coordinate system.

[0072] Transforming an image from a polar coordinate system to a Cartesian coordinate system, also known as a rectangular coordinate system, converts image information described in terms of angles and radii into a more intuitive rectangular coordinate (x, y) form to adapt to different analysis, processing, or display needs.

[0073] The number of samples in the first image after coordinate system transformation is increased to obtain marine oil slick sample data images.

[0074] In this embodiment, the quantity can be increased by copying, rotating, resizing, or changing the image contrast of the original first image, thereby increasing the quantity.

[0075] In some embodiments, manually labeled samples are used for classification by the neural network, and the manually labeled samples are expanded. A 5×5 sample is created centered on the manually labeled pixels.

[0076] In some embodiments, the first image, after coordinate system transformation, is subjected to scaling and rotation to increase its quantity.

[0077] For example, this application uses multi-scale rotation-enhanced sampling for improvement. First, a small number of samples are manually labeled, and then the original sample size is expanded by 12 times through a combination of 3 scales and 4 angles to optimize the overfitting problem in small sample scenarios. The formula is as follows:

[0078] ;

[0079] ;

[0080] s: Scale scaling factor (0.8 for shrinking, 1.0 for keeping it unchanged, 1.2 for enlarging);

[0081] Rotation angle (0° / 90° / 180° / 270°, ensuring the integrity of the area after rotation);

[0082] Image patch scaling function;

[0083] : Rotation function;

[0084] : Scale uniformly to 5×5 pixels to ensure consistent input dimensions.

[0085] : Set union, summarizing augmented samples at all scales and angles.

[0086] Scale transformation allows the model to adapt to contaminated areas of different sizes, such as large-area oil spills and small-scale leaks;

[0087] Rotation transformation enhances the model's robustness to contaminated areas at arbitrary angles, such as irregular oil spill patterns caused by ocean currents.

[0088] Finally, the resize operation ensures that all sample input dimensions are uniform, satisfying the neural network's requirement for a fixed input size.

[0089] In some embodiments, the neural network replaces the single hidden layer and sigmoid activation function in a traditional neural network with a double hidden layer and ReLU activation function.

[0090] Traditional neural networks typically employ a single hidden layer and a sigmoid activation function. The sigmoid activation function is prone to gradient vanishing when the absolute value of the input is large, making deep networks difficult to train. A single hidden layer has weak feature mapping capabilities, failing to capture multi-level features of contaminated regions and exhibiting low accuracy in recognizing blurred edges.

[0091] This application improves upon the traditional neural network structure by employing a double hidden layer and a rectified linear unit (ReLU).

[0092] ReLU offers several advantages, including solving the vanishing gradient problem and accelerating training. Traditional activation functions, such as sigmoid, cause gradients to approach zero when input values ​​are too large or too small, leading to training bottlenecks in deep networks. ReLU, however, maintains a constant gradient of 1 when x > 0, enabling effective backpropagation and rapid convergence even in deep CNNs. It also boasts extremely low computational cost, making it well-suited for image processing tasks. Eliminating the need for complex calculations involving exponential or trigonometric functions significantly reduces computational overhead for networks handling high-resolution images and numerous pixels, resulting in faster training and inference. Furthermore, it introduces sparsity, enhancing generalization ability.

[0093] This application uses ReLU instead of sigmoid to optimize the gradient vanishing problem; the dual hidden layers fuse details and semantic features, improving the recognition accuracy of blurred edge regions and optimizing the weak feature extraction capability of traditional networks.

[0094] The improved neural network of this application also includes a batch normalization module and a feature fusion module, which perform batch normalization processing and feature fusion processing respectively.

[0095] The calculation formula is as follows:

[0096] ;

[0097] ;

[0098] ;

[0099] Where x is the input vector after the 5×5 image patch is flattened, with a dimension of 25, corresponding to 25 pixel values;

[0100] This is the first weight matrix;

[0101] This is the second weight matrix;

[0102] This is the second bias vector;

[0103] This is the first bias vector;

[0104] The first batch mean after batch normalization;

[0105] The second batch mean is normalized.

[0106] The first batch variance is normalized.

[0107] The second batch variance is normalized.

[0108] The first scaling factor for batch normalization;

[0109] The second scaling factor for batch normalization;

[0110] This involves splicing shallow features.

[0111] For deep feature splicing;

[0112] The first offset factor for batch normalization;

[0113] The second offset factor for batch normalization;

[0114] It is the minimum value;

[0115] max(0, z): The mathematical expression for the ReLU activation function;

[0116] [h1; h2]: Feature concatenation, which vertically concatenates shallow detail features h1 with deep semantic features h2;

[0117] These are the weights of the k-th class in the output layer;

[0118] This is the bias for the k-th class of the output layer;

[0119] This represents the predicted probability of the k-th class in the output layer, ranging from 0 to 1, with the sum of the probabilities of the three classes being 1.

[0120] This is the mathematical expression for the softmax function, used to achieve multi-class probability normalization;

[0121] The softmax function is used to output the probabilities of three classes (black / white / gray).

[0122] In some embodiments, the ROI extraction process consists of three steps: sample annotation, neural network classification, and post-processing.

[0123] The marine radar experimental data were labeled using a pixel-level classification method. The samples were labeled into two categories: the first category was the effective wave detection area (marked in red); the second category was the invalid wave detection area (marked in blue).

[0124] For sample feature extraction, firstly, a 5×5 neighborhood window is obtained centered on the labeled point as the sample. Then, the 5×5 neighborhood window is expanded into a 25-dimensional vector.

[0125] In some embodiments, see Appendix Figure 3 The aforementioned neural network can employ a Multi-Layer Perceptron (MLP). The constructed MLP network is a three-layer fully connected neural network (FCNN) structure, consisting of an input layer, two levels of hidden layers, and an output layer. Its core characteristic is that neurons in each layer of the network are fully connected to all neurons in adjacent layers, with no local connections or weight sharing mechanisms.

[0126] (1) Input layer: This layer is the feature input layer, which takes in a 25-dimensional feature vector. This layer does not require parameter setting and is only responsible for passing the features to ensure that the input format matches the subsequent layers.

[0127] (2) Hidden layer: The network contains two levels of hidden layers, both of which are composed of fully connected layers and nonlinear activation functions, used to achieve nonlinear transformation and dimensionality compression of features.

[0128] (a) The first hidden layer is a fully connected layer containing 8 neurons. It maps the 25-dimensional input features to an 8-dimensional space through a linear transformation, thus achieving the initial extraction of feature dimensions. Its ReLU activation layer introduces a non-linear transformation to enhance the network's ability to fit complex features.

[0129] (b) The second hidden layer, a fully connected layer containing four neurons, further compresses and transforms the output features of the first-level hidden layer to extract more abstract discriminative features. Its ReLU activation layer continues to introduce nonlinear transformations to prevent the network from degenerating into a linear model.

[0130] (3) Output layer: The output layer consists of a fully connected layer, a softmax layer, and a classification layer, used to implement binary classification decisions. The fully connected layer contains two neurons, mapping the features of the second hidden layer to the class space and outputting the original score matching the number of classes. The softmax layer transforms the original score into a probability distribution, making the sum of the output class probabilities equal to 1. The classification layer defines the objective function for model optimization, using cross-entropy loss as the optimization objective, quantifying the difference between the predicted probability and the true label:

[0131] ;

[0132] in, The cross-entropy loss value represents a single sample and is used to quantify the difference between the model's prediction and the true label; c is the class index, which takes the value 1 or 2 (corresponding to the two classes in a binary classification task). One-hot encoding of the actual label; Let c be the class probability output by the model through the Softmax layer, satisfying and This reflects the model's confidence level that the sample belongs to class c.

[0133] See appendix Figure 4 The samples were labeled into two categories: the first category was the effective wave detection area (marked in red); the second category was the invalid wave detection area (marked in blue). After speckle removal and internal hole filling, a preliminary classification image of the Region of Interest (ROI) was obtained.

[0134] See appendix Figure 5 The image contains a significant amount of noise and is accompanied by abnormal protrusions, which hinders the accuracy of oil film extraction. To address this issue, a boundary update method is used to obtain the original contact points, as shown in the example. Figure 5 As shown. The original contact points can effectively filter out some interference, but they cannot effectively handle defects such as cliff breaks. For the original contact points with large column coordinate differences in the local neighborhood, a boundary update method is used to optimize them, resulting in updated contact points as shown. Figure 7 As shown. Compared to the original contact points, the transition of the updated contact points is more natural and smooth. A new segmentation image is generated based on the updated contact points, as shown. Figure 8 As shown. Although the Bresenham algorithm in the early stages of the boundary update method improved the problem of large differences in the coordinates of the contact point column, defects such as spike noise, burr artifacts, and cliffs still exist in the original boundary, affecting the accuracy of oil film extraction. The smoothed segmentation result obtained by using the basic weighted smoothing algorithm of the boundary update method is shown below. Figure 9 As shown.

[0135] In some embodiments, in step S108, the original contact point is obtained in the third image by traversing the pixels.

[0136] The original contact points are updated using the Bresenham algorithm to obtain a fourth image, which may further include the following steps:

[0137] (1) Acquisition of the original contact point:

[0138] For each column x, scan downwards from the top to the first non-zero cell. Let the behavior of that cell be y, then pixel (x, y-1) is the original contact point.

[0139] (2) Create the initial set of contact points:

[0140] Let the contact points detected in the positive x-axis direction constitute a point set. :

[0141] ;

[0142] ;

[0143] in, This represents the k-th contact point; is the x and y coordinates of the k-th contact point; n=2048, which is the total number of contact points.

[0144] (3) Pairing of adjacent original contact points:

[0145] Take adjacent pairs of points along the positive x-axis:

[0146] ;

[0147] (4) Solving for linear coordinates and updating contact points:

[0148] For any pair of points Perform the following processing:

[0149] (a) Define the direction difference and the step direction:

[0150] ;

[0151] ;

[0152] (b) Initialize the error term and the current point:

[0153] ;

[0154] (c) Iteratively solve for all integer coordinates on the line:

[0155] ;

[0156] ;

[0157] in, Indicates the start and end points of an adjacent pair of points; It represents the absolute value of the difference between adjacent points in the horizontal and vertical directions; The stepping directions are horizontal and vertical. This is the error term; Represents the coordinates of the current point during the iteration process; for and The set of all integer coordinates of points on the straight line between them; This is a sign function; it outputs 1 when the input is positive and -1 when the input is negative.

[0158] (d) Merge the set of points on the line for all pairs of points:

[0159] ;

[0160] in, This represents the set of coordinates for all updated contact points;

[0161] This represents the set of points that form the straight line between two adjacent contact points.

[0162] Appendix Figure 6 To update the previous image, attached Figure 7 This is the updated image.

[0163] See appendix Figure 8 , attached Figure 8 For the attached Figure 7 The generated new segmented image. Although the Bresenham algorithm in the early boundary update method improved the problem of large differences in the coordinates of the contact point column, there are still defects such as spike noise, spur artifacts, and cliffs in the original boundary, which affect the accuracy of oil film extraction.

[0164] Therefore, further optimization and improvement of the boundary are needed. There are two methods for this optimization. One method is to smoothly adjust the coordinates of the boundary points in the fourth image, and the other method is to use a morphological optimization algorithm to optimize the boundary of the oil film region. These will be explained below.

[0165] In some embodiments, step S110, which involves smoothing the coordinates of the boundary points in the fourth image to obtain the fifth image, further includes the following steps:

[0166] For any boundary point pixel, determine the size of the neighborhood centered on the boundary point pixel.

[0167] The neighborhood can be circular, square, or rectangular, etc. For a circle, the neighborhood size is its diameter; for a square, the neighborhood size is its side length, which is the number of pixels distributed along one side. For example, a square has 5 neighbors. A pixel matrix of 5.

[0168] The neighborhood of the boundary point pixel is determined based on the neighborhood size; the neighborhood of the boundary point pixel includes multiple pixels centered on the boundary point pixel.

[0169] For example, if the neighborhood is circular, then the circle is centered on the boundary pixel. This circular area includes multiple pixels. If the neighborhood is square, then the square is centered on the boundary pixel.

[0170] Determine the basic weight of each pixel in the neighborhood, excluding the boundary point pixels;

[0171] The coordinates of the boundary point pixel are determined based on the pixel value and basic weight of each pixel except the boundary point pixel.

[0172] In this embodiment, the pixel value of each pixel other than the boundary point pixel can be multiplied with the basic weight to obtain the product, and then the product of each pixel can be summed to obtain the coordinate value of the boundary point pixel.

[0173] In some embodiments, a basic weighted smoothing method is employed, which specifically includes setting the neighborhood diameter of the boundary point and updating the boundary point.

[0174] In some embodiments, for any boundary point pixel, determining the neighborhood size centered on the boundary point pixel includes:

[0175] (1) Set the boundary point neighborhood diameter. Constraining the number of boundary points in the neighborhood can avoid interference from distant points. This method can also improve processing efficiency while preserving certain original features. The boundary point neighborhood diameter D is:

[0176] ;

[0177] in, This is the smoothing intensity coefficient. The maximum boundary point neighborhood diameter is preferably 21.

[0178] In some embodiments, determining the basic weight of each pixel in the neighborhood, excluding the boundary point pixels, includes:

[0179] (2) Determine the basic weight of each pixel in the neighborhood, excluding the boundary point pixels, including:

[0180] ;

[0181] in, This represents the basic weight of the k-th neighboring point. ,for The minimum value; ,for The maximum value; is the linearity coefficient; this experiment recommends a value of 0.22. D is the neighborhood size. When hour, The magnification was increased by 2.5 times to increase the weight of the center point. Then, for... Normalization is performed.

[0182] (3) Update boundary points. The pixel coordinates R of the boundary points are smoothed as follows:

[0183] ;

[0184] in, The base weight of the first pixel;

[0185] The basic weight of the D-th pixel;

[0186] B1 represents the pixel value of the first pixel;

[0187] This represents the pixel value of the D-th pixel.

[0188] (4) Set the smoothing range. The maximum allowable range of change. for:

[0189] .

[0190] In this embodiment, the smoothing range is the number of pixels in each fitted line segment. For example, the smaller the smoothing range (e.g., 5 to 10 pixels / segment), the more line segments are fitted, the closer the edges are to the real contour, and the smoother it looks. However, it requires more boundary update operations, which slightly increases the time consumption.

[0191] The larger the smoothing range (e.g., 20-30 pixels / segment), the fewer straight line segments are fitted, resulting in higher computational efficiency. However, jagged edges may appear, and the deviation from the true contour will increase.

[0192] In this embodiment, the number of pixels on each fitted line segment does not exceed the maximum variation range M mentioned above.

[0193] In some embodiments, step S110, employing a morphological optimization algorithm to optimize the boundary of the oil film region, further includes the following steps:

[0194] A dynamic structuring element is used to perform multiple opening and closing operations on the boundary of the fourth image to optimize it. Specifically, after each opening and closing operation, the size of the dynamic structuring element is redefined based on the adjusted boundary, and the redefined dynamic structuring element is used to perform opening and closing operations on the adjusted boundary again.

[0195] In boundary optimization that preserves depth, traditional methods employ erosion and dilation operations with fixed structuring elements. However, fixed structuring element sizes cannot adapt to target regions of varying sizes; small structuring elements struggle to eliminate boundary burrs, while large structuring elements excessively shrink the target region, and rigid transformations easily disrupt the natural morphology of the target region.

[0196] This application has been improved by adopting an adaptive distance transformation and iterative morphological optimization method, which is explained below with calculation formulas.

[0197] ;

[0198] ;

[0199] ;

[0200] ;

[0201] ;

[0202] ;

[0203] The shortest Euclidean distance from the contaminated pixel to the background;

[0204] This represents the contaminated area after k iterations.

[0205] This represents the contaminated region after k+1 iterations.

[0206] To adjust the original contaminated area;

[0207] Mean distance from the original boundary;

[0208] An adaptive threshold based on the mean distance, with 0.9 as an empirical coefficient;

[0209] : Dynamic structural element dimensions;

[0210] Opening operation, used for deburring;

[0211] , closing operation, used to fill holes.

[0212] See Appendix Figure 10 An updated image as shown, which is obtained by fusing and updating the Appendix Figure 9 with the preprocessed image.

[0213] See Appendix Figure 11 , and is obtained by processing the Appendix Figure 10 using a chaotic evolutionary optimization binarization algorithm.

[0214] See Appendix Figure 12 , and is obtained by performing hole filling and small area filtering on the smallest class target in the Appendix Figure 11 .

[0215] See Appendix Figure 13 , after fusing the Appendix Figure 12 with the preprocessed image, convert it back to the polar coordinate system.

[0216] The chaotic evolutionary optimization binarization algorithm is described in detail below.

[0217] In step S112, the chaotic evolutionary optimization algorithm is used to process the fifth image to obtain the sixth image of the binarization effect of the offshore oil film; where the chaotic evolutionary optimization algorithm is to optimize the binarization algorithm using the chaotic algorithm.

[0218] In this embodiment, the fifth image can also be fused with the preprocessed image to obtain a fused image, and the chaotic evolutionary optimization algorithm is used to process the above fused image to obtain the sixth image of the binarization effect of the offshore oil film.

[0219] In this embodiment, the binarization algorithm is a technique in image segmentation or data processing that maps the input data, usually the pixel values of a grayscale image, to three discrete values, such as 0, 1, 2 or other three preset values, so as to simplify the data complexity and highlight the key features. By setting two thresholds (T1 and T2, and T1 < T2), the input data is divided into three intervals, and each interval corresponds to a target value. The specific rules are as follows: if the data value is less than or equal to T1, it is mapped to the first value (such as 0); if the data value is greater than T1 and less than or equal to T2, it is mapped to the second value (such as 1); if the data value is greater than T2, it is mapped to the third value (such as 2).

[0220] The key to binarization is to determine two thresholds T1 and T2 (T1 < T2). Traditional methods, such as the manual threshold setting method, may fall into local optimality or rely on prior knowledge. To solve the above problems, a chaotic algorithm is used to optimize the binarization algorithm. Chaotic optimization generates candidate thresholds by introducing a chaotic sequence and combines an evaluation function to screen the optimal solution, realizing the adaptive optimization of the threshold.

[0221] This application also improves the traditional chaotic algorithm. The improvement points are included in the following steps:

[0222] In the chaotic evolutionary optimization algorithm, the initialization by the Logistic chaotic map is used to replace the simple uniform distribution initialization; a dynamic chaotic perturbation is added to strengthen the mutation operation; a fitness function that combines entropy and contrast is used to replace the single entropy evaluation. The following is a detailed description:

[0223] (1) Population initialization.

[0224] Initial population It is generated through a chaotic map (Logistic Map), ensuring population diversity.

[0225] In this embodiment, the initialization by the Logistic chaotic map can be used to replace the simple uniform distribution initialization. The role of the initialization by the Logistic chaotic map is to generate more advantageous initial threshold candidate values.

[0226] (2) Fitness function.

[0227] In this embodiment, a fitness function that combines entropy and contrast is used to replace the single entropy evaluation. Specifically, it includes the following steps:

[0228] Determine the total entropy of the image and the contrast between the contaminated area and the background;

[0229] According to the first product of the first weight and the total entropy of the image and the second product of the second weight and the contrast between the contaminated area and the background;

[0230] The sum of the first product and the second product is the fitness.

[0231] Exemplarily, the calculation formula is as follows:

[0232] ;

[0233] Where, is the total entropy of the image, evaluating the richness of regional information;

[0234] is the contrast between the contaminated area and the background, evaluating the boundary sharpness. ]

[0235] In some embodiments, the total entropy is calculated using the following method, and the image is segmented using x to generate n regions R:

[0236] ;

[0237] ;

[0238] ;

[0239] in, This represents the total number of pixels in the image. For the region The number of pixels; for Number of pixels with medium grayscale values; It is the minimum value; This represents the proportion of pixels in the k-th region to the total number of pixels in the image; This represents the grayscale value of the image.

[0240] In some embodiments, the contrast is calculated using the following method:

[0241] ;

[0242] in, For the region The mean; This is the global mean.

[0243] (3) Location update: Randomly select 3 different individuals x r1 x r2 x r3 Generate the mutation vector v:

[0244] ;

[0245] in, As a scaling factor, preferably, F is... .

[0246] To balance the randomness and fitness of the search, the mutation vector components are updated based on the chaotic core factor z. :

[0247] ;

[0248] in, These are the updated mutation vector components;

[0249] v represents the mutated vector component before the update;

[0250] ub , which is the set upper limit of the threshold;

[0251] , which is the set lower limit of the threshold;

[0252] The value represents the perturbation intensity, which decreases with iteration.

[0253] The formula for calculating disturbance intensity is as follows:

[0254] ;

[0255] Where t is the current iteration number;

[0256] T is the maximum number of iterations, preferably 50;

[0257] Then generate random numbers. When the random number is less than the crossover probability... hour:

[0258] ;

[0259] Preferred settings .

[0260] In this embodiment, dynamic chaotic perturbation is used to enhance the mutation operation. During the iterative optimization process, the core is to continuously generate new candidate thresholds, perform mutation operations, evaluate fitness, and gradually approach the optimal threshold. The role of dynamic chaotic perturbation is to replace traditional fixed-rule mutations, such as simple random additions or subtractions, with the randomness and sensitivity of chaotic sequences each time a new candidate threshold is generated. This allows the new threshold to both escape the current local optimum (e.g., avoid constantly fluctuating around a non-optimal threshold) and accurately fit the distribution of the threshold search space, ultimately increasing the probability of selecting the globally optimal threshold.

[0261] Chaotic perturbation breaks the homogeneity of the later population, avoids getting trapped in local optima, and can maintain its optimization vitality, especially in the later stages of iteration.

[0262] The optimized threshold is used to perform ternary transformation, and the optimal threshold is applied to the preprocessed oil film image to complete the classification. Compared with the traditional ternary transformation algorithm, the chaotic optimization has the following effects: for oil film images with uneven gray levels, it can accurately distinguish between seawater, oil film edge, and oil film body, avoiding misclassification of oil film edge as seawater; it has stronger noise resistance, and even if the image has sea clutter, it can avoid local optimal thresholds through global optimization, ensuring the integrity of the oil film region.

[0263] Secondly, this application proposes a device for determining oil film regions in an image, see attached document. Figure 14 ,include:

[0264] The acquisition module 11 is used to acquire a first image of the marine oil slick, which is used as the raw image to be processed.

[0265] Preprocessing module 12 is used to perform preprocessing operations on the first image to obtain the second image;

[0266] The radar effective detection area determination module 13 is used to input the second image into the neural network to obtain a third image of the radar effective detection area;

[0267] The preliminary ROI extraction module 14 is used to update the original boundary of the oil film region in the third image using the Bresenham algorithm to obtain the updated boundary of the oil film region and the boundary pixels on the updated boundary of the oil film region, thus obtaining the fourth image.

[0268] The regularization module 15 is used to improve and optimize the boundaries in the fourth image to obtain the fifth image;

[0269] The improvement and optimization of the boundaries in the fourth image includes:

[0270] The coordinates of the boundary points in the fourth image are smoothly adjusted.

[0271] Classification module 16 is used to process the fifth image using a chaotic evolutionary optimization algorithm to obtain a sixth image of the ternary effect of the marine oil slick;

[0272] The determination module 17 is used to determine the oil film area based on the sixth image.

[0273] In some embodiments, the preprocessing module 12 is further configured to perform coordinate system transformation on the first image, transforming the image polar coordinate system into a Cartesian coordinate system;

[0274] The number of samples in the first image after coordinate system transformation is increased to obtain marine oil slick sample data images.

[0275] In some embodiments, the regularization module 15 also employs dynamic structural elements to perform multiple opening and closing operations on the edges of the fourth image for optimization. Specifically, after each opening and closing operation, the size of the dynamic structural element is redefined based on the adjusted edge region, and the redefined dynamic structural element is used to perform opening and closing operations on the adjusted edge region again.

[0276] In some embodiments, the normalization module 15 is further configured to smooth the coordinates of the boundary points in the fourth image to obtain a fifth image, specifically including:

[0277] For any boundary point pixel, determine the size of the neighborhood centered on the boundary point pixel;

[0278] The neighborhood of the boundary point pixel is determined based on the neighborhood size; the neighborhood of the boundary point pixel includes multiple pixels centered on the boundary point pixel.

[0279] Determine the basic weight of each pixel in the neighborhood, excluding the boundary point pixels;

[0280] The coordinates of the boundary point are determined based on the pixel value and basic weight of each pixel except the boundary point pixel.

[0281] In some embodiments, the preprocessing module 12 is further configured to perform size scaling and rotation processing on the first image after coordinate system transformation to achieve quantity expansion.

[0282] Figure 15 This is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device 300 of this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a processing program for determining oil film areas in an image. When the processor 30 executes the computer program 32, it implements the steps in the various method embodiments described above, for example... Figure 1 Steps 102 to 114 are shown. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module in the above-described device embodiments, for example... Figure 14 As shown, this describes the functions of modules 11 to 17.

[0283] For example, the computer program 32 described above can be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 30 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 32 in the electronic device 300.

[0284] The aforementioned electronic device 300 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The aforementioned electronic device may include, but is not limited to, a processor 30 and a memory 31. Those skilled in the art will understand that the figures are merely examples of the electronic device 300 and do not constitute a limitation on the electronic device 300. It may include more or fewer components than illustrated, or combine certain components, or use different components. For example, the aforementioned electronic device may also include input / output devices, network access devices, buses, etc.

[0285] The processor 30 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0286] In some embodiments, this application also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the steps of the method for determining the oil film region in an image as described in any of the preceding claims.

[0287] In some embodiments, this application also proposes a radar including the aforementioned electronic equipment.

[0288] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0289] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for determining oil film regions in an image, characterized in that, include: Acquire a first image of the oil slick at sea, which serves as the raw image to be processed; The first image is preprocessed to obtain the second image; The second image is input into the neural network to obtain a third image of the radar's effective detection area; In the third image, the original contact points are obtained by traversing the pixels; The original contact points are updated using the Bresenham algorithm to obtain the fourth image; The boundaries in the fourth image are improved and optimized to obtain the fifth image; The improvement and optimization of the boundaries in the fourth image includes: The coordinates of the boundary points in the fourth image are smoothly adjusted using a basic weighted smoothing method; The fifth image is processed using a chaotic evolutionary optimization algorithm to obtain a sixth image of the ternary effect of the marine oil slick. The chaotic evolutionary optimization algorithm is to optimize the threshold in the ternary algorithm using a chaotic algorithm. The oil film region is determined based on the sixth image; In the chaotic evolution optimization algorithm, logistic chaotic mapping initialization is used instead of simple uniform distribution initialization. Add dynamic chaotic perturbations to enhance mutation operations; Replace single entropy evaluation with a fitness function that combines fusion entropy and contrast.

2. The method for determining the oil film region in an image according to claim 1, characterized in that, The preprocessing operation on the first image includes: performing a coordinate system transformation on the first image, transforming the image polar coordinate system into a Cartesian coordinate system; The number of samples in the first image after coordinate system transformation is increased to obtain marine oil slick sample data images.

3. The method for determining the oil film region in an image according to claim 1, characterized in that, The boundary point pixels in the fourth image are smoothed to obtain the fifth image, which includes: For any boundary point pixel, determine the size of the neighborhood centered on the boundary point pixel; The neighborhood of the boundary point pixel is determined based on the neighborhood size; the neighborhood of the boundary point pixel includes multiple pixels centered on the boundary point pixel. Determine the basic weight of each pixel in the neighborhood, excluding the boundary point pixels; The pixel value of the boundary point pixel is determined based on the pixel value and basic weight of each pixel except the boundary point pixel.

4. The method for determining the oil film region in an image according to claim 3, characterized in that, Determining the basic weight of each pixel in the neighborhood, excluding the boundary point pixel, includes: ; Among them, the This represents the basic weight of the k-th pixel; for The maximum value; The coefficients are linear. D is the neighborhood size.

5. The method for determining the oil film region in an image according to claim 3, characterized in that, For any boundary point pixel, determine the neighborhood size centered on the boundary point pixel, including: ; in, The smoothness strength coefficient; is the diameter of the neighborhood of the maximum boundary point.

6. The method for determining the oil film region in an image according to claim 2, characterized in that, Expanding the number of samples in the first image after coordinate system transformation includes: The first image, after coordinate system transformation, is scaled and rotated to increase its quantity.

7. A device for determining oil film regions in an image, characterized in that, include: The acquisition module is used to acquire a first image of the oil slick at sea, which serves as the raw image to be processed. The preprocessing module is used to perform preprocessing operations on the first image to obtain the second image; The radar effective detection area determination module is used to input the second image into the neural network to obtain a third image of the radar effective detection area; The preliminary ROI extraction module is used to obtain the original contact points in the third image by traversing the pixels; The original contact points are updated using the Bresenham algorithm to obtain the fourth image; The regularization module improves and optimizes the boundaries in the fourth image to obtain the fifth image; The improvement and optimization of the boundaries in the fourth image includes: The coordinates of the boundary points in the fourth image are smoothly adjusted. The classification module is used to process the fifth image using a chaotic evolutionary optimization algorithm to obtain a sixth image of the ternary effect of the marine oil slick. The chaotic evolutionary optimization algorithm is to optimize the threshold in the ternary algorithm using a chaotic algorithm. In the chaotic evolution optimization algorithm, logistic chaotic mapping initialization is used instead of simple uniform distribution initialization. Add dynamic chaotic perturbations to enhance mutation operations; Replace single entropy evaluation with a fitness function that combines entropy and contrast; The determination module is used to determine the oil film area based on the sixth image.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for determining the oil film region in an image as described in any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When executed by the processor, the program instructions implement the steps of the method for determining the oil film region in the image according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Chaos genetic BP neural network image segmentation method based on Arnold transformation

    CN107330902A

  • Firefly algorithm design method based on three-valued optical computer

    CN116484903A