Water body detection method and device
By carrying image acquisition equipment and calculation components on the drone, the water body images are collected and processed, and the problems of limited computing resources and short battery life in water body monitoring are solved, complex water body image analysis and flexible water body detection are realized, and the accuracy and efficiency of detection are improved.
Patent Information
- Application Number
- CN202510218424.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-02-26
AI Technical Summary
In the prior art, drones face problems such as limited computing resources, short battery life, and unfixed heading perspective in water monitoring, resulting in the inability to achieve complex water image analysis and flexible water detection.
By carrying image acquisition equipment and computing components on the drone, the initial water body image is collected and the channel module is called to convert it into the channel water body image in the channel dimension. Then, the image processing module is called to extract the initial water body data, and the corrected target water body image is extracted from the channel water body image based on these data, eliminating the influence of the drone's flight attitude on the image. At the same time, by comparing the target water body image and the historical water body image, the target water body data of the target water body are obtained.
It realizes high-resolution and flexible detection of water bodies, improves the accuracy and efficiency of water bodies detection, and can effectively analyze water body changes.
Smart Images

Figure CN120032284A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a water body detection method and device. Background Art
[0002] With the development of drone technology, drones are increasingly used in environmental monitoring and other fields. In terms of water monitoring, drones can conduct rapid and low-cost remote sensing detection of rivers, lakes and other water bodies. At present, traditional water body change detection mainly relies on satellite remote sensing images, but the spatial resolution and temporal resolution of satellite remote sensing images have certain technical limitations.
[0003] Compared with satellite remote sensing, drones can provide higher-resolution images, respond to water monitoring tasks more flexibly and quickly, and the economic cost of image acquisition is lower. However, in practical applications, drones face problems such as limited computing resources, short flight time, and unstable heading and viewing angle, and still cannot achieve complex water image analysis and flexible water detection. Therefore, a more effective water detection method is urgently needed to solve the above problems. Summary of the invention
[0004] In view of this, the embodiments of this specification provide a water body detection method. This 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 an embodiment of this specification, a water body detection method is provided, comprising: Collecting an initial water body image for the 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; 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; 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 with the historical water body image.
[0006] Optionally, collecting an initial water body image for the 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, includes: Using a drone equipped with an image acquisition device to acquire the initial water body image in color dimension and spectral dimension for the target water body; Determine the channel module included in the computing component carried by the UAV, and use the channel module to perform spatial feature extraction and spectral feature extraction on the initial water body image of the initial number of channels; The extracted spatial features and spectral features are fused to obtain the channel water body image of the target channel number.
[0007] Optionally, the training of the channel module includes: 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; Inputting the sample water body image into the initial channel module for prediction to obtain a predicted channel water body image; Calculate the loss value based on a combined loss function including a structural loss function, a channel loss function and a spectral 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 until the channel module that meets the training stop condition is obtained.
[0008] Optionally, the calling of the image processing module to extract the initial water body data of the channel water body image includes: Determine the feature extraction convolution layer, attention layer and inversion model layer included in the image processing module; The feature extraction convolution layer, the attention layer and the inversion model layer are used to extract initial water body data of the channel water body image.
[0009] Optionally, the attention layer comprises: Includes channel attention layer and 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 the spatial attention weight of the channel water body image; The global feature description data and the spatial attention weight are used to generate the initial water body data.
[0010] Optionally, extracting a corrected target water body image from the channel water body image based on the initial water body data includes: 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 the angle data, position data collected by the sensor carried by the UAV and the equipment parameters of the image acquisition device to obtain the corrected target water body image.
[0011] Optionally, obtaining target water body data of the target water body by comparing the target water body image with the historical water body image includes: Extracting target water body feature points from the target water body image, and configuring target feature point direction information for the target water body feature points; Extracting historical water body feature points from the historical water body image, and configuring 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 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 to obtain the target water body data of the target water body.
[0012] Optionally, extracting target water body feature points from the target water body image includes: Extracting target lightweight water body features from the target water body image, and determining target feature point key-value pairs from 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 the target global change features of the target feature point key-value pairs.
[0013] According to a second aspect of an embodiment of this specification, a water body detection device is provided, comprising: The acquisition module is configured to acquire an initial water body image for the 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; an extraction module configured to call an image processing module to extract initial water body data of the channel water body image, and extract a corrected target water body image from the channel water body image based on the initial water body data; The comparison module is configured to determine the historical water body image of the target water body, and obtain the target water body data of the target water body by comparing the target water body image with the historical water body image.
[0014] According to a third aspect of an embodiment of this specification, a computing device is provided, comprising a memory, a processor, and a computer program or instructions stored in 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.
[0015] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps of the water body detection method are implemented.
[0016] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions, which implement the steps of the above-mentioned water body detection method when executed by a processor.
[0017] The water body detection method provided in an embodiment of the present specification can use a drone to realize the acquisition of an initial water body image and the analysis of the initial water body image, and obtain the target water body data of the target water body. An 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 the corrected target water body image is extracted from the initial water body image based on the initial water body data, eliminating the influence of the drone's flight posture on the collected initial water body image during image acquisition. The historical water body image of the target water body is determined, and the target water body data of the target water body is obtained by comparing the target water body image with the historical water body image. The 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 THE DRAWINGS
[0018] Figure 1 It is a flow chart of a water body detection method provided in an embodiment of this specification; Figure 2 It is a schematic diagram of a channel module of a water body detection method provided in an embodiment of this specification; Figure 3 It is a processing flow chart of a water body detection method applied to lake water body detection provided in an embodiment of this specification; Figure 4 It is a structural schematic diagram of a water body detection device provided in an embodiment of this specification; Figure 5 It is a structural block diagram of a computing device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0019] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0020] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0021] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0022] First, the terms involved in one or more embodiments of this specification are explained.
[0023] IMU (Inertial Measurement Unit): A sensor device used to measure the motion state of an object in three-dimensional space.
[0024] ORB (Oriented FAST and Rotated BRIEF) algorithm: a feature detection algorithm, a fast corner detection algorithm. Its basic idea is to determine whether a pixel is a corner by comparing the brightness difference between a pixel and its surrounding pixels.
[0025] Gabor filter: A two-dimensional filter composed of a Gaussian kernel function modulated by a sinusoidal plane wave in the spatial domain. It combines the characteristics of a sine wave and a Gaussian function, thereby providing good direction selection and scale selection characteristics. Gabor filter is a linear filter widely used in the field of image processing, especially for edge extraction and texture analysis.
[0026] BRIEF (Binary Robust Independent Elementary Features) descriptor: is an image feature description method that uses binary coding to reduce storage requirements and increase computing speed. BRIEF descriptor is a feature description method that represents and describes detected feature points. It generates a binary code string by randomly selecting pixel pairs in the neighborhood of feature points and comparing their grayscale values. This coding method makes BRIEF descriptor efficient and concise.
[0027] In this specification, a water body detection method is provided. This 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.
[0028] Figure 1 A flow chart of a water body detection method provided according to an embodiment of this specification is shown, which specifically includes the following steps: Step 102: collect an initial water body image for the target water body, and call a channel module to convert the initial water body image into a channel water body image in the channel dimension.
[0029] Specifically, the target water body can be a water structure such as a river, lake, or pond. The initial water body image is an image collected by a drone equipped with an image acquisition device for the target water body. The initial water body image includes the water structure and the 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 refers to the image obtained after feature extraction and feature fusion of the initial water body image in the channel dimension.
[0030] Based on this, a drone is used to hover above the target water body to collect the initial water body image. The drone is equipped with a computing component, and the channel module in the computing component is called to extract and fuse the features of the initial water body image, so as to convert the initial water body image into a channel water body image in the channel dimension.
[0031] Furthermore, considering that when using a drone to collect the initial water body image of the target water body, the drone's computing resources are limited and it is impossible to achieve real-time recognition and numerical calculation of the water body image. Therefore, the drone can be equipped with image acquisition equipment and computing components to perform image processing immediately when the initial water body image is obtained. The specific implementation is as follows: The initial water body image of the target water body is collected in the color dimension and the spectral dimension by using a drone equipped with an image acquisition device; the channel module included in the computing component carried by the drone is determined, and the spatial feature extraction and spectral feature extraction of the initial water body image with an initial number of channels are performed by using the channel module; the extracted spatial features and spectral features are fused to obtain the channel water body image with a target number of channels.
[0032] Specifically, the image acquisition device is used to acquire images of the target water body. The image acquisition device can be a color, multi-spectral or hyperspectral camera. The computing component is used to perform image recognition and parameter calculation on the initial water body image acquired by the image acquisition device. The computing component can be an embedded GPU computing module. The initial number of channels refers to the number of channels corresponding to the initial water body image in the color dimension and the spectral dimension respectively. 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 number of channels refers to the number of channels obtained by normalizing the initial water body image in the color dimension and the spectral dimension.
[0033] Based on this, a drone equipped with an image acquisition device is used to collect an initial water body image of the target water body in the color dimension and the spectral dimension. The initial water body image contains color information and spectral information. The channel module contained in the computing component carried by the drone is determined, and the channel module is used to extract spatial features and spectral features of the initial water body image with the initial number of channels. The extracted spatial features and spectral features are fused to obtain the channel water body image with the target number of channels. The dynamic normalization of the channels of the initial water body image in the color dimension and the spectral dimension is realized.
[0034] Channel dynamic normalization can be achieved by the following formula (1).
[0035]
[0036] Among them, F c ′ represents the normalized data of channel c. c Represents the raw data of channel c. c Represents the mean of channel c. σ c Indicates the standard deviation of channel c.
[0037] For example, when detecting water bodies in rivers, drones equipped with color, multispectral or hyperspectral cameras can be used to collect images of rivers to obtain initial water body images, i.e., color, multispectral or hyperspectral images. The drones are also equipped with computing components, i.e., embedded GPU computing modules. The channel module structure in the computing component is as follows: Figure 2 As shown in the figure, the channel module corresponds to the network input layer, which includes the input layer and the output layer. When the initial water body image input by the input layer is the Ma channel, channel matching is performed, and the 1x1 convolution layer is used as the channel matcher. The 2D convolution layer is used to extract the spatial features of the initial water body image, and the 1D convolution layer is used to extract the spectral features of the initial water body image. After feature fusion, the output layer outputs the channel water body image with the number of Na channels.
[0038] To summarize, the UAV is equipped with image acquisition equipment and computing components. When the image acquisition equipment is used to collect the initial water body image of the target water body, the computing component is used to immediately process the initial water body image, thereby improving the efficiency of detecting the target water body and realizing dynamic detection of the target water body.
[0039] Furthermore, 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 the 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 structural 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 parameters of the initial channel module based on the loss value until the channel module that meets the training stop condition is obtained.
[0040] 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 untrained neural network layer. The structural loss function is used to calculate the structural similarity loss of the initial channel module for image processing, and the channel loss function is the channel mapping regularization term, which is responsible for controlling the mean consistency of the features after channel adjustment and the original data. The spectral loss function is used to measure the angular difference of spectral data before and after mapping to ensure the fidelity of spectral features. The training stop condition can be that the preset number of iterative training times is reached during the training of the neural network layer, the prediction accuracy of the neural network layer reaches the accuracy threshold, or the preset training time is reached. This embodiment does not impose any restrictions on the training stop condition.
[0041] 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 the predicted channel water body image. The combined loss function including the structural loss function, the channel loss function and the spectral loss function is determined. The loss value is calculated based on the combined loss function including the structural loss function, the channel loss function and the spectral loss function, the sample channel water body image and the predicted channel water body image. The parameters of the initial channel module are adjusted based on the loss value to obtain the 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 that meets the training stop condition is obtained.
[0042] Using the above example, the network input layer sets the loss function from three dimensions: spectrum, space, and regularization term, i.e., the combined loss function. The combined loss function is shown in the following formula (2).
[0043]
[0044] Among them, λ1, λ2, and λ3 represent weights respectively, LSAM represents the spectral angle matching loss, which measures the angle difference of spectral data before and after mapping to ensure the fidelity of spectral features. LSAM=1 / N∑arccos(||x i ·x^ i || / ||x i ||||x^i ||),x i Represents the spectral vector of the initial water image, x^ i Represents the spectral vector of the reconstructed image after channel mapping. LSSIM represents the structural similarity loss, which is used to evaluate the spatial structure and texture consistency of the image. LSSIM=1−SSIM(X,X^), SSIM comprehensively includes the similarity of the brightness, contrast and structure of the original image and the reconstructed image. LMSE represents the 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.
[0045] The network input layer is trained in two stages. In the first stage, LMSE is used to increase λ3 to ensure that the basic statistical characteristics of the image remain unchanged after channel mapping. In the second stage, LSAM and LSSIM are used to increase λ1 and λ2 to strengthen the retention of spectral and spatial features.
[0046] In summary, the channel module is trained based on the combined loss function including the structural loss function, the channel loss function and the spectral loss function to improve the training effect.
[0047] 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 from the channel water body image based on the initial water body data.
[0048] Specifically, after 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 can be called to extract the initial water body data of the channel water body image, and the corrected target water body image is extracted from the initial water body image based on the initial water body data, wherein the image processing module is a module in the computing component carried by the drone for continuing to perform image processing on the channel water body image. The initial water body data can be the contour data, water quality data, texture feature data, pollution data, and other data representing the water body properties of the target water body. The target water body image refers to a water body image obtained by orthorectifying the channel water body data based on the initial water body data. The orthorectification is used to eliminate the influence of the drone's flight posture on the collected initial water body image during image acquisition.
[0049] Based on this, after collecting the initial water body image for the target water body and calling the channel module 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 such as the outline, water quality, and texture of the target water body in the channel water body image, and extract the water body image from the initial water body image based on the initial water body data. After orthorectifying the extracted water body image, the target water body image can be obtained.
[0050] Furthermore, considering that when collecting images of the target water body at different angles, the collected target water body has different features such as contours, 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 specifically implemented as follows: Determine the feature extraction convolution layer, the attention layer and the inversion model layer included in the image processing module; and extract the initial water body data of the channel water body image using the feature extraction convolution layer, the attention layer and the inversion model layer.
[0051] Specifically, the feature extraction convolution layer includes multiple layers of convolution, which is used to extract features from channel water images; the attention layer includes a channel attention module and a spatial attention module, which are used to extract and segment the target water body in the channel water image, classify the water body, and regress the water quality parameters. The inversion model layer includes a spectral inversion physical model or a semi-empirical model, which is used to optimize water body classification and water quality parameter estimation.
[0052] Based on this, the feature extraction convolution layer, attention layer and inversion model layer included in the image processing module are determined. The feature extraction convolution layer, attention layer and inversion model layer are used to extract the initial water body data of the channel water body image. The feature extraction convolution 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, the water body classification and water quality parameter regression are performed, and the inversion model layer is used to optimize the water body classification and water quality parameter estimation.
[0053] Using the above example, the feature extraction convolution layer included in the image processing module corresponds to the shallow feature extraction layer. The shallow feature extraction layer includes separable convolution and custom convolution. The separable convolution includes point convolution kernel and two-dimensional convolution kernel. The shallow feature extraction layer uses separable convolution Y1=Wp·X, Y2=Wp·X+Wd·Y1. Among them, Wp represents the point convolution kernel, which extracts cross-channel spectral information. Wd represents the 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 separable convolution point convolution kernel processing. Y2 represents the output map after iterative processing using the point convolution kernel and the two-dimensional convolution kernel. The point convolution kernel uses reflectance R(λ) as the spectral feature to extract and classify the water body. Among them, R(λ)=Lreflected(λ) / Lincident(λ), Lreflected(λ) represents the reflected light intensity. Lincident(λ) represents the incident light intensity. The reflectance R(λ) of each band is normalized, R′(λ)=R(λ)−Rmin / Rmax−Rmin, where Rmin and Rmax are the minimum and maximum values of the band, respectively. The reflectance of the bands is combined to form a reflectance vector RS, RS=[R′(λ1), R′(λ2),…, R′(λS)].
[0054] In practical applications, water bodies often have specific texture features, such as the shape of riverbanks and lakeshores with smooth edges, and the texture of water waves and fluidity. To address this feature, a custom convolution layer with a fixed convolution kernel is added during initial training. This convolution layer includes kernel functions such as Hessian matrix, Laplace operator, Gaussian filter, low-pass and high-pass filter for edge gradient detection of images to adapt to the feature that the edges of water bodies are relatively smooth; there are also different Gabor filters. The Gabor filter simulates the neuronal response in the human visual system, and its kernel function has specific directionality, frequency selectivity, and spatial locality to adapt to the feature that water bodies often have water waves and fluidity textures.
[0055] The inversion model layer uses a certain verified spectral inversion physical model or semi-empirical model under different climate environments to optimize water body classification and water quality parameter estimation. Spectral inversion physical model or semi-empirical model often uses the linear relationship of band ratio, water body index and other indicators to invert various pollutant information such as chlorophyll-a concentration, total suspended solids concentration, average particle size value, etc. Use the existing spectral inversion physical model or semi-empirical model to calculate various pollutant information and input it into the network algorithm to update and correct the previous training results of the network algorithm.
[0056] Furthermore, the attention layer includes: 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 weights of the channel water body image; the global feature description data and the spatial attention weights are used to generate the initial water body data.
[0057] Specifically, the channel attention layer and the spatial attention layer are two parallel attention modules, which are used to analyze the channel water body image from the spectral and spatial perspectives. The channel attention layer is used to generate global feature description data, that is, to generate channel weights, weight the channels, and screen key spectral channels. The spatial attention layer is responsible for generating spatial attention weights, weighting the spatial dimensions in the channel water body image, and highlighting important image parts.
[0058] Based on this, the attention layer includes 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 the spatial attention weight of the channel water body image; the global feature description data and the spatial attention weight are used to generate the initial water body data. The channel attention layer realizes the global information aggregation of the channel water body image through feature fusion and channel weighting.
[0059] Using the above example, the attention layer is the attention mechanism layer. The attention mechanism layer has a channel attention module and a spatial attention module. The two parallel attention modules still analyze the image from the spectral and spatial perspectives. The channel attention module is responsible for generating channel weights, weighting the channels, and screening key spectral channels. The spatial attention module is responsible for generating spatial weights, weighting the spatial dimensions in the image, and highlighting important image parts.
[0060] The calculation steps of the attention module are as follows: 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 layer. δ is the activation function (such as ReLU). Sig is the Sigmoid activation function. Mc∈RC×1×1 is the channel attention weight. Channel weighting, the channel weighting Q′=Mc·Q of the input feature map. The image processing module is the processing layer. The processing layer is essentially a multi-task learning network that completes the three tasks of water body extraction and segmentation, water body classification, and water quality parameter regression. The learning loss function can be set to L=αLedge+βLclass+γLquality, Ledge uses the binary cross entropy loss function. Lclass uses the weighted classification cross entropy loss function, w i The weighted classification cross entropy loss function is shown in the following formula (3).
[0061]
[0062] Where N is the number of samples. i Represents the category weight of the i-th sample, and the weight can be adjusted for unbalanced samples (such as fewer water body type samples). i Represents the actual value (0 or 1) of the i-th sample. Represents the predicted value of the i-th sample (between 0 and 1).
[0063] Furthermore, considering that the initial water body image is collected by a flying drone, the flight of the drone 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 through orthorectification. The specific implementation is as follows: The channel water body image is segmented based on the initial water body data to obtain an intermediate water body image; the intermediate water body image is orthorectified based on the angle data, position data collected by the sensor carried by the UAV and the equipment parameters of the image acquisition device to obtain the corrected target water body image.
[0064] Specifically, the intermediate water body image refers to the 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, and the water body image obtained only contains the target water body. Angle data refers to the angle data such as pitch angle, yaw angle, roll angle, etc. collected by the IMU sensor. Position data refers to the longitude and latitude, altitude, etc. determined by the GPS carried by the drone to represent the image acquisition location. The device parameters of the image acquisition device can be camera parameters, that is, the camera field of view angle and lens distortion coefficient.
[0065] 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 the target water body. Based on the angle data, position data collected by the sensor carried by the drone and the equipment parameters of the image acquisition device, the intermediate water body image is orthorectified using the geometric projection method to obtain the corrected target water body image.
[0066] Using the above example, threshold processing is performed on the intermediate water body image containing the target water body to achieve black and white conversion of the intermediate water body image. Considering the performance limitations of the embedded computing platform carried by the drone and the real-time nature 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 (latitude and longitude, altitude), and camera parameters (camera field of view angle and lens distortion coefficient). The calculation formula of the geometric projection method is as follows: P world =R −1 ·B −1 Pimage−R −1·T. The correction matrix B is entered in advance according to the camera parameters. When executing the task, the projection matrix R is calculated according to the attitude angle and height of the IMU sensor, and it can be projected onto a plane or onto a sphere of corresponding longitude and latitude. T is the projection center, which is generally selected as the center of the picture and discarded. The black and white image is used to obtain the water body contour through simple edge extraction. If the projection surface is a plane, the polygon area formula is used to calculate the water body image area. It is necessary to calculate three basic rotation matrices based on the attitude angles provided by the IMU sensor on the drone, corresponding to the yaw around the y-axis, the pitch around the x-axis, and the 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 the yaw angle, pitch angle, and roll angle, respectively. The total rotation matrix Cnb=R(ψ)·R(θ)1R(ϕ). In addition, the height issue must be taken into account, and images from different height perspectives are converted to images from the same height perspective using the perspective transformation matrix. The polygon area formula is shown in the following formula (4).
[0067]
[0068] Where A represents the area of the polygon, n represents the number of vertices of the polygon, (xi,yi) represents the two-dimensional coordinates of the ith vertex of the polygon, where ni=1,2,…,n. If the projection surface is a plane, the spherical polygon area formula is used to calculate the water body image area A. A=D2(∑triangulated spherical angular area), where D is the radius of the sphere.
[0069] In summary, the geometric projection method is used to orthorectify the intermediate water body image, eliminate the image parallax caused by the flight attitude of the UAV, and improve the accuracy of detecting the target water body.
[0070] Step 106: 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 with the historical water body image.
[0071] Specifically, after the above-mentioned calling of the image processing module to extract the initial water body data of the channel water body image, and extracting the corrected target water body image 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 with the historical water body image, wherein the historical water body image can be the water body image collected for the target water body before the initial water body image 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 contour, water quality, texture characteristics, pollution and other dimensions of the target water body.
[0072] Based on this, after the above-mentioned calling of the image processing module to extract the initial water body data of the channel water body image, and extracting the corrected target water body image 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 channel module and the image processing module are used to process the historical image to obtain the historical water body image. By performing feature comparison between the target water body image and the historical water body image, the target water body data of the target water body is generated to indicate the change of the target water body.
[0073] Furthermore, 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, which is specifically implemented as follows: 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; 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; 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.
[0074] Specifically, the target water body feature point may be a feature point included 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 grayscale centroid method of the image. The historical water body feature point may be a feature point included 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 grayscale centroid method of the image.
[0075] Based on this, the target water body feature points are determined by comparing the difference between the central pixel and the neighboring pixel points in the target water body image, and the target feature point direction information is configured for the target water body feature points using the grayscale centroid method. The historical water body feature points are determined by comparing the difference between the central pixel and the neighboring pixel points 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 to obtain the target water body data of the target water body.
[0076] Following the above example, considering the limited computing resources of the drone, the more mature ORB algorithm is used to complete the matching of the real-time collected image and the historical image. Feature point detection is performed on the target water body image and the historical water body image respectively, and the main direction is configured for the detected feature points. The ORB algorithm uses the improved BRIEF descriptor to describe the local area of the feature point, ensuring rotation invariance and matching the two images using the BRIEF descriptor. 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 matches successfully, the two images are rotated according to the rotation angle of the matched feature point to ensure that the perspectives of the two images are consistent. After that, 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. If the distance difference is ≤ the threshold, the area is considered to be consistent. The water body change detection part uses a lightweight convolutional neural network to extract local features, and combines the Transformer module to capture global feature relationships to achieve more accurate change detection. In view of the geometric and illumination differences between the two images, an adaptive feature alignment module is introduced to perform feature alignment based on the attention mechanism to reduce the error of the input image caused by the environment. A lightweight convolutional neural network is used to detect changes in the current water body image to identify changes in the water quality, water surface contour, and water surface area of the target water body.
[0077] In summary, the target water body feature points and target feature point direction information of the target water body image are compared with the historical water body feature points and historical feature point direction information of the historical water body image to obtain the target water body data of the target water body, thereby realizing accurate detection of the change of the target water body.
[0078] Furthermore, considering that the target water body image contains many feature points, the target water body feature points can be extracted from multiple feature points to achieve lightweight calculation. The specific implementation is as follows: Extracting target light water features from the target water image, and determining target feature point key-value pairs from feature point key-value pairs contained in the target water image based on the target light water features. Determining the target water feature points in the target water image based on target global change features of the target feature point key-value pairs.
[0079] Specifically, the feature point key-value pair refers to the pixel key-value pair of the central pixel and the neighboring pixel 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 whose brightness difference between the central pixel and the neighboring pixel is greater than the brightness difference threshold.
[0080] Based on this, the target light water body feature corresponding to the central pixel point is extracted from the target water body image, and the neighborhood pixel points corresponding to the target light water body feature are determined to form the feature point key-value pairs contained in the target water body image, and the image change value of the feature point key-value pairs is calculated. When the image change value is greater than the change threshold, the feature point key-value pairs are determined to be target feature point key-value pairs. The target water body feature points in the target water body image are determined based on the target global change features of the target feature point key-value pairs.
[0081] Continuing with the above example, given two images after water body extraction and segmentation (target water body image and historical water body image), first extract features through a lightweight convolutional network. F1=ConvNet(O1), F2=ConvNet(O2). Then send it to the Transformer module to capture the global change features 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 by Z′ respectively. The image change value is: ΔF=|Z1−Z2|+P. In order to better handle the illumination and geometric differences of the input images, a light field feature alignment module based on the attention mechanism is introduced. U=FlowNet(O1,O2), F1′=Warp(F1,U). O1 and O2 are two images without water body extraction. Since the task of water body change detection is relatively simple, in order to achieve real-time reasoning on embedded platforms and reduce computing resource consumption, a dynamic pruning strategy is introduced to dynamically adjust the network size according to the operating status. The weights below the pruning threshold in the network weight matrix are reset to zero. During reasoning, the pruning parameters are adjusted according to the hardware load (power consumption, latency), the threshold is adjusted in real time, and the pruning ratio is controlled to meet performance requirements.
[0082] In summary, the target water body feature points in the target water body image are determined based on the target global change features of the target feature point key-value pairs, so as to achieve accurate extraction of the target water body feature points.
[0083] The water body detection method provided in an embodiment of the present specification can use a drone to realize the acquisition of an initial water body image and the analysis of the initial water body image, and obtain the target water body data of the target water body. An 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 the corrected target water body image is extracted from the initial water body image based on the initial water body data, eliminating the influence of the drone's flight posture on the collected initial water body image during image acquisition. The historical water body image of the target water body is determined, and the target water body data of the target water body is obtained by comparing the target water body image with the historical water body image. The water body change analysis of the target water body is realized, and the flexibility and accuracy of water body detection are improved.
[0084] The following combination Figure 3 Taking the application of the water body detection method provided in this specification in lake water body detection as an example, the water body detection method is further described. Figure 3 A processing flow chart of a water body detection method applied to lake water body detection provided by an embodiment of this specification is shown, which specifically includes the following steps: Step 302: using a drone equipped with an image acquisition device to acquire an initial water body image of the target water body in the color dimension and the spectral dimension.
[0085] The drone is equipped with a color, multispectral or hyperspectral camera as an image acquisition device. It takes the lake as the target water body, hovers near the lake, and collects initial water body images of the lake.
[0086] Step 304: determine the channel module included in the computing component carried by the UAV, and use the channel module to perform spatial feature extraction and spectral feature extraction on the initial water body image with the initial number of channels.
[0087] The computing component carried by the drone can be an embedded GPU computing module, which includes a network input layer and a processing layer. The network input layer corresponds to the channel module, and the algorithm used by this module is adapted to color, multispectral or hyperspectral images. The network input layer of this module can realize dynamic normalization of different channel data for the initial water body image. The 1x1 convolution layer acts as a channel matcher, and any input channel number M is converted to a fixed channel number N. It is followed by a spectral feature extraction layer and a spatial feature extraction layer. The spectral branch uses Conv1D to extract spectral features. The spatial branch uses Conv2D to extract spatial textures.
[0088] Step 306: Fusing the extracted spatial features and spectral features to obtain a channel water body image with a target number of channels.
[0089] The feature fusion layer fuses the spectral features and spatial features in the channel dimension. The network input layer is trained independently from the processing layer, and the loss function is set from three aspects: spectrum, space, and regularization. The network input layer is divided into two stages of training. The first stage of training focuses on regularization to ensure that the basic statistical characteristics of the image remain unchanged after channel mapping. The second stage of training focuses on space and spectrum, and specifically strengthens the retention of spectral and spatial features.
[0090] Step 308: Utilize the feature extraction convolution layer, attention layer and inversion model layer included in the image processing module to extract the initial water body data of the channel water body image.
[0091] The image processing module corresponds to the processing layer, which has 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).
[0092] Among them, the shallow feature extraction layer includes separable convolution and custom convolution. Separable convolution includes point convolution kernel and two-dimensional convolution kernel. The attention mechanism layer includes channel attention module and spatial attention module. The channel attention module uses global average pooling, global maximum pooling and global random pooling to generate three global feature descriptions respectively. 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 spectral inversion physical model or semi-empirical model that has been verified under different climate environments to optimize water body classification and water quality parameter estimation.
[0093] Step 310: Segment the channel water body image based on the initial water body data to obtain an intermediate water body image.
[0094] Step 312: orthorectify the intermediate water body image based on the angle data, position data collected by the sensor carried by the UAV and the equipment parameters of the image acquisition device to obtain a corrected target water body image.
[0095] The water body image is segmented using the edge contour of the extracted water body image, and the pixels are black and white, with the water area being white and the environment area being black. Then, the image is orthorectified using the IMU sensor data and GPS positioning information of the current data frame of the drone, and the water area is mapped to the set plane to ensure accurate matching with the historical image that has also been orthorectified.
[0096] 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.
[0097] Step 316: Compare the target water body feature points and target feature point direction information of the target water body image with the historical water body feature points and historical feature point direction information of the target water body image to obtain target water body data of the target water body.
[0098] In practical applications, historical water body images and corresponding geographic coordinates can be entered into the drone storage system. When the drone extracts a water body, the feature matching algorithm is used to match the current data frame image with the stored historical image data. If the image matches successfully, the current electronic compass or GPS positioning data is used to verify the geographic location to ensure the consistency of the detection area. If the match with the historical data is successful, a lightweight convolutional neural network is used to detect changes in the current water body image to identify changes in water quality, water surface contours, and water surface area.
[0099] In summary, the drone is equipped with color, multispectral or hyperspectral cameras, IMU sensors, and embedded GPU computing modules. The algorithm is adapted to color, multispectral or hyperspectral images. Compared with color images, the more image data channels of multispectral or hyperspectral images can effectively improve the accuracy of the algorithm's 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 drone's flight, and is used to perform orthorectification on the extracted and segmented water body images, eliminate the image parallax caused by the drone's flight posture, and ensure the geometric accuracy of image change detection.
[0100] Corresponding to the above method embodiment, this specification also provides a water body detection device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of a water body detection device provided in an embodiment of this specification. Figure 4 As shown, the device comprises: The acquisition module 402 is configured to acquire an initial water body image for the 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; The extraction module 404 is configured to call the image processing module to extract the initial water body data of the channel water body image, and extract the corrected target water body image in the channel water body image based on the initial water body data; The comparison module 406 is configured to determine the historical water body image of the target water body, and obtain the target water body data of the target water body by comparing the target water body image with the historical water body image.
[0101] In an optional embodiment, the acquisition module 402 is further configured to: Using a drone equipped with an image acquisition device to acquire the initial water body image in color dimension and spectral dimension for the target water body; Determine the channel module included in the computing component carried by the UAV, and use the channel module to perform spatial feature extraction and spectral feature extraction on the initial water body image of the initial number of channels; The extracted spatial features and spectral features are fused to obtain the channel water body image of the target channel number.
[0102] In an optional embodiment, the acquisition module 402 is further configured to: 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; Inputting the sample water body image into the initial channel module for prediction to obtain a predicted channel water body image; Calculate the loss value based on a combined loss function including a structural loss function, a channel loss function and a spectral 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 until the channel module that meets the training stop condition is obtained.
[0103] In an optional embodiment, the extraction module 404 is further configured to: Determine the feature extraction convolution layer, attention layer and inversion model layer included in the image processing module; The feature extraction convolution layer, the attention layer and the inversion model layer are used to extract initial water body data of the channel water body image.
[0104] In an optional embodiment, the extraction module 404 is further configured to: Includes channel attention layer and 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 the spatial attention weight of the channel water body image; The global feature description data and the spatial attention weight are used to generate the initial water body data.
[0105] In an optional embodiment, the extraction module 404 is further configured to: 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 the angle data, position data collected by the sensor carried by the UAV and the equipment parameters of the image acquisition device to obtain the corrected target water body image.
[0106] In an optional embodiment, the comparison module 406 is further configured to: Extracting target water body feature points from the target water body image, and configuring target feature point direction information for the target water body feature points; Extracting historical water body feature points from the historical water body image, and configuring 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 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 to obtain the target water body data of the target water body.
[0107] In an optional embodiment, the comparison module 406 is further configured to: Extracting target lightweight water body features from the target water body image, and determining target feature point key-value pairs from 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 the target global change features of the target feature point key-value pairs.
[0108] The water body detection device provided in an embodiment of the present specification can use a drone to collect and analyze the initial water body image to obtain the target water body data of the target water body. Collect the initial water body image for the 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. Call the image processing module to extract the initial water body data of the channel water body image, and extract the corrected target water body image from the initial water body image based on the initial water body data, eliminating the influence of the drone's flight posture on the collected initial water body image during image acquisition. Determine the historical water body image of the target water body, and obtain the target water body data of the target water body by comparing the target water body image with the historical water body image. Implement water body change analysis of the target water body and improve the flexibility and accuracy of water body detection.
[0109] The above is a schematic scheme of a water body detection device of this 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 are of the same concept, and the details not described in detail in the technical scheme of the water body detection device can be referred to the description of the technical scheme of the water body detection method described above.
[0110] Figure 5 The structure block diagram of a computing device 500 provided 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 via a bus 530, and the database 550 is used to store data.
[0111] The computing device 500 also includes an access device 540 that 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 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide 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.
[0112] In one embodiment of the present specification, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0113] The computing device 500 may 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 smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 may also be a mobile or stationary server.
[0114] The processor 520 implements the steps of the water body detection method when executing the computer program or instruction.
[0115] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the water body detection method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the water body detection method described above.
[0116] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program or instruction, which implements the steps of the water body detection method as described above when executed by a processor.
[0117] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the water body detection method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the water body detection method described above.
[0118] An embodiment of the present specification also provides a computer program product, including a computer program or instructions, which implement the steps of the above-mentioned water body detection method when executed by a processor.
[0119] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the water body detection method described above are of the same concept, and the details not described in detail in the technical scheme of the computer program product can be found in the description of the technical scheme of the water body detection method described above.
[0120] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0121] The computer program or instruction includes a computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0122] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that this specification is not limited by the order of the actions described, because according to this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this specification.
[0123] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0124] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A water body detection method, characterized in that: include: Collecting an initial water body image for the 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; 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; 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 with the historical water body image.
2. The water body detection method according to claim 1, characterized in that: The step of 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 includes: Using a drone equipped with an image acquisition device to acquire the initial water body image in color dimension and spectral dimension for the target water body; Determine the channel module included in the computing component carried by the UAV, and use the channel module to perform spatial feature extraction and spectral feature extraction on the initial water body image of the initial number of channels; The extracted spatial features and spectral features are fused to obtain the channel water body image of the target channel number.
3. The water body detection method according to claim 1, characterized in that: The training of the channel module includes: 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; Inputting the sample water body image into the initial channel module for prediction to obtain a predicted channel water body image; Calculate the loss value based on a combined loss function including a structural loss function, a channel loss function and a spectral 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 until the channel module that meets the training stop condition is obtained.
4. The water body detection method according to claim 1, characterized in that: The calling of the image processing module to extract the initial water body data of the channel water body image includes: Determine the feature extraction convolution layer, attention layer and inversion model layer included in the image processing module; The feature extraction convolution layer, the attention layer and the inversion model layer are used to extract initial water body data of the channel water body image.
5. The water body detection method according to claim 4, characterized in that: The attention layer comprises: Includes channel attention layer and 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 the spatial attention weight of the channel water body image; The global feature description data and the spatial attention weight are used to generate the initial water body data.
6. The water body detection method according to claim 2, characterized in that: The step of extracting a corrected target water body image from the channel water body image based on the initial water body data comprises: 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 the angle data, position data collected by the sensor carried by the UAV and the equipment parameters of the image acquisition device to obtain the corrected target water body image.
7. The water body detection method according to claim 1, characterized in that: The step of obtaining target water body data of the target water body by comparing the target water body image with the historical water body image includes: Extracting target water body feature points from the target water body image, and configuring target feature point direction information for the target water body feature points; Extracting historical water body feature points from the historical water body image, and configuring 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 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 to obtain the target water body data of the target water body.
8. The water body detection method according to claim 7, characterized in that: Extracting the target water body feature points from the target water body image includes: Extracting target lightweight water body features from the target water body image, and determining target feature point key-value pairs from 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 the target global change features of the target feature point key-value pairs.
9. A water body detection device, characterized in that: include: The acquisition module is configured to acquire an initial water body image for the 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; an extraction module configured to call an image processing module to extract initial water body data of the channel water body image, and extract a corrected target water body image from the channel water body image based on the initial water body data; The comparison module is configured to determine the historical water body image of the target water body, and obtain the target water body data of the target water body by comparing the target water body image with the historical water body image.
10. A computing device comprising a memory, a processor, and a computer program or instruction stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program or instructions, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium storing a computer program or instruction, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Water body identification method and device, water body change detection method and device, equipment and medium
CN112102288A
Unmanned aerial vehicle hyperspectral remote sensing image farmland utilization change detection method and system based on multi-scale difference depth feature fusion
CN115909112A
Hyperspectral image classification method and device and electronic equipment
CN116595208A
River water body recognition method based on deep learning, electronic equipment and storage medium
CN117392539A
Unmanned aerial vehicle target detection method and system based on multispectral information fusion
CN117789062A