Water body detection method and device

By equipping drones with image acquisition devices and computing components, feature extraction and correction of water images are performed, solving the problem of limited computing resources for drones in water monitoring. This enables efficient water detection and change analysis, improving the flexibility and accuracy of detection.

CN120032284BActive Publication Date: 2026-01-09BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510218424.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2026-01-09
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

Unmanned aerial vehicles (UAVs) face challenges in water monitoring, such as limited computing resources, short flight time, and unpredictable flight path and perspective, which prevent them from performing complex water image analysis and flexible water detection.

Method used

By using drones equipped with image acquisition devices and computing components, feature extraction and correction of water body images are performed through channel modules and image processing modules. Water body data is generated by combining channel attention layers and spatial attention layers, and orthorectification and comparison of target water body images are performed to achieve water body change analysis.

Benefits of technology

It improves the flexibility and accuracy of water body detection, enabling real-time analysis of water body characteristics and generation of target water body data, and eliminates the impact of UAV flight attitude on image acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120032284B_ABST
    Figure CN120032284B_ABST
Patent Text Reader

Abstract

The present specification provides a water body detection method and device, wherein the water body detection method comprises: collecting an initial water body image for a target water body, and calling a channel module to convert the initial water body image into a channel water body image in a channel dimension. An image processing module is called to extract initial water body data of the channel water body image, and based on the initial water body data, a corrected target water body image is extracted in the initial water body image, eliminating the influence of the flight attitude of the unmanned aerial vehicle on the collected initial water body image during image collection. A historical water body image of the target water body is determined, and by comparing the target water body image and the historical water body image, target water body data of the target water body is obtained. The water body change analysis of the target water body is realized, and the flexibility and accuracy of water body detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of computer, and particularly relates to a water body detection method and device. BACKGROUND

[0002] With the development of unmanned aerial vehicle technology, unmanned aerial vehicles are more and more widely used in environmental monitoring and other aspects. In the aspect of water body monitoring, unmanned aerial vehicles can quickly and low-costly detect rivers, lakes and other water bodies through remote sensing. At present, traditional water body change detection mainly relies on satellite remote sensing images, but the spatial resolution and time resolution of satellite remote sensing images have certain technical limitations.

[0003] Compared with satellite remote sensing, unmanned aerial vehicles can provide higher resolution images, more flexible and rapid response to water body monitoring tasks, and lower economic cost of image acquisition. However, unmanned aerial vehicles still cannot realize complex water body image analysis and flexible water body detection in actual application due to limited computing resources, short endurance time, and non-fixed heading perspective and other problems. Therefore, an effective water body detection method is urgently needed to solve the above problems. SUMMARY

[0004] Therefore, the embodiments of the present specification provide a water body detection method. The present specification also relates to a water body detection device, a computing device, a computer readable storage medium and a computer program product to solve the above problems existing in the prior art.

[0005] According to a first aspect of the embodiments of the present specification, a water body detection method is provided, comprising:

[0006] Collecting an initial water body image for a target water body, and calling a channel module to convert the initial water body image into a channel water body image in the channel dimension;

[0007] Calling an image processing module to extract initial water body data of the channel water body image, and extracting a corrected target water body image in the channel water body image based on the initial water body data;

[0008] Determining a historical water body image of the target water body, and obtaining target water body data of the target water body by comparing the target water body image and the historical water body image.

[0009] Optionally, the collecting an initial water body image for a target water body, and calling a channel module to convert the initial water body image into a channel water body image in the channel dimension comprises:

[0010] Collecting the initial water body image for the target water body in the color dimension and the spectral dimension by using an unmanned aerial vehicle carrying an image collection device;

[0011] determine a channel module contained in a computing component carried by the unmanned aerial vehicle, and perform spatial feature extraction and spectral feature extraction on the initial water body image of the initial channel number by using the channel module;

[0012] fuse the extracted spatial features and spectral features to obtain the channel water body image of the target channel number.

[0013] Optionally, the training of the channel module comprises:

[0014] determining a sample water body image and a sample channel water body image corresponding to the sample water body image in a training sample set;

[0015] inputting the sample water body image into an initial channel module for prediction to obtain a predicted channel water body image;

[0016] calculating a loss value based on a combined loss function comprising a structure loss function, a channel loss function and a spectral loss function, the sample channel water body image and the predicted channel water body image;

[0017] performing parameter adjustment on the initial channel module based on the loss value until the channel module satisfying a training stop condition is obtained.

[0018] Optionally, the calling of the image processing module to extract initial water body data of the channel water body image comprises:

[0019] determining a feature extraction convolution layer, an attention layer and an inversion model layer contained in the image processing module;

[0020] extracting initial water body data of the channel water body image by using the feature extraction convolution layer, the attention layer and the inversion model layer.

[0021] Optionally, the attention layer comprises:

[0022] comprising a channel attention layer and a spatial attention layer;

[0023] the channel attention layer is configured to generate global feature description data of the channel water body image, and the spatial attention layer is configured to generate spatial attention weight of the channel water body image;

[0024] the global feature description data and the spatial attention weight are configured to generate the initial water body data.

[0025] Optionally, the extracting of the corrected target water body image in the channel water body image based on the initial water body data comprises:

[0026] segmenting the channel water body image based on the initial water body data to obtain an intermediate water body image;

[0027] Ortho-correct the intermediate water body image based on angle data and position data collected by sensors carried by the unmanned aerial vehicle and device parameters of the image collection device, to obtain the corrected target water body image.

[0028] Optionally, the target water body data of the target water body is obtained by comparing the target water body image and the historical water body image, including:

[0029] Extract target water body feature points in the target water body image, and configure target feature point direction information for the target water body feature points;

[0030] Extract historical water body feature points in the historical water body image, and configure historical feature point direction information for the historical water body feature points;

[0031] Compare the target water body feature points and the target feature point direction information of the target water body image with the historical water body feature points and the historical feature point direction information of the historical water body image, to obtain the target water body data of the target water body.

[0032] Optionally, the target water body feature points in the target water body image are extracted, including:

[0033] Extract target lightweight water body features in the target water body image, and determine target feature point key-value pairs in the target water body image based on the target lightweight water body features;

[0034] Determine the target water body feature points in the target water body image based on target global change features of the target feature point key-value pairs.

[0035] According to a second aspect of the embodiments of the present specification, a water body detection device is provided, including:

[0036] The collection module is configured to collect an initial water body image for a target water body, and call the channel module to convert the initial water body image into a channel water body image in a channel dimension;

[0037] The extraction module is configured to call the image processing module to extract initial water body data of the channel water body image, and extract a corrected target water body image in the channel water body image based on the initial water body data;

[0038] The comparison module is configured to determine a historical water body image of the target water body, and obtain target water body data of the target water body by comparing the target water body image and the historical water body image.

[0039] According to a third aspect of the embodiments of the present specification, a computing device is provided, comprising a memory, a processor, and a computer program or instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the water body detection method when executing the computer program or instructions.

[0040] According to a fourth aspect of the embodiments of the present specification, a computer readable storage medium is provided, which stores a computer program or instructions, wherein the computer program or instructions are executed by a processor to implement the steps of the water body detection method.

[0041] According to a fifth aspect of the embodiments of the present specification, a computer program product is provided, comprising a computer program or instructions, wherein the computer program or instructions are executed by a processor to implement the steps of the water body detection method.

[0042] The water body detection method provided by an embodiment of the present specification can use a UAV to realize collection of an initial water body image and analysis of the initial water body image, and obtain target water body data of a target water body. An initial water body image is collected for the target water body, and a channel module is called to convert the initial water body image into a channel water body image in a channel dimension. An image processing module is called to extract initial water body data of the channel water body image, and a corrected target water body image is extracted in the initial water body image based on the initial water body data, so as to eliminate the influence of a UAV flight posture on the collected initial water body image when the image is collected. A historical water body image of the target water body is determined, and target water body data of the target water body is obtained by comparing the target water body image and the historical water body image. Water body change analysis of the target water body is realized, and the flexibility and accuracy of water body detection are improved. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 is a flowchart of a water body detection method provided by an embodiment of the present specification;

[0044] Figure 2 is a schematic diagram of a channel module of a water body detection method provided by an embodiment of the present specification;

[0045] Figure 3 is a processing flowchart of a water body detection method applied to lake water body detection provided by an embodiment of the present specification;

[0046] Figure 4 is a structural schematic diagram of a water body detection device provided by an embodiment of the present specification;

[0047] Figure 5 is a structural block diagram of a computing device provided by an embodiment of the present specification. DETAILED DESCRIPTION

[0048] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. However, the present description can be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the present description.

[0049] The terminology used in this description is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present description. As used in this description and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0050] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, a first item could be termed a second item, and, similarly, a second item could be termed a first item without departing from the scope of one or more embodiments of the present description. As used herein, the term "if' can be construed to mean "when" or "in response to determining" or "in response to a determination" or "upon determining" or "upon a determination."

[0051] First, the noun terms related to one or more embodiments of the present description are explained.

[0052] IMU (Inertial Measurement Unit): an inertial measurement unit, a sensor device used to measure the motion state of an object in three-dimensional space.

[0053] ORB (Oriented FAST and Rotated BRIEF) algorithm: a feature detection algorithm, a fast corner detection algorithm, which basic idea is to compare the brightness value difference between a pixel point and its surrounding pixel points to determine whether the pixel point is a corner.

[0054] Gabor filter: a two-dimensional filter composed of a Gaussian kernel modulated by a sinusoidal plane wave in the spatial domain. It combines the characteristics of sinusoidal wave and Gaussian function, so it can provide good direction selection and scale selection characteristics. Gabor filter is a linear filter widely used in image processing field, especially suitable for edge extraction and texture analysis.

[0055] BRIEF (Binary Robust Independent Elementary Features) descriptor: a method of image feature description that uses binary encoding to reduce storage requirements and improve computing speed. BRIEF descriptor is a feature description method for representing and describing detected feature points. It generates a binary code string by randomly selecting pixel pairs in the neighborhood of the feature point and comparing their gray values. This encoding method makes BRIEF descriptor efficient and concise.

[0056] In the present specification, a water body detection method is provided, and the present specification also relates to a water body detection device, a computing device, a computer readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.

[0057] Figure 1 A flowchart of a water body detection method according to an embodiment of the present specification is shown, which specifically includes the following steps:

[0058] Step 102: An initial water body image is collected for a target water body, and a channel module is called to convert the initial water body image into a channel water body image in the channel dimension.

[0059] Specifically, the target water body can be a river, a lake, a pond or the like. The initial water body image is an image collected by a drone carrying an image acquisition device for the target water body, and the initial water body image contains a water area structure and a land structure at the edge of the water body. The channel module is an image processing module included in the computing component carried by the drone. The channel water body image is an image obtained by feature extraction and feature fusion of the initial water body image in the channel dimension.

[0060] Based on this, the drone hovers above the target water body, and the initial water body image is collected for the target water body. The drone carries a computing component, and the channel module in the computing component is called to perform feature extraction and feature fusion on the initial water body image, so as to convert the initial water body image into a channel water body image in the channel dimension.

[0061] Further, considering that when the initial water body image of the target water body is collected by the drone, the computing resources of the drone are limited, and real-time recognition and numerical calculation of the water body image cannot be realized, the drone can be made to carry an image acquisition device and a computing component, and the image processing is performed as soon as the initial water body image is obtained, which is specifically implemented as follows:

[0062] The unmanned aerial vehicle carrying the image acquisition device collects the initial water body image in color dimension and spectral dimension for the target water body; the channel module included in the computing component carried by the unmanned aerial vehicle is determined, and the channel module is used for spatial feature extraction and spectral feature extraction on the initial water body image of the initial channel number; the extracted spatial feature and spectral feature are fused to obtain the channel water body image of the target channel number.

[0063] Specifically, the image acquisition device is used for image acquisition of the target water body. The image acquisition device can be a color, multi-spectral or hyperspectral camera. The computing component is used for image recognition and parameter calculation on the initial water body image collected by the image acquisition device. The computing component can be an embedded GPU computing module. The initial channel number refers to the channel number corresponding to the color dimension and the spectral dimension of the initial water body image. The spatial feature represents the feature of the initial water body image in the spatial structure dimension, and the spectral feature represents the feature of the initial water body image in the spectral angle dimension, which is used to measure the angle difference before and after the spectral data mapping of the initial water body data. The target channel number refers to the channel number obtained by normalizing the color dimension and the spectral dimension of the initial water body image.

[0064] Based on this, the unmanned aerial vehicle carrying the image acquisition device collects the initial water body image in color dimension and spectral dimension for the target water body. The initial water body image contains color information and spectral information. The channel module included in the computing component carried by the unmanned aerial vehicle is determined, and the channel module is used for spatial feature extraction and spectral feature extraction on the initial water body image of the initial channel number. The extracted spatial feature and spectral feature are fused to obtain the channel water body image of the target channel number. The channel dynamic normalization of the initial water body image in color dimension and spectral dimension is realized.

[0065] The channel dynamic normalization can be realized by the following formula (1).

[0066]

[0067] Wherein, F c ′ represents the normalized data of channel c. F c represents the original data of channel c. μ c represents the mean of channel c. σ c represents the standard deviation of channel c.

[0068] For example, when detecting the water body of a river, a unmanned aerial vehicle carrying a color, multi-spectral or hyperspectral camera can be used for image acquisition of the river to obtain an initial water body image, i.e. a color, multi-spectral or hyperspectral image. The unmanned aerial vehicle also carries a computing component, i.e. an embedded GPU computing module. The channel module structure in the computing component is as follows: Figure 2As shown, the channel module corresponds to the network input layer, and includes an input layer and an output layer. In the case of the initial water body image input by the input layer being an Ma channel, channel matching is performed, and a 1x1 convolutional layer is used as a channel matcher. A 2D convolutional layer is used to extract spatial features of the initial water body image, and a 1D convolutional layer is used to extract spectral features of the initial water body image. After feature fusion, the output layer outputs a channel water body image of Na channels.

[0069] In summary, the unmanned aerial vehicle is equipped with an image acquisition device and a computing component. When the initial water body image is acquired by the image acquisition device for the target water body, the computing component processes the initial water body image immediately, improves the efficiency of detecting the target water body, and can realize dynamic detection of the target water body.

[0070] Further, the training of the channel module includes: determining a sample water body image and a sample channel water body image corresponding to the sample water body image in a training sample set; inputting the sample water body image into an initial channel module for prediction to obtain a predicted channel water body image; calculating a loss value based on a combined loss function including a structure loss function, a channel loss function and a spectral loss function, the sample channel water body image and the predicted channel water body image; and adjusting the initial channel module based on the loss value until the channel module satisfying a training stop condition is obtained.

[0071] Specifically, the data in the training sample set is used to train the neural network layer in the initial channel module. The initial channel module corresponds to the neural network layer that has not been trained. The structure loss function is used to calculate the structural similarity loss of the initial channel module for image processing. The channel loss function is a channel mapping regularization term, which is responsible for controlling the mean consistency of the adjusted features and the original data. The spectral loss function is used to measure the angle difference of the spectral data before and after mapping to ensure the fidelity of the spectral features. The training stop condition can be that the neural network layer training process reaches a preset number of iterations, the prediction accuracy of the neural network layer reaches an accuracy threshold, or a preset training time is reached. The training stop condition is not limited in this embodiment.

[0072] Based on this, the sample water body image and the sample channel water body image corresponding to the sample water body image are determined in the training sample set; the sample water body image is input into the initial channel module for prediction to obtain a predicted channel water body image. A combined loss function including a structure loss function, a channel loss function and a spectrum loss function is determined. A loss value is calculated based on the combined loss function including the structure loss function, the channel loss function and the spectrum loss function, the sample channel water body image and the predicted channel water body image. The initial channel module is adjusted based on the loss value to obtain an intermediate channel module, and the sample water body image is continuously selected in the training sample to train the intermediate channel module until a channel module meeting a training stop condition is obtained.

[0073] Following the above example, the loss function, i.e., the combined loss function, is set from the three dimensions of spectrum, space and regularization term in the network input layer. The combined loss function is shown in the following formula (2).

[0074]

[0075] Wherein, λ1, λ2 and λ3 represent weights respectively, LSAM represents a spectral angle matching loss, measures the angle difference of spectral data before and after mapping, and ensures the fidelity of spectral features, LSAM = 1 / N∑arccos(||x i i i i i represents the spectral vector of the initial water body image, x^ i represents the spectral vector of the reconstructed image after channel mapping. LSSIM represents a structural similarity loss, which is used to evaluate the spatial structure and texture consistency of the image. LSSIM = 1-SSIM(X,X^), SSIM comprehensively contains the similarity of brightness, contrast and structure information of the original image and the reconstructed image. LMSE represents a channel mapping regularization term, which is responsible for controlling the mean consistency of the features after channel adjustment and the original data. LMSE = 1 / N∑N||x i -x^i||2.

[0076] The network input layer is divided into two-stage training. In the first stage training, λ3 is increased to mainly control LMSE, so as to ensure that the basic statistical characteristics of the image after channel mapping are unchanged. In the second stage training, λ1 and λ2 are increased to mainly control LSAM and LSSIM, and the spectral and spatial features are specifically strengthened.

[0077] In summary, the channel module is trained based on the combined loss function including the structure loss function, the channel loss function and the spectrum loss function, so as to improve the training effect.

[0078] ​​​​Step 104: calling an image processing module to extract initial water body data of the channel water body image, and extracting a corrected target water body image in the channel water body image based on the initial water body data.

[0079] Specifically, after the initial water body image of the target water body is collected and the initial water body image is converted into a channel water body image by the channel module, the image processing module can be called to extract the initial water body data of the channel water body image, and extract the corrected target water body image in the initial water body image based on the initial water body data. The image processing module is a module in the computing component carried by the unmanned aerial vehicle for further image processing of the channel water body image. The initial water body data can be contour data, water quality data, texture feature data, pollution data, and other data representing water body properties of the target water body. The target water body image refers to a water body image obtained by orthorectification of the channel water body data based on the initial water body data. Orthorectification is used to eliminate the influence of the flight attitude of the unmanned aerial vehicle on the collected initial water body image.

[0080] Based on this, after the initial water body image of the target water body is collected and the initial water body image is converted into a channel water body image by the channel module, the image processing module can be called to extract the initial water body data of the target water body in the channel water body image, and extract the water body image in the initial water body image based on the initial water body data. After orthorectification of the extracted water body image, the target water body image can be obtained.

[0081] Further, considering that the target water body has different contours and other characteristics when image collection is performed at different angles, in order to obtain more accurate initial water body data, an image processing module with a multi-layer structure can be used to process the channel water body image, which is implemented as follows:

[0082] Determine that the image processing module includes a feature extraction convolution layer, an attention layer, and an inversion model layer; use the feature extraction convolution layer, the attention layer, and the inversion model layer to extract the initial water body data of the channel water body image.

[0083] Specifically, the feature extraction convolution layer includes multiple convolution layers for feature extraction of the channel water body image; the attention layer includes a channel attention module and a spatial attention module for water body extraction segmentation, water body classification, and water quality parameter regression of the target water body in the channel water body image. The inversion model layer includes a spectral inversion physical model or a semi-empirical model for optimizing water body classification and water quality parameter estimation.

[0084] Based on this, the feature extraction convolutional layer, the attention layer and the inversion model layer contained in the image processing module are determined. The initial water body data of the channel water body image is extracted by using the feature extraction convolutional layer, the attention layer and the inversion model layer. The feature extraction convolutional layer is used to extract features of the channel water body image, the attention layer is used to extract and segment the target water body in the channel water body image, classify the water body and regress the water quality parameters, and the inversion model layer is used to optimize the water body classification and the water quality parameter estimation.

[0085] In the above example, the feature extraction convolutional layer contained in the image processing module corresponds to a shallow feature extraction layer, the shallow feature extraction layer contains a separable convolution and a self-defined convolution, and the separable convolution contains a point convolution kernel and a two-dimensional convolution kernel. The shallow feature extraction layer uses separable convolution Y1=Wp·X, Y2=Wp·X+Wd·Y1. Wherein, Wp represents a point convolution kernel, which extracts cross-channel spectral information. Wd represents a two-dimensional convolution kernel, which performs channel-by-channel image convolution. Y represents the output feature map, that is, the feature map after the separable convolution processing. X represents the input feature map, that is, the water body image data output by the network input layer. Y1 represents the output map after the first point convolution kernel processing of the separable convolution. Y2 represents the output map after the iteration processing of the point convolution kernel and the two-dimensional convolution kernel. The point convolution kernel uses reflectivity R(λ) as the spectral feature for extracting and classifying water bodies. Wherein, R(λ)=Lreflected(λ) / Lincident(λ), Lreflected(λ) represents reflected light intensity. Lincident(λ) represents incident light intensity. Each band reflectivity R(λ) is normalized, R'(λ)=R(λ)-Rmin / Rmax-Rmin, Rmin and Rmax are the minimum and maximum values of the band respectively. The band reflectivity is combined to form a reflectivity vector RS, RS=[R'(λ1), R'(λ2), …, R'(λS)].

[0086] In practical applications, water bodies often have specific texture features, such as smooth-edged river and lake shore shapes, water wave flow texture, etc. In view of this characteristic, a self-defined convolution layer with a fixed partial convolution kernel is added during initialization and training. This convolution layer includes kernel functions such as Hessian matrix, Laplacian operator, Gaussian filter, low-pass and high-pass filter for edge gradient detection of the image to adapt to the feature that the water body edge is relatively smooth; there are also different Gabor filters, which simulate the neuron response in the human visual system, and the kernel function has specific directionality, frequency selectivity and spatial locality to adapt to the feature that water bodies often have water wave flow texture.

[0087] The inversion model layer uses a spectrum inversion physical model or a semi-empirical model under different climate environments to optimize water body classification and water quality parameter estimation. The spectrum inversion physical model or the semi-empirical model often uses a linear relationship of a band ratio, a water body index and the like to invert various pollutant information such as chlorophyll-a concentration, total suspended substance concentration and average particle size value. The existing spectrum inversion physical model or semi-empirical model is used to calculate various pollutant information and input into the network algorithm to update and correct the training result of the previous network algorithm.

[0088] Further, the attention layer includes a channel attention layer and a spatial attention layer; the channel attention layer is configured to generate global feature description data of the channel water body image, and the spatial attention layer is configured to generate spatial attention weight of the channel water body image; and the global feature description data and the spatial attention weight are configured to generate the initial water body data.

[0089] Specifically, the channel attention layer and the spatial attention layer are two parallel attention modules, configured to analyze the channel water body image from two aspects of spectrum and space; the channel attention layer is configured to generate global feature description data, that is, to generate channel weight, to weight the channel, and to filter key spectral channels; and the spatial attention layer is configured to generate spatial attention weight, to weight the spatial dimension in the channel water body image, and to highlight important image parts.

[0090] Based on this, the attention layer includes the channel attention layer and the spatial attention layer. The channel attention layer is configured to generate global feature description data of the channel water body image, and the spatial attention layer is configured to generate spatial attention weight of the channel water body image; and the global feature description data and the spatial attention weight are configured to generate the initial water body data. The channel attention layer realizes global information aggregation of the channel water body image through feature fusion and channel weighting.

[0091] In the above example, the attention layer is an attention mechanism layer, the attention mechanism layer has a channel attention module and a spatial attention module, the two parallel attention modules are still configured to analyze the image from two aspects of spectrum and space. The channel attention module is configured to generate channel weight, to weight the channel, and to filter key spectral channels. The spatial attention module is configured to generate spatial weight, to weight the spatial dimension in the image, and to highlight important image parts.

[0092] The attention module calculation steps: global information aggregation, using global average pooling and global maximum pooling, global random pooling, respectively generating three global feature descriptions: Qavg=AvgPool(Q), Fmax=MaxPool(Q) and Fran=RanPool(Q), feature fusion, generating attention weights through a three-layer fully connected network with shared parameters. Mc=Sig(W3(W2δ(W1Qavg))+Sig(W3(W2δ(W1Qmax))+Sig(W3(W2δ(W1Qran)), where W1, W2, W3 are the weights of the fully connected layers. δ is an activation function (such as ReLU). Sig is the Sigmoid activation function. Mc∈RC×1×1 is the channel attention weight. Channel weighting, the channel of the input feature map is weighted Q'=Mc·Q. The image processing module is the processing layer, which is essentially a multi-task learning network that completes the water extraction segmentation, water classification and water quality parameter regression three tasks. The loss function of learning can be set as L=αLedge+βLclass+γLquality, Ledge adopts a binary cross-entropy loss function. Lclass adopts a weighted classification cross-entropy loss function, w i The weighted classification cross-entropy loss function is shown in the following formula (3).

[0093]

[0094] where N represents the number of samples. w i represents the class weight of the i-th sample, which can adjust the weight for unbalanced samples (such as fewer water type samples). y i represents the actual value (0 or 1) of the i-th sample. represents the predicted value (between 0 and 1) of the i-th sample.

[0095] Further, considering that the initial water body image is collected by a flying unmanned aerial vehicle, the flight of the unmanned aerial vehicle will cause parallax of the initial water body image, therefore, in the process of processing the initial water body image, it is necessary to eliminate the image parallax by orthographic correction, and the specific implementation is as follows:

[0096] Based on the initial water body data, the channel water body image is segmented to obtain an intermediate water body image; based on the angle data, position data collected by the sensor carried by the unmanned aerial vehicle and the device parameters of the image acquisition device, the intermediate water body image is orthographically corrected to obtain the corrected target water body image.

[0097] Specifically, the intermediate water body image refers to water body segmentation of the channel water body image according to the water body contour of the target water body recorded in the initial water body data, to obtain a water body image containing only the target water body. The angle data refers to the pitch angle, yaw angle, roll angle and other angle data collected by the IMU sensor. The position data refers to the longitude, latitude, height and other data representing the image collection position determined by the GPS carried by the unmanned aerial vehicle. The device parameters of the image collection device can be camera parameters, i.e., camera field of view and lens distortion coefficient.

[0098] Based on this, the initial water body image is segmented based on the initial water body data to obtain an intermediate water body image containing a target water body. The intermediate water body image is orthorectified based on the angle data, position data collected by the sensor carried by the unmanned aerial vehicle, and the device parameters of the image collection device to obtain a corrected target water body image.

[0099] Following the above example, the intermediate water body image containing the target water body is subjected to threshold processing to realize the black and white of the intermediate water body image. Considering the performance limitation of the embedded computing platform carried by the unmanned aerial vehicle and the real-time performance of the task, the image orthorectification adopts the geometric projection method. The algorithm requires IMU sensor data (pitch angle, yaw angle, roll angle), GPS data (longitude, latitude, height), and camera parameters (camera field of view and lens distortion coefficient). The geometric projection method calculation formula is as follows: P world =R −1 ·B −1 ·Pimage−R −1T. The correction matrix B is recorded in advance according to the camera parameters, the projection matrix R is calculated according to the IMU sensor attitude angle and height during the task, and the projection can be selected on the plane or on the spherical surface corresponding to the latitude and longitude. T is the projection center, generally selected as the center of the picture and this item is discarded. The water body contour is obtained by simple edge extraction after the black and white image. If the projection plane is a plane, the water body image area is calculated using the polygon area formula. Three basic rotation matrices need to be calculated according to the attitude angle provided by the IMU sensor carried by the unmanned aerial vehicle, corresponding to yaw around the y-axis, pitch around the x-axis and roll around the z-axis. The yaw matrix is R(ψ)=[cosψ,sinψ,0;-sinψ,cosψ,0;0,0,1], the pitch matrix is R(θ)=[1,0,0;0,cosθ,sin-θ;0,sinθ,cosθ], and the roll matrix is R(ϕ)=[cosϕ,-sinϕ,0;sinϕ,cosϕ,0;0,0,1]. ψ, θ and ϕ are yaw angle, pitch angle and roll angle respectively. The total rotation matrix Cnb is R(ψ)·R(θ)1R(ϕ). In addition, the height problem needs to be considered, and the images with different height perspectives are converted to the same height perspective using the perspective transformation matrix. The polygon area formula is shown in the following formula (4).

[0100]

[0101] where A represents the polygon area, n represents the number of vertices of the polygon, (xi, yi) represents the two-dimensional coordinates of the i-th vertex of the polygon, and ni=1, 2, …, n. If the projection plane is a plane, the spherical polygon area formula is used to calculate the water body image area A. A=D2(∑triangular spherical angle area), and D is the radius of the sphere.

[0102] In summary, the orthographic correction of the intermediate water body image is carried out by using the geometric projection method, the image parallax caused by the flight attitude of the unmanned aerial vehicle is eliminated, and the accuracy of detecting the target water body is improved.

[0103] Step 106: determining the historical water body image of the target water body, and obtaining the target water body data of the target water body by comparing the target water body image and the historical water body image.

[0104] Specifically, after the image processing module is called to extract the initial water body data of the channel water body image, and the corrected target water body image is extracted in the initial water body image based on the initial water body data, the historical water body image of the target water body can be determined, and the target water body data of the target water body can be obtained by comparing the target water body image and the historical water body image. The historical water body image can be a water body image collected before the initial water body image for the target water body and processed by the channel module and the image processing module. The target water body data refers to the change data of the target water body, including but not limited to the change data of the outline, water quality, texture characteristics, pollution, etc. of the target water body.

[0105] Based on this, after the image processing module is called to extract the initial water body data of the channel water body image, and the corrected target water body image is extracted in the initial water body image based on the initial water body data, the historical image collected before the initial water body image for the target water body is determined, and the historical water body image is obtained by processing the historical image by the channel module and the image processing module. By comparing the target water body image and the historical water body image, the target water body data of the target water body is generated, indicating the change of the target water body.

[0106] Further, after the target water body image is determined, the change of the target water body can be determined by comparing the target water body image with the historical water body image of the target water body, and the specific implementation is as follows:

[0107] The target water body feature points are extracted in the target water body image, and the target feature point direction information is configured for the target water body feature points. The historical water body feature points are extracted in the historical water body image, and the historical feature point direction information is configured for the historical water body feature points. The target water body feature points and the target feature point direction information of the target water body image are compared with the historical water body feature points and the historical feature point direction information of the historical water body image, and the target water body data of the target water body is obtained.

[0108] Specifically, the target water body feature points can be feature points contained in the target water body image. The target feature point direction information refers to the main direction of the target feature point, which can be calculated by the gray centroid method of the image. The historical water body feature points can be feature points contained in the historical water body image. The historical feature point direction information refers to the main direction of the historical feature point, which can be calculated by the gray centroid method of the image.

[0109] Based on this, the target water feature points are determined by comparing the differences between the center pixel points and the neighborhood pixel points in the target water body image, and the target feature point direction information is configured for the target water feature points by using the gray centroid method. The historical water feature points are determined by comparing the differences between the center pixel points and the neighborhood pixel points in the historical water body image, and the historical feature point direction information is configured for the historical water feature points. The target water feature points and the target feature point direction information of the target water body image are compared with the historical water feature points and the historical feature point direction information of the historical water body image, and the target water data of the target water body is obtained.

[0110] In the above example, considering the limited computing resources of the unmanned aerial vehicle, a relatively mature ORB algorithm is used to complete the matching of the real-time collected image and the historical image. The target water body image and the historical water body image are detected for feature points respectively, and the main direction is configured for the detected feature points. The ORB algorithm uses an improved BRIEF descriptor to describe the local area of the feature points, ensures the rotation invariance, and uses the BRIEF descriptor to match two images. When calculating the descriptor, the information of multiple spectral channels is combined to construct a high-dimensional joint descriptor to adapt to the image data format of the network input layer. If the matching algorithm is successful, the two images are rotated according to the rotation angle of the matched feature points to ensure that the viewing angles of the two images are consistent. Then the consistency of the detection area is verified through the electronic compass or GPS module data. The difference between the current geographic coordinates and the stored data is calculated, and if the distance difference is less than or equal to the threshold value, it is considered that the areas are consistent. The water body change detection part uses a lightweight convolutional neural network to extract local features, and combines a Transformer module to capture global feature relationships, achieving more accurate change detection. In view of the geometric and lighting differences in the two images, an adaptive feature alignment module is introduced to align the features based on the attention mechanism, reducing the errors caused by the environment in the input images. A lightweight convolutional neural network is used to detect changes in the current water image, identifying changes in water quality, water surface contour, and water surface area of the target water body.

[0111] In summary, the target water feature points and the target feature point direction information of the target water body image are compared with the historical water feature points and the historical feature point direction information of the historical water body image, and the target water data of the target water body is obtained. The change of the target water body is accurately detected.

[0112] Further, considering that the target water body image contains many feature points, the target water feature points can be extracted from multiple feature points to achieve lightweight calculation, which is implemented as follows:

[0113] extract a target light water body feature in the target water body image, and determine a target feature point key value pair in a feature point key value pair contained in the target water body image based on the target light water body feature. The target water body feature point in the target water body image is determined based on a target global change feature of the target feature point key value pair.

[0114] Specifically, the feature point key value pair refers to a pixel point key value pair of a center pixel point and a neighborhood pixel point group layer contained in the target water body image. The target feature point key value pair refers to a pair of feature point key value pairs with a brightness difference between the center pixel point and the neighborhood pixel point greater than a brightness difference threshold.

[0115] Based on this, the target light water body feature corresponding to the center pixel point is extracted in the target water body image, and the neighborhood pixel point corresponding to the target light water body feature is determined to form the feature point key value pair contained in the target water body image. The image change value of the feature point key value pair is calculated, and in the case that the image change value is greater than the change threshold, the feature point key value pair is determined as the target feature point key value pair. The target water body feature point in the target water body image is determined based on the target global change feature of the target feature point key value pair.

[0116] Following the above example, given two water body extraction segmented images (target water body image and historical water body image), first extract the features through the light convolution network. F1=ConvNet(O1), F2=ConvNet(O2). Then input into the Transformer module, capture the global change feature of the image through multi-head self-attention. Z1=Transformer(F1'), Z2=Transformer(F2), Z'=Transformer([Z1,Z2]), P=Softmax(E⋅KT / d). E and K are the query value and key pair value extracted from Z'. The image change value is: ΔF=∣Z1−Z2∣+P. In order to better handle the illumination and geometric differences of the input image, an attention mechanism based light field feature alignment module is introduced. U=FlowNet(O1,O2), F1'=Warp(F1,U). O1, O2 are two images without water body extraction. Since the water body change detection task is relatively simple, in order to realize real-time inference on the embedded platform and reduce the consumption of computing resources, a dynamic pruning strategy is introduced to dynamically adjust the network size according to the running state. The weights in the network weight matrix below the pruning threshold are set to zero. During inference, the pruning parameters are adjusted according to the hardware load (power consumption, delay), the threshold is adjusted in real time, the pruning ratio is controlled, and the performance requirements are met.

[0117] In summary, the target water body feature point in the target water body image is determined based on the target global change feature of the target feature point key value pair, and the accurate extraction of the target water body feature point is realized.

[0118] The water body detection method provided by the embodiment of the present specification can realize the collection of the initial water body image and the analysis of the initial water body image by using the unmanned aerial vehicle, and obtain the target water body data of the target water body. The initial water body image is collected for the target water body, and the channel module is called to convert the initial water body image into a channel water body image in the channel dimension. The image processing module is called to extract the initial water body data of the channel water body image, and based on the initial water body data, the corrected target water body image is extracted in the initial water body image, so as to eliminate the influence of the flight attitude of the unmanned aerial vehicle on the collected initial water body image during image collection. The historical water body image of the target water body is determined, and by comparing the target water body image and the historical water body image, the target water body data of the target water body is obtained. The water body change analysis of the target water body is realized, and the flexibility and accuracy of the water body detection are improved.

[0119] The following describes the water body detection method provided by the present specification in combination with the accompanying Figure 3 The water body detection method provided by the present specification is taken as an example of application in the detection of the lake water body, and the water body detection method is further described. Wherein, Figure 3 The processing flowchart of the water body detection method applied in the detection of the lake water body provided by the embodiment of the present specification is shown, and specifically includes the following steps:

[0120] Step 302: An unmanned aerial vehicle carrying an image collection device is used to collect initial water body images in the color dimension and the spectral dimension for the target water body.

[0121] The unmanned aerial vehicle carries the image collection device of color, multispectral or hyperspectral camera, takes the lake as the target water body, hovers near the lake, and collects the initial water body image for the lake.

[0122] Step 304: The channel module contained in the computing component carried by the unmanned aerial vehicle is determined, and the spatial feature extraction and the spectral feature extraction are performed on the initial water body image with the initial channel number by using the channel module.

[0123] The computing component carried by the unmanned aerial vehicle can be an embedded GPU computing module, which contains a network input layer and a processing layer. The network input layer corresponds to the channel module, and the algorithm used in the module is adapted to color, multispectral or hyperspectral images. The network input layer of the module can realize the dynamic normalization of different channel data for the initial water body image. The 1x1 convolution layer is used as a channel matcher, and the input channel number M is converted into a fixed channel number N, followed by a spectral feature extraction layer and a spatial feature extraction layer. The spectral branch uses Conv1D to extract the spectral feature. The spatial branch uses Conv2D to extract the spatial texture.

[0124] Step 306: The extracted spatial feature and spectral feature are fused to obtain a channel water body image with a target channel number.

[0125] A feature fusion layer fuses the spectral features and spatial features in the channel dimension. The network input layer is independently trained from the processing layer, and the loss function is set from the aspects of spectrum, space and regularization term. The network input layer is divided into two stages of training. In the first stage of training, the regularization is mainly used to ensure that the basic statistical characteristics of the image after channel mapping remain unchanged. In the second stage of training, the space and spectrum are mainly used to specifically strengthen the preservation of spectral and spatial features.

[0126] Step 308: The initial water body data of the channel water body image is extracted by the feature extraction convolution layer, the attention layer and the inversion model layer contained in the image processing module.

[0127] The image processing module corresponds to the processing layer, and the processing layer is a three-layer network structure, including a shallow feature extraction layer (feature extraction convolution layer), an attention mechanism layer (attention layer) and a high-level feature extraction layer (inversion model layer).

[0128] The shallow feature extraction layer includes a separable convolution and a self-defined convolution, and the separable convolution includes a point convolution kernel and a two-dimensional convolution kernel. The attention mechanism layer includes a channel attention module and a spatial attention module, and the channel attention module uses global average pooling and global maximum pooling, global random pooling, respectively, to generate three kinds of global feature descriptions. The spatial attention module stacks three feature maps, extracts local information through a convolution layer, and generates spatial attention weights. The high-level feature extraction layer uses a spectrum inversion physical model or a semi-empirical model under different climate environments that have been verified to optimize water body classification and water quality parameter estimation.

[0129] Step 310: Based on the initial water body data, the channel water body image is segmented to obtain an intermediate water body image.

[0130] Step 312: Based on the angle data and position data collected by the sensor carried by the unmanned aerial vehicle and the device parameters of the image acquisition device, the intermediate water body image is orthorectified to obtain a corrected target water body image.

[0131] The water body image segmented by the extracted edge contour of the water body image is subjected to pixel black and white processing, and the water body area is white and the environment area is black. Then, the IMU sensor data and GPS positioning information of the current data frame of the unmanned aerial vehicle are used to orthorectify the image, and the water body area is mapped to a set plane, so that the water body area can be accurately matched with the historical image which has also been orthorectified.

[0132] Step 314: Determine the historical water body image of the target water body, extract the target water body feature points in the target water body image, and configure the target feature point direction information for the target water body feature points, and extract the historical water body feature points in the historical water body image, and configure the historical feature point direction information for the historical water body feature points.

[0133] Step 316: comparing the target water feature points and the target feature point direction information of the target water body image with the historical water feature points and the historical feature point direction information of the target water body image to obtain the target water body data of the target water body.

[0134] In practical applications, the historical water body image and the corresponding geographical coordinates can be recorded in the storage system of the unmanned aerial vehicle. When the unmanned aerial vehicle extracts a water body, a feature matching algorithm is used to match the current data frame image with the stored historical image data. If the image matching is successful, the current electronic compass or GPS form positioning data is used to verify the geographical position to ensure the consistency of the detection area. If the historical data is matched successfully, a light-weight convolutional neural network is used to detect changes in the current water body image to identify changes in water quality, water surface profile, and water surface area.

[0135] In summary, the unmanned aerial vehicle is equipped with a color, multi-spectral or hyperspectral camera, an IMU sensor, and an embedded GPU computing module. The algorithm is adapted to color, multi-spectral or hyperspectral images. Compared with color images, the more image data channels of multi-spectral or hyperspectral images can effectively improve the accuracy of water body recognition and water quality detection. The IMU sensor is mainly used to measure the pitch angle, yaw angle, and roll angle of the unmanned aerial vehicle flight, to perform orthographic correction on the segmented water body image, eliminate image parallax caused by the flight attitude of the unmanned aerial vehicle, and ensure the geometric accuracy during image change detection.

[0136] Corresponding to the method embodiments described above, the present specification also provides water body detection device embodiments, Figure 4 A structure diagram of a water body detection device is shown. As shown in the figure, Figure 4 The device includes:

[0137] The acquisition module 402 is configured to collect an initial water body image for a target water body, and call the channel module to convert the initial water body image into a channel water body image in the channel dimension;

[0138] The extraction module 404 is configured to call the image processing module to extract initial water body data of the channel water body image, and extract a corrected target water body image in the channel water body image based on the initial water body data;

[0139] The comparison module 406 is configured to determine a historical water body image of the target water body, and obtain target water body data of the target water body by comparing the target water body image and the historical water body image.

[0140] An optional embodiment, the acquisition module 402 is further configured to:

[0141] acquire the initial water body image in color dimension and spectral dimension for the target water body by using a drone carrying an image acquisition device;

[0142] determine the channel module contained in the computing component carried by the drone, and perform spatial feature extraction and spectral feature extraction on the initial water body image of the initial channel number by using the channel module;

[0143] fuse the extracted spatial features and spectral features to obtain the channel water body image of the target channel number.

[0144] An optional embodiment, the acquisition module 402 is further configured to:

[0145] determine a sample water body image and a sample channel water body image corresponding to the sample water body image in a training sample set;

[0146] input the sample water body image into an initial channel module for prediction to obtain a predicted channel water body image;

[0147] calculate a loss value based on a combined loss function containing a structure loss function, a channel loss function and a spectral loss function, the sample channel water body image and the predicted channel water body image;

[0148] perform parameter adjustment on the initial channel module based on the loss value until the channel module satisfying a training stop condition is obtained.

[0149] An optional embodiment, the extraction module 404 is further configured to:

[0150] determine a feature extraction convolution layer, an attention layer and an inversion model layer contained in the image processing module;

[0151] extract initial water body data of the channel water body image by using the feature extraction convolution layer, the attention layer and the inversion model layer.

[0152] An optional embodiment, the extraction module 404 is further configured to:

[0153] include a channel attention layer and a spatial attention layer;

[0154] the channel attention layer is used to generate global feature description data of the channel water body image, and the spatial attention layer is used to generate spatial attention weight of the channel water body image;

[0155] the global feature description data and the spatial attention weight are used to generate the initial water body data.

[0156] An optional embodiment, the extraction module 404 is further configured to:

[0157] segment the channel water body image based on the initial water body data to obtain an intermediate water body image;

[0158] orthorectify the intermediate water body image based on angle data and position data collected by the sensor carried by the unmanned aerial vehicle and device parameters of the image collection device to obtain the target water body image.

[0159] An optional embodiment, the comparison module 406 is further configured to:

[0160] extract a target water body feature point in the target water body image and configure target feature point direction information for the target water body feature point;

[0161] extract a historical water body feature point in the historical water body image and configure historical feature point direction information for the historical water body feature point;

[0162] compare the target water body feature point and the target feature point direction information of the target water body image with the historical water body feature point and the historical feature point direction information of the historical water body image to obtain the target water body data of the target water body.

[0163] An optional embodiment, the comparison module 406 is further configured to:

[0164] extract a target lightweight water body feature in the target water body image and determine a target feature point key-value pair in the target water body image based on the target lightweight water body feature;

[0165] determine the target water body feature point in the target water body image based on a target global change feature of the target feature point key-value pair.

[0166] The water body detection device provided by an embodiment of the present specification can use an unmanned aerial vehicle to realize collection of an initial water body image and analysis of the initial water body image, and obtain target water body data of a target water body. An initial water body image is collected for a target water body, and a channel module is called to convert the initial water body image into a channel water body image in a channel dimension. An image processing module is called to extract initial water body data of the channel water body image, and based on the initial water body data, a corrected target water body image is extracted in the initial water body image, so as to eliminate the influence of the flight attitude of the unmanned aerial vehicle on the collected initial water body image when the image is collected. A historical water body image of the target water body is determined, and by comparing the target water body image and the historical water body image, target water body data of the target water body is obtained. Water body change analysis of the target water body is realized, and the flexibility and accuracy of water body detection are improved.

[0167] The above is a schematic scheme of the water body detection device according to the embodiment. It should be noted that the technical scheme of the water body detection device and the technical scheme of the water body detection method described above belong to the same concept, and the details of the technical scheme of the water body detection device that are not described in detail can be referred to the description of the technical scheme of the water body detection method.

[0168] Figure 5 A structural block diagram of a computing device 500 according to an embodiment of the present specification is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 through a bus 530, and a database 550 is used to save data.

[0169] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 can include one or more of any type of network interface (e.g., a network interface card (NIC)), wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and the like.

[0170] In an embodiment of the present specification, the above-mentioned components of the computing device 500 and other components not shown in the Figure 5 may be connected to each other, for example, through a bus. It should be understood that Figure 5 The structural block diagram of the computing device shown is only for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed.

[0171] The computing device 500 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 can also be a mobile or stationary server.

[0172] The processor 520 implements the steps of the water body detection method when executing the computer program or instructions.

[0173] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device belongs to the same concept as the technical scheme of the water body detection method described above, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the water body detection method.

[0174] An embodiment of the present specification also provides a computer readable storage medium storing a computer program or instructions, which, when executed by a processor, implements the steps of the water body detection method as described above.

[0175] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium belongs to the same concept as the technical scheme of the water body detection method described above, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the water body detection method.

[0176] An embodiment of the present specification also provides a computer program product comprising a computer program or instructions, which, when executed by a processor, implements the steps of the water body detection method described above.

[0177] The above is a schematic scheme of the computer program product of the embodiment. It should be noted that the technical scheme of the computer program product belongs to the same concept as the technical scheme of the water body detection method described above, and the details of the technical scheme of the computer program product that are not described in detail can be referred to the description of the technical scheme of the water body detection method.

[0178] The above-described embodiments of the application have several aspects, no single one of which is solely responsible for the application's desirable attributes. Without limiting the scope of the application as expressed by the claims which follow, some further embodiments make these aspects even more useful. Other embodiments can result in less desirable attributes.

[0179] The computer program or programs or instructions can include: a subroutine package, a set of routines, program modules, or the like. The computer program or programs or instructions can include general purpose programs, or specialized applications programs. The computer program or programs or instructions can include general purpose routines or code, business routines, utilities, or the like. The computer readable medium can include any medium, or combination medium, that can carry the computer program or programs or instructions. The computer readable medium can include, but is not limited to, storage media such as magnetic or optical disks, memory such as RAM or ROM, or the like. The computer readable medium can also include carrier waves that include the computer program or programs or instructions, or the like.

[0180] It should be noted that, as described above, for each method embodiment, in order to facilitate the description, it is expressed as a combination of a series of actions, but those skilled in the art should know that the description of the present specification is not limited by the order of the actions described, because according to the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present specification.

[0181] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0182] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. The alternative embodiments do not describe all the details and do not limit the application to the specific embodiments described. Obviously, according to the content of the present specification, many modifications and changes can be made. The present specification selects and describes these embodiments in order to better explain the principles and practical applications of the present specification, so that those skilled in the art can well understand and utilize the present specification. The present specification is limited only by the claims and their full scope and equivalents.

Claims

1. A method for water body detection, characterized in that, The method comprises the following steps: collecting an initial water body image of a target water body, and calling a channel module to convert the initial water body image into a channel water body image in a channel dimension; calling an image processing module to extract initial water body data of the channel water body image, and extracting a corrected target water body image in the channel water body image based on the initial water body data; determining a historical water body image of the target water body, extracting a target water body feature point in the target water body image, and configuring target feature point direction information for the target water body feature point, and extracting a historical water body feature point in the historical water body image, and configuring historical feature point direction information for the historical water body feature point; comparing the target water body feature point and the target feature point direction information with the historical water body feature point and the historical feature point direction information to obtain target water body data of the target water body.

2. The water body detection method of claim 1, wherein, The method comprises the following steps: collecting an initial water body image of a target water body, and calling a channel module to convert the initial water body image into a channel water body image in a channel dimension; collecting the initial water body image in color and spectral dimensions by using a drone carrying an image collection device; determining the channel module included in a computing component carried by the drone, and performing spatial feature extraction and spectral feature extraction on the initial water body image with an initial channel number by using the channel module; 3. The water body detection method of claim 1, wherein, fusing the extracted spatial features and spectral features to obtain the channel water body image with a target channel number. The training of the channel module comprises the following steps: determining a sample water body image and a sample channel water body image corresponding to the sample water body image in a training sample set; inputting the sample water body image into an initial channel module for prediction to obtain a predicted channel water body image; calculating a loss value based on a combined loss function including a structure loss function, a channel loss function and a spectral loss function, the sample channel water body image and the predicted channel water body image; 4. The water body detection method of claim 1, wherein, adjusting the initial channel module based on the loss value until the channel module satisfying a training stop condition is obtained. The method comprises the following steps: determining a feature extraction convolution layer, an attention layer and an inversion model layer included in the image processing module; 5. The water body detection method of claim 4, wherein, extracting the initial water body data of the channel water body image by using the feature extraction convolution layer, the attention layer and the inversion model layer. The attention layer comprises: including a channel attention layer and a spatial attention layer; the channel attention layer is used to generate global feature description data of the channel water body image, and the spatial attention layer is used to generate spatial attention weight of the channel water body image; 6. The water body detection method of claim 2, wherein, the global feature description data and the spatial attention weight are used to generate the initial water body data. The method comprises the following steps: segmenting the channel water body image based on the initial water body data to obtain an intermediate water body image; The intermediate water body image is orthorectified based on angle data and position data collected by sensors carried by the unmanned aerial vehicle and device parameters of the image collection device, to obtain the corrected target water body image.

7. The water body detection method of claim 1, wherein, The target water body feature points are extracted from the target water body image, including: Target lightweight water body features are extracted from the target water body image, and target feature point key-value pairs are determined in the feature point key-value pairs contained in the target water body image based on the target lightweight water body features. The target water body feature points in the target water body image are determined based on target global change features of the target feature point key-value pairs.

8. A water body detection apparatus, characterized by, including: The acquisition module is configured to acquire an initial water body image for a target water body, and call the channel module to convert the initial water body image into a channel water body image in a channel dimension; The extraction module is configured to call the image processing module to extract initial water body data of the channel water body image, and extract a corrected target water body image in the channel water body image based on the initial water body data; The comparison module is configured to determine a historical water body image of the target water body, extract target water body feature points from the target water body image, and configure target feature point direction information for the target water body feature points, and extract historical water body feature points from the historical water body image, and configure historical feature point direction information for the historical water body feature points; The target water body feature points and the target feature point direction information are compared with the historical water body feature points and the historical feature point direction information, to obtain target water body data of the target water body.

9. A computing device comprising a memory, a processor, and a computer program or instructions stored on the memory and executable on the processor, wherein, The processor executes the computer program or instructions to realize the steps of the method of any one of claims 1-7.

10. A computer readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are executed by the processor to realize the steps of the method of any one of claims 1-7.

11. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to realize the steps of the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Unmanned aerial vehicle target detection method and system based on multispectral information fusion

    CN117789062A

  • Natural resource change monitoring system

    CN118129713A