Water area monitoring method based on image processing and related device
By processing the spectral images of water monitoring points, analyzing the water polluted areas and predicting their diffusion conditions, the problems of strong subjectivity and lack of pollution diffusion prediction in existing water monitoring technologies are solved, and an efficient and reliable water monitoring and early warning system is achieved.
Patent Information
- Application Number
- CN202510232950.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-27
AI Technical Summary
The existing water monitoring technology has problems such as strong subjectivity, large errors and cumbersome operations, and lacks the ability to predict the spread of water polluted areas, making it difficult to comprehensively analyze the changes in water pollution and issue early warning information in a timely manner.
The water pollution coefficient is generated to determine whether early warning information is required by correcting and processing the spectral images obtained by monitoring points in each monitoring point in the target water area, feature extraction, water pollution area analysis, pollution area diffusion prediction and water quality analysis.
It improves the reliability of water monitoring and early warning judgment, can respond to changes in the water environment in a timely manner, comprehensively analyze water pollution, and improves the efficiency and accuracy of water monitoring.
Smart Images

Figure CN120219696A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to a water area monitoring method and related device based on image processing. Background Art
[0002] With the rapid advancement of the modernization process, the impact of human activities on the surrounding water environment has been increasing, and the resulting water environment problems have also received more and more attention. In order to better monitor the water quality of water areas in real time, it is necessary to carry out monitoring work on water areas in order to timely discover water environment problems. Traditional water area monitoring judges the water area situation by visually observing the changes in water area monitoring images manually, but this method has problems such as strong subjectivity, large errors, and cumbersome operations. In this regard, in recent years, spectral image analysis based on machine vision has been gradually adopted to judge the water area situation. However, in the current judgment of the water area situation, there is a lack of prediction of the spread of water pollution areas, resulting in difficulty in comprehensively analyzing the changes in water pollution and being unable to issue early warning information in a timely manner. At the same time, water quality analysis based on water quality inversion is an important part of water area monitoring. The lack of water quality inversion will make it difficult to monitor the water quality of water areas and accurately master the water quality status. Currently, quantitative inversion methods are usually used for water quality analysis, but this method requires considering too many factors, resulting in excessive consumption of computing resources and being unable to ensure the stability and efficiency of water quality analysis, resulting in the failure of water area monitoring to achieve the expected effect. Summary of the Invention
[0003] The purpose of the present invention is to overcome the deficiencies of the prior art. The present invention provides a water area monitoring method and related device based on image processing, which can improve the reliability of water area monitoring early warning judgment, so as to be able to respond to changes in the water environment in a timely manner.
[0004] In order to solve the above technical problems, the present invention provides a water area monitoring method based on image processing. The method includes:
[0005] Performing calibration processing on the spectral images obtained at each monitoring point in the target water area to obtain the calibrated spectral images of each monitoring point;
[0006] Performing feature extraction based on the calibrated spectral images to obtain corresponding feature data;
[0007] Performing water pollution area analysis on each monitoring point based on the feature data combined with the spectral curve difference to obtain water pollution area data;
[0008] Performing pollution area spread prediction based on the water pollution area data to obtain pollution area spread prediction data;
[0009] Performing water quality analysis based on the feature data using a water quality inversion model to obtain corresponding water quality parameters;
[0010] Generate a water area pollution coefficient based on the water area pollution region data, the pollution region diffusion prediction data, and the water quality parameters, and determine whether to issue a warning message based on the water area pollution coefficient.
[0011] Optionally, the correcting the spectral images obtained at each monitoring point in the target water area to obtain the corrected spectral images of each monitoring point includes:
[0012] Perform Gaussian surface fitting on each spectral image to obtain a fitting surface;
[0013] Perform vignetting correction on each spectral image based on the fitting surface to obtain each vignetting-corrected spectral image;
[0014] Perform non-uniform correction on each vignetting-corrected spectral image to obtain each corrected spectral image.
[0015] Optionally, the extracting features based on the corrected spectral images to obtain corresponding feature data includes:
[0016] Perform pixel neighborhood selection on the corrected spectral images based on the spectral angle distance to obtain a pixel neighborhood set;
[0017] Perform spectral image feature extraction using the pixel neighborhood set based on the manifold reconstruction preserving embedding algorithm to obtain spectral image feature data;
[0018] Perform wavelength variable analysis on the corrected spectral images based on successive projections to obtain wavelength variable data, and generate corresponding feature data based on the spectral image feature data and the wavelength variable data.
[0019] Optionally, the analyzing the water area pollution region of each monitoring point based on the feature data in combination with the spectral curve difference to obtain water area pollution region data includes:
[0020] Perform a pollution region possibility assessment based on the reflectance difference and the peak data difference of the spectral curves in the corrected spectral images to obtain pollution region possibility assessment data;
[0021] Perform color band analysis based on the feature data to obtain color band data;
[0022] Perform water area pollution region analysis based on the color band data and the pollution region possibility assessment data to obtain water area pollution region data.
[0023] Optionally, the predicting the pollution region diffusion based on the water area pollution region data to obtain pollution region diffusion prediction data includes:
[0024] Extract the center point of the polluted area and the data of the edge of the polluted area based on the water area pollution area data;
[0025] Predict the pollution diffusion direction based on the center point of the polluted area and the data of the edge of the polluted area combined with the water flow direction of the water area, and obtain the pollution diffusion direction prediction data;
[0026] Predict the diffusion range of the polluted area based on the water area pollution area data combined with the water flow velocity of the water area and the pollution diffusion direction prediction data, and obtain the pollution area diffusion range prediction data. The pollution area diffusion range prediction includes regional migration prediction, regional dispersion prediction and regional attenuation prediction;
[0027] Generate the pollution area diffusion prediction data based on the pollution diffusion direction prediction data and the pollution area diffusion range prediction data.
[0028] Optionally, the water quality inversion model uses the characteristic data to perform water quality analysis and obtain the corresponding water quality parameters, including:
[0029] Construct a data set based on the water quality index parameters and spectral data of different water samples;
[0030] Construct an objective function based on the least squares method, and generate a regression coefficient set based on the objective function combined with the iterative method;
[0031] Construct an initial water quality inversion model based on the linear regression model, and train the initial water quality inversion model based on the data set and the regression coefficient set to obtain a trained water quality inversion model;
[0032] Obtain the relationship curve between the water quality parameters and the characteristic data based on the trained water quality inversion model, and perform water quality analysis based on the relationship curve to obtain the corresponding water quality parameters.
[0033] Optionally, generate a water area pollution coefficient based on the water area pollution area data, the pollution area diffusion prediction data and the water quality parameters, and determine whether to issue a warning message based on the water area pollution coefficient, including:
[0034] Calculate the pollution coefficient based on the water area pollution area data, the pollution area diffusion prediction data and the water quality parameters to obtain the corresponding water area pollution coefficient;
[0035] Calculate the difference between the water area pollution coefficient and the preset coefficient threshold. If the difference between the water area pollution coefficient and the preset coefficient threshold is greater than or equal to the preset allowable deviation, issue a warning message.
[0036] In addition, the present invention also provides a water area monitoring device based on image processing. The device includes:
[0037] Image correction module: It is used to correct the spectral images obtained at each monitoring point in the target water area, and obtain the corrected spectral images of each monitoring point;
[0038] Feature extraction module: It is used to extract features based on the corrected spectral images and obtain corresponding feature data;
[0039] Water area pollution region analysis module: It is used to analyze the water area pollution regions of each monitoring point based on the feature data in combination with the spectral curve differences, and obtain water area pollution region data;
[0040] Pollution region diffusion prediction module: It is used to predict the diffusion of the pollution region based on the water area pollution region data and obtain pollution region diffusion prediction data;
[0041] Water quality analysis module: It is used to analyze the water quality based on the water quality inversion model using the feature data and obtain corresponding water quality parameters;
[0042] Early warning judgment module: It is used to generate a water area pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data and water quality parameters, and judge whether an early warning message needs to be sent based on the water area pollution coefficient.
[0043] In addition, the present invention also provides an electronic device, which includes a processor and a memory. The memory is used to store instructions, and the processor is used to call the instructions in the memory so that the electronic device executes the above-mentioned water area monitoring method based on image processing.
[0044] In addition, the present invention also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions run on an electronic device, the electronic device is enabled to execute the above-mentioned water area monitoring method based on image processing.
[0045] In the embodiments of the present invention, the manifold reconstruction-based embedding algorithm for spectral image feature extraction uses the set of neighboring pixels to extract spectral image features, and the wavelength variable analysis of the corrected spectral image is performed based on successive projections to obtain wavelength variable data. The combination of the two makes the generated feature data more comprehensive and improves the accuracy of water pollution area analysis. The water pollution area analysis of each monitoring point based on the feature data combined with the spectral curve difference can improve the accuracy of the pollution area analysis without affecting the analysis efficiency of the pollution area. The prediction of the spread of the pollution area based on the water pollution area data introduces the prediction of the spread of the pollution area, which can more comprehensively analyze the changes in water pollution. The water quality analysis is performed using the feature data based on the trained water quality inversion model obtained by training the initial water quality inversion model with the data set and the regression coefficient set, avoiding excessive consumption of computing resources and ensuring the efficiency and stability of the water quality analysis. The water pollution coefficient is generated based on the water pollution area data, the pollution area spread prediction data, and the water quality parameters to determine whether a warning message needs to be issued, improving the reliability of the water area monitoring and warning judgment, so as to be able to respond to the changes in the water environment in a timely manner and achieve a more ideal effect of water area monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0047] Figure 1 is a schematic flowchart of the water area monitoring method based on image processing in the embodiments of the present invention;
[0048] Figure 2 is a schematic flowchart of the water area monitoring method based on image processing in another embodiment of the present invention;
[0049] Figure 3 is a schematic diagram of the structural composition of the water area monitoring device based on image processing in the embodiments of the present invention;
[0050] Figure 4 is a schematic diagram of the structural composition of the electronic device in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0052] Embodiment 1
[0053] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the water area monitoring method based on image processing in the embodiments of the present invention. The method includes:
[0054] S11: Perform calibration processing on the spectral images obtained at each monitoring point in the target water area to obtain the calibrated spectral images of each monitoring point;
[0055] In the specific implementation process of the present invention, the performing calibration processing on the spectral images obtained at each monitoring point in the target water area to obtain the calibrated spectral images of each monitoring point includes: performing Gaussian surface fitting on each spectral image to obtain a fitting surface; performing vignetting correction on each spectral image based on the fitting surface to obtain each vignetting-corrected spectral image; performing non-uniform correction on each vignetting-corrected spectral image to obtain each calibrated spectral image.
[0056] Specifically, a spectral camera is carried by an intelligent unmanned boat to collect spectral images of the target water area at each monitoring point in the target water area, and the spectral images corresponding to each monitoring point are obtained. Gaussian surface fitting is performed on each spectral image, the optimal coefficients of Gaussian surface fitting are determined according to the genetic algorithm, and the pixel values of all regions of each spectral image are subjected to Gaussian surface fitting according to the optimal coefficients to obtain a fitting surface. Based on the fitting surface, vignetting correction is performed on each spectral image. The vignetting correction coefficient of each pixel point in the spectral image is calculated according to the fitting surface, and the vignetting correction coefficient is multiplied by the pixel value of each pixel point in the spectral image to obtain the corrected pixel point, and finally each vignetting-corrected spectral image is obtained. Non-uniform correction is performed on each vignetting-corrected spectral image. Each scan line of each band of the vignetting-corrected spectral image is sorted in ascending order according to the brightness values of the pixels in different spatial dimensions, at least one dark uniform region and one bright uniform region in the spatial dimension are selected to obtain the correction coefficients of each pixel in the spatial dimension, and non-uniform correction is performed according to the correction coefficients in combination with the spectral dimension characteristics to obtain each calibrated spectral image.
[0057] S12: Perform feature extraction based on the calibrated spectral images to obtain corresponding feature data;
[0058] In the specific implementation process of the present invention, the feature extraction is performed on the corrected spectral image to obtain corresponding feature data, including: performing pixel neighborhood selection on the corrected spectral image based on the spectral angle distance to obtain a pixel neighborhood set; performing spectral image feature extraction on the pixel neighborhood set by using the manifold reconstruction preserving embedding algorithm to obtain spectral image feature data; performing wavelength variable analysis on the corrected spectral image based on sequential projections to obtain wavelength variable data, and generating corresponding feature data based on the spectral image feature data and the wavelength variable data.
[0059] Specifically, for pixel neighborhood selection on the corrected spectral image based on the spectral angle distance, a pixel is randomly selected in the corrected spectral image. Taking the selected pixel as the center, a square neighborhood with a preset length around it is used as the neighborhood space. In the neighborhood space, the spectral angle distance and the spatial-spectral combined distance between the selected pixel and other pixels are calculated. The spectral angle distance and the spatial-spectral combined distance between the selected pixel and other pixels are sorted from small to large. Several pixels that simultaneously satisfy both the spectral angle distance and the spatial-spectral combined distance being relatively small are used as the neighborhood set of the selected pixel. Repeating the above process, the neighborhood sets of multiple selected pixels are obtained, that is, the pixel neighborhood set is obtained. For spectral image feature extraction using the pixel neighborhood set by the manifold reconstruction preserving embedding algorithm, the minimum reconstruction error is minimized in the pixel neighborhood set according to the manifold reconstruction preserving embedding algorithm to obtain the reconstruction weights. A projection matrix is constructed according to the reconstruction weights of each pixel, and a spectral image feature matrix is constructed based on the projection matrix and the pixel matrix of the corrected spectral image, that is, the spectral image feature data is obtained. The spectral image feature data obtained in this way can reduce the error caused by the spectral uncertainty phenomenon. For wavelength variable analysis on the corrected spectral image based on sequential projections, starting from one wavelength in the corrected spectral image, the projection of this wavelength on the remaining other wavelengths is calculated, and the wavelength variable with the largest projection vector is added to the wavelength combination. The process is cycled until a preset number of times is reached, and a wavelength combination containing several wavelength variables is obtained, that is, the wavelength variable data is obtained, and corresponding feature data is generated based on the spectral image feature data and the wavelength variable data.
[0060] S13: Analyze the water pollution areas of each monitoring point based on the feature data combined with the spectral curve differences to obtain water pollution area data;
[0061] In the specific implementation process of the present invention, the analysis of the water pollution area of each monitoring point based on the combination of the characteristic data and the spectral curve difference to obtain the water pollution area data includes: evaluating the possibility of the pollution area based on the reflectivity difference and the peak data difference of the spectral curve in the corrected spectral image to obtain the pollution area possibility evaluation data; performing color band analysis based on the characteristic data to obtain the color band data; and performing water pollution area analysis based on the color band data and the pollution area possibility evaluation data to obtain the water pollution area data.
[0062] Specifically, evaluating the possibility of the pollution area based on the reflectivity difference and the peak data difference of the spectral curve in the corrected spectral image, calculating the water anomaly degree corresponding to each pixel point according to the reflectivity difference and the peak number difference of the spectral curve, calculating the average anomaly degree in the corrected spectral image according to the water anomaly degree corresponding to each pixel point, and calculating the pollution area possibility evaluation value corresponding to each pixel point according to the maximum value of the water anomaly degree and the average anomaly degree, that is, obtaining the pollution area possibility evaluation data. Performing color band analysis based on the characteristic data, matching the spectral image characteristic data in the characteristic data with the preset spectral image characteristic template to obtain the corresponding color band area, and obtaining the color band data. Performing water pollution area analysis based on the color band data and the pollution area possibility evaluation data, taking the pixel points with the pollution area possibility evaluation value greater than or equal to the preset threshold as the pixel points of the pollution area, forming the range of the pollution area in this way, and combining the pollution type corresponding to the color band area, and the two are combined to form the water pollution area data.
[0063] S14: Predicting the spread of the pollution area based on the water pollution area data to obtain the pollution area spread prediction data;
[0064] In the specific implementation process of the present invention, the prediction of the spread of the pollution area based on the water pollution area data to obtain the pollution area spread prediction data includes: extracting the pollution area center point and the pollution area edge data based on the water pollution area data; predicting the pollution spread direction based on the pollution area center point and the pollution area edge data in combination with the water body flow direction of the water area to obtain the pollution spread direction prediction data; predicting the spread range of the pollution area based on the water pollution area data in combination with the water body flow velocity and the pollution spread direction prediction data to obtain the pollution area spread range prediction data, and the pollution area spread range prediction includes regional migration prediction, regional dispersion prediction and regional attenuation prediction; and generating the pollution area spread prediction data based on the pollution spread direction prediction data and the pollution area spread range prediction data.
[0065] Specifically, based on the water area pollution region data, the center point of the pollution region and the pollution region edge data are extracted. Based on the center point of the pollution region and the pollution region edge data, combined with the water body flow direction of the water area, the pollution diffusion direction is predicted. According to the center point of the pollution region and the pollution region edge data, the boundary contour of the pollution region is determined. According to the region with the most pixel points in the pollution region within the boundary contour and the water body flow direction of the water area, the pollution diffusion direction is predicted to obtain pollution diffusion direction prediction data. Based on the water area pollution region data, combined with the water body flow velocity and the pollution diffusion direction prediction data, the pollution region diffusion range is predicted to obtain pollution region diffusion range prediction data. The pollution region diffusion range prediction includes regional migration prediction, regional dispersion prediction, and regional attenuation prediction. The regional migration prediction performs grid division on the pollution region according to the water area pollution region data to obtain a number of grids. According to the water body flow velocity and the pollution diffusion direction prediction, the grid migration distance is predicted to obtain grid migration distance prediction data. The grid migration distance data of each grid are integrated to obtain the migration process prediction data of the pollution region. According to the pollution type corresponding to the color band in the water area pollution region data, the pollution type of each grid is determined. According to the pollution type, the pollutant concentration of each grid is determined. According to the pollutant concentration of every two adjacent grids, the pollution region dispersion prediction along the pollution diffusion prediction direction is performed according to the preset simulation time step to obtain the pollution region dispersion process prediction data. According to the pollutant concentration of each grid, combined with the decay constant, the pollution region attenuation prediction is performed to obtain the pollution region attenuation prediction data. The pollution region diffusion range prediction data is composed of the migration process prediction data, the pollution region dispersion process prediction data, and the pollution region attenuation prediction data. The pollution diffusion process is predicted from three aspects, so that its diffusion range can be predicted more accurately. Based on the pollution diffusion direction prediction data and the pollution region diffusion range prediction data, the pollution region diffusion prediction data is generated, so that more comprehensive pollution region diffusion prediction data can be obtained.
[0066] S15: Based on the water quality inversion model, use the characteristic data to perform water quality analysis to obtain corresponding water quality parameters;
[0067] In the specific implementation process of the present invention, the step of using the characteristic data to perform water quality analysis based on the water quality inversion model to obtain corresponding water quality parameters includes: constructing a data set based on the water quality index parameters and spectral data of different water samples; constructing an objective function based on the least squares method, and generating a regression coefficient set based on the objective function combined with the iterative method; constructing an initial water quality inversion model based on the linear regression model, and training the initial water quality inversion model based on the data set and the regression coefficient set to obtain a trained water quality inversion model; obtaining the relationship curve between the water quality parameters and the characteristic data based on the trained water quality inversion model, and performing water quality analysis based on the relationship curve to obtain corresponding water quality parameters.
[0068] Specifically, a data set is constructed based on water quality index parameters and spectral data of different water samples. The water quality index parameters may include at least one of water quality indexes such as water temperature, pH value, turbidity, total hardness, ammonia nitrogen, nitrate, total phosphorus, heavy metal ions, and chlorophyll. The spectral data includes spectral values, pixel color components, quantities, etc. of different spectral bands of the spectral image. A target function is constructed based on the least squares method, and a regression coefficient set is generated based on the target function in combination with the iterative method, that is, the target function is solved by the iterative method to obtain the regression coefficient set. An initial water quality inversion model is constructed based on the linear regression model, and the initial water quality inversion model is trained based on the data set and the regression coefficient set to obtain a trained water quality inversion model. The relationship curve between water quality parameters and characteristic data is obtained based on the trained water quality inversion model, and water quality analysis is performed based on the relationship curve. The characteristic data is matched in the relationship curve to obtain the corresponding water quality parameters.
[0069] S16: Generate a water area pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data, and water quality parameters, and determine whether to issue a warning message based on the water area pollution coefficient.
[0070] In the specific implementation process of the present invention, the generating a water area pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data, and water quality parameters, and determining whether to issue a warning message based on the water area pollution coefficient includes: calculating a pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data, and water quality parameters to obtain the corresponding water area pollution coefficient; calculating the difference between the water area pollution coefficient and a preset coefficient threshold. If the difference between the water area pollution coefficient and the preset coefficient threshold is greater than or equal to a preset allowable deviation, a warning message is issued.
[0071] Specifically, calculate the pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data, and water quality parameters. Match the corresponding pollution degree coefficients according to the water area pollution region data, pollution region diffusion prediction data, and water quality parameters, and perform the final pollution coefficient calculation in combination with the corresponding weights to obtain the corresponding water area pollution coefficient. Calculate the difference between the water area pollution coefficient and the preset coefficient threshold. If the difference between the water area pollution coefficient and the preset coefficient threshold is greater than or equal to the preset allowable deviation, a warning message is issued. If the difference between the water area pollution coefficient and the preset coefficient threshold is less than the preset allowable deviation, continue to monitor each monitoring point of the target water area.
[0072] In the embodiment of the present invention, the manifold reconstruction-based embedding algorithm for maintaining spectral image features extracts spectral image features by using the pixel neighborhood set, and performs wavelength variable analysis on the corrected spectral image based on successive projections to obtain wavelength variable data. The combination of the two makes the generated feature data more comprehensive and improves the accuracy of water pollution area analysis. Analyzing the water pollution area of each monitoring point based on the feature data combined with the spectral curve difference can improve the accuracy of pollution area analysis without affecting the analysis efficiency of the pollution area. Predicting the spread of the pollution area based on the water pollution area data introduces the prediction of the pollution area spread, enabling a more comprehensive analysis of the changes in water pollution. Using the feature data for water quality analysis based on the trained water quality inversion model obtained by training the initial water quality inversion model with a dataset and a regression coefficient set avoids occupying too much computing resources and ensures the efficiency and stability of water quality analysis. Generating a water pollution coefficient based on the water pollution area data, the pollution area spread prediction data, and water quality parameters to determine whether to issue a warning message improves the reliability of water monitoring warning judgment, enabling timely response to changes in the water environment and achieving a more ideal effect of water monitoring.
[0073] Embodiment 2
[0074] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a water monitoring method based on image processing in another embodiment of the present invention. The method includes:
[0075] S201: Perform correction processing on the spectral images obtained at each monitoring point in the target water area to obtain the corrected spectral images of each monitoring point;
[0076] In the specific implementation process of the present invention, a spectral camera is carried by an intelligent unmanned boat to collect spectral images of the target water area at each monitoring point in the target water area, obtaining the spectral images corresponding to each monitoring point. Gaussian surface fitting is performed on each spectral image, the optimal coefficients of Gaussian surface fitting are determined according to the genetic algorithm, and the pixel values of all regions of each spectral image are subjected to Gaussian surface fitting according to the optimal coefficients to obtain a fitting surface. Based on the fitting surface, vignetting correction is performed on each spectral image. The vignetting correction coefficient of each pixel point in the spectral image is calculated according to the fitting surface, and the vignetting correction coefficient is multiplied by the pixel value of each pixel point in the spectral image to obtain the corrected pixel point, and finally the vignetting-corrected spectral images are obtained. Non-uniform correction is performed on each vignetting-corrected spectral image. Each scan line of each band of the vignetting-corrected spectral image is sorted in ascending order according to the brightness values of the pixels in different spatial dimensions, at least one dark uniform region and one bright uniform region in the spatial dimension are selected to obtain the correction coefficients of the pixels in each spatial dimension, and non-uniform correction is performed according to the correction coefficients combined with the spectral dimension features to obtain the corrected spectral images of each monitoring point.
[0077] S202: Extract features from the corrected spectral image to obtain corresponding feature data;
[0078] In the specific implementation process of the present invention, based on the spectral angle distance, pixel neighborhood selection is performed on the corrected spectral image. A pixel is randomly selected in the corrected spectral image. Taking the selected pixel as the center, a square neighborhood with a preset length around it is used as the neighborhood space. In the neighborhood space, calculate the spectral angle distance and the spectral-spatial joint distance between the selected pixel and other pixels. Sort the spectral angle distance and the spectral-spatial joint distance between the selected pixel and other pixels from small to large. Select several pixels that simultaneously satisfy both the spectral angle distance and the spectral-spatial joint distance being relatively small as the neighborhood set of the selected pixel. Repeat the above process to obtain the neighborhood sets of multiple selected pixels, that is, obtain the pixel neighborhood set. Based on the manifold reconstruction preserving embedding algorithm, use the pixel neighborhood set for spectral image feature extraction. Minimize the reconstruction error in the pixel neighborhood set according to the manifold reconstruction preserving embedding algorithm to obtain the reconstruction weights. Construct a projection matrix according to the reconstruction weights of each pixel. Construct a spectral image feature matrix according to the projection matrix and the pixel matrix of the corrected spectral image, that is, obtain the spectral image feature data. The spectral image feature data obtained in this way can reduce the error caused by the spectral uncertainty phenomenon. Based on successive projections, perform wavelength variable analysis on the corrected spectral image. Starting from one wavelength in the corrected spectral image, calculate the projection of this wavelength on the remaining other wavelengths. Add the wavelength variable with the largest projection vector to the wavelength combination. Repeat the process until the preset number of times is reached to obtain a wavelength combination containing several wavelength variables, that is, obtain the wavelength variable data, and generate corresponding feature data based on the spectral image feature data and the wavelength variable data.
[0079] S203: Analyze the water pollution areas at each monitoring point based on the feature data combined with the spectral curve differences to obtain water pollution area data;
[0080] In the specific implementation process of the present invention, the possibility of the polluted area is evaluated based on the reflectance difference and the peak data difference of the spectral curves in the corrected spectral image. The water anomaly degree corresponding to each pixel point is calculated according to the reflectance difference and the peak number difference of the spectral curves. The average value of the anomaly degree in the corrected spectral image is calculated according to the water anomaly degree corresponding to each pixel point. The possibility evaluation value of the polluted area corresponding to each pixel point is calculated according to the maximum value of the water anomaly degree and the average value of the anomaly degree, that is, the possibility evaluation data of the polluted area is obtained. Color band analysis is performed based on the feature data. The spectral image feature data in the feature data is matched with the preset spectral image feature template to obtain the corresponding color band area, and the color band data is obtained. Watershed pollution area analysis is performed based on the color band data and the possibility evaluation data of the polluted area. The pixel points with the possibility evaluation value of the polluted area greater than or equal to the preset threshold are used as the pixel points of the polluted area, and the range of the polluted area is formed in this way. Combining with the pollution type corresponding to the color band area, the two are combined to form the watershed pollution area data.
[0081] S204: Extract the center point of the polluted area and the edge data of the polluted area based on the watershed pollution area data;
[0082] S205: Predict the pollution diffusion direction based on the center point of the polluted area and the edge data of the polluted area in combination with the water body flow direction of the water area, and obtain the pollution diffusion direction prediction data;
[0083] In the specific implementation process of the present invention, the pollution diffusion direction is predicted based on the center point of the polluted area and the edge data of the polluted area in combination with the water body flow direction of the water area. The boundary contour of the polluted area is determined according to the center point of the polluted area and the edge data of the polluted area. The pollution diffusion direction is predicted according to the area with the most pixel points of the polluted area within the boundary contour and the water body flow direction of the water area, and the pollution diffusion direction prediction data is obtained.
[0084] S206: Predict the diffusion range of the polluted area based on the watershed pollution area data in combination with the water body flow velocity of the water area and the pollution diffusion direction prediction data, and obtain the pollution area diffusion range prediction data. The pollution area diffusion range prediction includes area migration prediction, area dispersion prediction and area attenuation prediction;
[0085] In the specific implementation process of the present invention, based on the water area pollution region data, combined with the water flow velocity of the water area and the pollution diffusion direction prediction data, the pollution region diffusion range prediction is carried out to obtain the pollution region diffusion range prediction data. The pollution region diffusion range prediction includes regional migration prediction, regional dispersion prediction, and regional attenuation prediction. The regional migration prediction performs grid division of the pollution region according to the water area pollution region data to obtain a number of grids, predicts the grid migration distance according to the water flow velocity of the water area and the pollution diffusion direction prediction to obtain the grid migration distance prediction data, integrates the grid migration distance data of each grid to obtain the migration process prediction data of the pollution region, determines the pollution type of each grid according to the pollution type corresponding to the color band in the water area pollution region data, determines the pollutant concentration of each grid according to the pollution type, and performs the pollution region dispersion prediction along the pollution diffusion prediction direction according to the pollutant concentration of every two adjacent grids at a preset simulation time step to obtain the pollution region dispersion process prediction data. The pollution region attenuation prediction is carried out according to the pollutant concentration of each grid combined with the decay constant to obtain the pollution region attenuation prediction data. The pollution region diffusion range prediction data is composed of the migration process prediction data, the pollution region dispersion process prediction data, and the pollution region attenuation prediction data. The prediction of the pollution diffusion process is carried out from three aspects, so that the diffusion range can be predicted more accurately.
[0086] S207: Generate pollution region diffusion prediction data based on the pollution diffusion direction prediction data and the pollution region diffusion range prediction data;
[0087] S208: Perform water quality analysis using the characteristic data based on the water quality inversion model to obtain the corresponding water quality parameters;
[0088] In the specific implementation process of the present invention, a data set is constructed based on the water quality index parameters and spectral data of different water samples. The water quality index parameters may include at least one of water quality indexes such as water temperature, pH value, turbidity, total hardness, ammonia nitrogen, nitrate, total phosphorus, heavy metal ions, and chlorophyll. The spectral data includes spectral values, pixel color components, quantities, etc. of different spectral bands of the spectral image. A target function is constructed based on the least squares method, and a regression coefficient set is generated based on the target function combined with the iterative method, that is, the target function is solved by the iterative method to obtain the regression coefficient set. An initial water quality inversion model is constructed based on the linear regression model, and the initial water quality inversion model is trained based on the data set and the regression coefficient set to obtain a trained water quality inversion model. The relationship curve between the water quality parameters and the characteristic data is obtained based on the trained water quality inversion model, and water quality analysis is carried out based on the relationship curve. The characteristic data is matched in the relationship curve to obtain the corresponding water quality parameters.
[0089] S209: Generate a water area pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data, and water quality parameters, and determine whether to send a warning message based on the water area pollution coefficient.
[0090] In the specific implementation process of the present invention, calculate the pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data, and water quality parameters, match the corresponding pollution degree coefficients according to the water area pollution region data, pollution region diffusion prediction data, and water quality parameters, and perform the final pollution coefficient calculation in combination with the corresponding weights to obtain the corresponding water area pollution coefficient. Calculate the difference between the water area pollution coefficient and the preset coefficient threshold. If the difference between the water area pollution coefficient and the preset coefficient threshold is greater than or equal to the preset allowable deviation, send a warning message. If the difference between the water area pollution coefficient and the preset coefficient threshold is less than the preset allowable deviation, continue to monitor each monitoring point of the target water area.
[0091] In the embodiment of the present invention, the manifold reconstruction preserving embedding algorithm is used to extract spectral image features by using the pixel neighborhood set, and the wavelength variable analysis is performed on the corrected spectral image based on successive projections to obtain wavelength variable data. The combination of the two makes the generated feature data more comprehensive and improves the accuracy of water area pollution region analysis. Based on the feature data and the spectral curve difference, the water area pollution region analysis of each monitoring point is performed, which can improve the accuracy of pollution region analysis without affecting the pollution region analysis efficiency. Based on the water area pollution region data, the pollution region diffusion prediction is introduced, which can more comprehensively analyze the changes in water area pollution. Based on the trained water quality inversion model obtained by training the initial water quality inversion model with the data set and the regression coefficient set, the feature data is used for water quality analysis, which avoids occupying too much computing resources and ensures the efficiency and stability of water quality analysis. Generating a water area pollution coefficient based on the water area pollution region data, pollution region diffusion prediction data, and water quality parameters to determine whether to send a warning message improves the reliability of water area monitoring warning judgment, so as to be able to respond to the changes in the water area environment in a timely manner and make the water area monitoring achieve a more ideal effect.
[0092] Embodiment III
[0093] Please refer to Figure 3 , Figure 3 which is a schematic structural composition diagram of the water area monitoring device based on image processing in the embodiment of the present invention. The device includes:
[0094] Image correction module 31: used to perform correction processing on the spectral images obtained at each monitoring point in the target water area to obtain the corrected spectral images of each monitoring point;
[0095] Feature extraction module 32: used to perform feature extraction based on the corrected spectral images to obtain the corresponding feature data;
[0096] Water pollution area analysis module 33: used to analyze the water pollution area of each monitoring point based on the characteristic data combined with the spectral curve difference, and obtain water pollution area data;
[0097] Pollution area diffusion prediction module 34: used to predict the pollution area diffusion based on the water pollution area data, and obtain pollution area diffusion prediction data;
[0098] Water quality analysis module 35: used to analyze the water quality based on the water quality inversion model using the characteristic data, and obtain the corresponding water quality parameters;
[0099] Early warning judgment module 36: used to generate a water pollution coefficient based on the water pollution area data, pollution area diffusion prediction data and water quality parameters, and judge whether it is necessary to send out an early warning message based on the water pollution coefficient.
[0100] In the specific implementation process of the present invention, the specific implementation manner of the device item can refer to the implementation manner of the above method item, and will not be elaborated here.
[0101] In the embodiment of the present invention, the spectral image features are extracted based on the manifold reconstruction preserving embedding algorithm using the pixel neighbor set, and the wavelength variable analysis is performed on the corrected spectral image based on the successive projections to obtain wavelength variable data. The combination of the two makes the generated characteristic data more comprehensive and improves the accuracy of the water pollution area analysis. Analyzing the water pollution area of each monitoring point based on the characteristic data combined with the spectral curve difference can improve the accuracy of the pollution area analysis without affecting the analysis efficiency of the pollution area. Predicting the pollution area diffusion based on the water pollution area data introduces the pollution area diffusion prediction, which can analyze the change of water pollution more comprehensively. Analyzing the water quality based on the trained water quality inversion model obtained by training the initial water quality inversion model with the data set and the regression coefficient set using the characteristic data can avoid occupying too much computing resources and ensure the efficiency and stability of the water quality analysis. Generating a water pollution coefficient based on the water pollution area data, pollution area diffusion prediction data and water quality parameters to judge whether it is necessary to send out an early warning message improves the reliability of the water area monitoring early warning judgment, so as to be able to respond to the changes of the water area environment in time and make the water area monitoring reach a more ideal effect.
[0102] A computer-readable storage medium provided by an embodiment of the present invention, on which a computer program is stored, and when the program is executed by a processor, it implements the water area monitoring method based on image processing in any one of the above embodiments. Among them, the computer-readable storage medium includes, but is not limited to, any type of disk (including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic cards or optical cards. That is, the storage device includes any medium that can store or transmit information in a readable form by a device (such as a computer, mobile phone), and can be a read-only memory, a magnetic disk or an optical disk, etc.
[0103] Embodiment 4
[0104] Please refer to Figure 4 , Figure 4 which is a schematic diagram of the structural composition of the electronic device in the embodiment of the present invention.
[0105] The embodiment of the present invention also provides an electronic device, as Figure 4 shown, the electronic device includes a memory 41, a processor 43, and a computer program 42 stored in the memory 41 and executable on the processor 43. Those skilled in the art can understand, Figure 3The illustrated electronic device does not constitute a limitation on all devices, and may include more or fewer components than shown, or combine certain components. The memory 41 can be used to store the computer program 42 and each functional module. The processor 43 runs the computer program 42 stored in the memory 41, thereby performing various functional applications and data processing of the device. The memory can be an internal memory or an external memory, or include both an internal memory and an external memory. The internal memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory, or a random access memory. The external memory can include a hard disk, a floppy disk, a ZIP disk, a USB flash drive, a magnetic tape, etc. The processor 43 can be a central processing unit (CPU), or can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, a single-chip microcomputer, or the processor 43 can also be any conventional processor, etc. The processors and memories disclosed in the present invention include, but are not limited to, these types of processors and memories. The processors and memories disclosed in the present invention are only examples and not limitations.
[0106] As an embodiment, the electronic device includes: one or more processors 43, a memory 41, one or more computer programs 42, wherein the one or more computer programs 42 are stored in the memory 41 and are configured to be executed by the one or more processors 43, and the one or more computer programs 42 are configured to execute the water area monitoring method based on image processing in any of the above embodiments. For the specific implementation process, please refer to the above embodiments and will not be elaborated here.
[0107] In the embodiments of the present invention, the manifold reconstruction-based embedding algorithm extracts spectral image features by using the pixel neighborhood set, and performs wavelength variable analysis on the corrected spectral image based on successive projections to obtain wavelength variable data. The combination of the two makes the generated feature data more comprehensive and improves the accuracy of water pollution area analysis. Analyzing the water pollution areas of each monitoring point based on the feature data combined with the spectral curve differences can improve the accuracy of pollution area analysis without affecting the efficiency of pollution area analysis. Predicting the spread of the pollution area based on the water pollution area data introduces the prediction of the pollution area spread, which can more comprehensively analyze the changes in water pollution. Using the feature data for water quality analysis based on the trained water quality inversion model obtained by training the initial water quality inversion model with the dataset and the regression coefficient set avoids occupying too much computing resources and ensures the efficiency and stability of water quality analysis. Generating a water pollution coefficient based on the water pollution area data, the pollution area spread prediction data, and the water quality parameters to determine whether to issue a warning message improves the reliability of water area monitoring and warning judgment, so as to be able to respond to changes in the water environment in a timely manner and achieve a more ideal effect of water area monitoring.
[0108] In addition, the above has introduced in detail a water area monitoring method and related device based on image processing provided by the embodiments of the present invention. Specific examples should have been used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A water area monitoring method based on image processing, characterized in that: The method comprises: Correcting the spectral images acquired at each monitoring point in the target waters to obtain the corrected spectral images of each monitoring point; Perform feature extraction based on the spectral image after correction to obtain corresponding feature data; Based on the characteristic data combined with the spectral curve difference, the water pollution area analysis of each monitoring point is performed to obtain water pollution area data; Based on the water area pollution area data, a pollution area diffusion prediction is performed to obtain pollution area diffusion prediction data; Perform water quality analysis using the characteristic data based on a water quality inversion model to obtain corresponding water quality parameters; A water pollution coefficient is generated based on the water pollution area data, pollution area diffusion prediction data and water quality parameters, and whether it is necessary to issue early warning information is determined based on the water pollution coefficient.
2. The water area monitoring method based on image processing according to claim 1 is characterized in that: The spectral images acquired at each monitoring point in the target waters are corrected to obtain the corrected spectral images of each monitoring point, including: Perform Gaussian surface fitting on each spectral image to obtain a fitting surface; Performing vignetting correction on each spectral image based on the fitting surface to obtain each spectral image after vignetting correction; Non-uniform correction is performed on each spectral image after vignetting correction to obtain each spectral image after correction.
3. The water area monitoring method based on image processing according to claim 1 is characterized in that: The feature extraction based on the spectral image after correction to obtain corresponding feature data includes: Selecting the nearest neighbors of the spectral image after correction based on the spectral angle distance to obtain a set of nearest neighbors of the pixel; Extracting spectral image features using the pixel neighbor set based on a manifold reconstruction preserving embedding algorithm to obtain spectral image feature data; The wavelength variable analysis is performed on the spectral image after the correction process based on the continuous projection to obtain the wavelength variable data, and the corresponding characteristic data is generated based on the spectral image characteristic data and the wavelength variable data.
4. The water area monitoring method based on image processing according to claim 1 is characterized in that: The water pollution area analysis of each monitoring point based on the characteristic data combined with the spectral curve difference to obtain water pollution area data includes: Based on the reflectivity difference and peak data difference of the spectral curve in the calibrated spectral image, the possibility of the polluted area is evaluated to obtain the possibility evaluation data of the polluted area; Performing color band analysis based on the characteristic data to obtain color band data; Based on the color band data and the pollution area possibility assessment data, water area pollution area analysis is performed to obtain water area pollution area data.
5. The water area monitoring method based on image processing according to claim 1, characterized in that: The method of performing pollution area diffusion prediction based on the water area pollution area data to obtain pollution area diffusion prediction data includes: Extracting the center point and edge data of the polluted area based on the polluted area data of the water area; Based on the data of the center point and edge of the polluted area and the flow direction of the water body in the water area, the pollution diffusion direction is predicted to obtain pollution diffusion direction prediction data; Based on the water area pollution area data combined with the water body flow velocity and pollution diffusion direction prediction data, the pollution area diffusion range is predicted to obtain pollution area diffusion range prediction data, wherein the pollution area diffusion range prediction includes regional migration prediction, regional dispersion prediction and regional attenuation prediction; The pollution area diffusion prediction data is generated based on the pollution diffusion direction prediction data and the pollution area diffusion range prediction data.
6. The water area monitoring method based on image processing according to claim 1, characterized in that: The water quality inversion model is based on the characteristic data to perform water quality analysis to obtain corresponding water quality parameters, including: Construct a data set based on water quality index parameters and spectral data of different water samples; Constructing an objective function based on the least squares method, and generating a regression coefficient set based on the objective function combined with an iterative method; Constructing an initial water quality inversion model based on a linear regression model, and training the initial water quality inversion model based on the data set and the regression coefficient set to obtain a trained water quality inversion model; The relationship curve between water quality parameters and characteristic data is obtained based on the trained water quality inversion model, and water quality analysis is performed based on the relationship curve to obtain corresponding water quality parameters.
7. The water area monitoring method based on image processing according to claim 1, characterized in that: The generating of a water area pollution coefficient based on the water area pollution area data, the pollution area diffusion prediction data and the water quality parameters, and judging whether it is necessary to issue warning information based on the water area pollution coefficient, includes: Calculate the pollution coefficient based on the water pollution area data, the pollution area diffusion prediction data and the water quality parameters to obtain the corresponding water pollution coefficient; The difference between the water pollution coefficient and the preset coefficient threshold is calculated. If the difference between the water pollution coefficient and the preset coefficient threshold is greater than or equal to the preset allowable deviation, an early warning message is issued.
8. A water area monitoring device based on image processing, characterized in that: The device comprises: Image correction module: used to correct the spectral images obtained at each monitoring point in the target waters to obtain the corrected spectral images of each monitoring point; Feature extraction module: used to extract features based on the spectral image after correction and obtain corresponding feature data; Water pollution area analysis module: used to analyze the water pollution area of each monitoring point based on the characteristic data combined with the spectral curve difference to obtain water pollution area data; A pollution area diffusion prediction module is used to predict the pollution area diffusion based on the water area pollution area data, and obtain pollution area diffusion prediction data; Water quality analysis module: used to perform water quality analysis using the characteristic data based on a water quality inversion model to obtain corresponding water quality parameters; Early warning judgment module: used to generate a water area pollution coefficient based on the water area pollution area data, pollution area diffusion prediction data and water quality parameters, and judge whether it is necessary to issue early warning information based on the water area pollution coefficient.
9. An electronic device, comprising a processor and a memory, characterized in that: The memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes the water area monitoring method based on image processing as described in any one of claims 1 to claim 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the water area monitoring method based on image processing as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Vignetting correction method for multispectral image
CN107341773A
Water environment analysis method and system based on correlation analysis, terminal and storage medium
CN112684134A
Water body pollution diffusion simulation and prediction method and device based on concentration analysis
CN113688555A
Water quality detection method and system based on unmanned aerial vehicle and medium
CN116698762A
Water quality analysis method and system based on machine vision
CN117233116A