System and method for measuring evaporation capacity of natural water area through image
Through intelligent imaging technology and high-resolution image sensors, combined with liquid level area detection model and liquid level segmentation model, the problems of cumbersome operation and large errors of traditional evaporation measurement methods are solved, and automated and accurate evaporation detection is achieved.
Patent Information
- Application Number
- CN202411685126.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-25
AI Technical Summary
The traditional evaporation measurement method has problems such as cumbersome operation, large errors, and inaccurate measurement when impurities exist in water, making it difficult to achieve automated and high-precision evaporation detection.
Using intelligent imaging technology, the high-definition images of the level meter are collected through the combination of level meter, lens, image sensor, CPU and 4G module, the evaporation amount is calculated through image processing, and the data is transmitted to the water conservancy platform. Using a large focal-band lens and high-resolution image sensor, combined with a liquid level area detection model and a liquid level segmentation model, to achieve more accurate liquid level change detection.
Automatic monitoring of evaporation is realized, manual operation is reduced, measurement accuracy is improved, and the evaporation detection error is smaller than that of traditional methods, and it can accurately detect liquid level changes under different light and liquid turbid conditions.
Smart Images

Figure CN119509645A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of video detection, and in particular to a system and method for measuring the evaporation of natural waters by using images. Background Art
[0002] AI intelligent recognition technology and high-definition image technology have matured, and license plate recognition and face recognition are widely used in reality. The development of water conservancy informatization is relatively backward, and video AI is not widely used in the field of hydrological monitoring. There are two traditional methods for measuring evaporation: the needle method and the weighing method. The needle method requires manual repeated rotation of the dial to read the reading, which is cumbersome and requires a high degree of timely response from the operator. If the operator does not respond in time, measurement errors will occur. Although the weighing method is simple to use and can achieve automated measurement, if there are impurities in the water, the water level conversion by weight is inaccurate, resulting in measurement errors; by measuring evaporation through the AI imaging method, based on high-resolution lenses and sensors, the changes in water levels can be measured more accurately, and the evaporation can be obtained by intelligently detecting the changes in liquid levels, eliminating cumbersome manual operations. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and to propose a system and method for measuring the evaporation of natural waters by image. The system and method use intelligent imaging technology to eliminate manual detection and reduce manpower investment. At the same time, the evaporation detection error is smaller than the traditional error.
[0004] The present invention solves the technical problem by adopting the following technical solutions:
[0005] A system for measuring the evaporation of natural waters by image, comprising a liquid level meter, a water inlet pipe, a lens, an image sensor, a CPU, a 4G module and an evaporation bucket, wherein the evaporation bucket is used to hold water, and is connected to the liquid level meter next to it through the water inlet pipe; the water in the liquid level meter and the water in the evaporation bucket are at the same level; the shooting direction of the lens is toward the liquid level meter, the lens, the image sensor, the CPU and the 4G module are connected in sequence, the lens and the image sensor are used to collect images of the liquid level meter, the CPU processes the image and calculates the evaporation, and the 4G module is used to transmit data.
[0006] Moreover, the lens adopts a large focal length lens to amplify the image, and uses a high-resolution image processor to achieve more accurate liquid level measurement. The ISP unit module of the CPU processes the image signal to obtain a high-definition image, which is then sent to the NPU unit module in the CPU. The internal algorithm identifies the liquid level of the liquid level meter and calculates the evaporation amount based on the actual liquid level change. The 4G module reports the statistical evaporation amount to the water conservancy platform for displaying the evaporation amount.
[0007] A method for measuring the evaporation of natural waters by using an image system, comprising the following steps:
[0008] Step 1: Add an appropriate amount of water to the evaporation barrel so that the liquid level is within the range of the liquid level meter. There are two scale lines on the liquid level meter with a range of 30 mm. The camera lens and image sensor collect high-definition images.
[0009] Step 2: Build a liquid level area detection model, initialize the liquid level gauge detection area in the image, and the ISP unit module preprocesses the image in the detection area to remove noise. The NPU unit module in the CPU sends the preprocessed image to the liquid level segmentation model for detection and segmentation. The pixels where the liquid level is located are obtained through model detection and segmentation.
[0010] Step 3: Calculate the liquid level scale value according to the liquid level pixel and liquid level relationship table;
[0011] Step 4: Calculate the evaporation amount based on the liquid volume drop in the evaporation barrel during the observation time.
[0012] Moreover, the specific implementation method of step 1 is as follows: the specific implementation method of the camera lens and the image sensor to collect high-definition images is as follows: the image sensor uses a high-resolution 5-megapixel image sensor, and the number of pixels occupied by the measured 0.1mm liquid level is 8; and the pixels in the image are calibrated for every 0.1mm liquid level in the 0-30mm range, and 300 corresponding relationships between liquid levels and pixels are obtained and saved in the device memory with an accuracy of 0.1mm, and the pixels in the image are converted into high-precision liquid levels.
[0013] Moreover, the specific implementation method of the pre-processing and denoising in step 2 is: using Gaussian filtering to pre-process the high-definition liquid level image, suppress noise and smooth the image.
[0014] Moreover, the specific implementation method of constructing the liquid surface area detection model in step 2 is:
[0015] Step 1: Collect high-definition and fine liquid surface images with rich scenes of different light intensities, different liquid turbidities, and different liquid surface fluctuations, and sort and calibrate local liquid surface area samples; and divide them into training sets, evaluation sets, and test sets according to the proportion;
[0016] Step 2: The liquid surface area detection model uses the Yolov8 network after the number of channels is trimmed, and the training framework uses Pytorch. The training set and evaluation set described in step 1 are used to train the liquid surface area detection model. The liquid surface area detection model is responsible for detecting the local liquid surface detection area in the input image, preparing for the next step of liquid surface segmentation in the ROI area.
[0017] The liquid surface area detection model is trained, and the model network parameters are trained using cross entropy loss and center loss. The specific expressions are as follows:
[0018]
[0019] Among them, L S is the cross entropy loss, L C For the center loss; is the output of the fully connected layer, and n represents the number of categories; Indicates the yth i The feature center of each category, x i represents the features before the fully connected layer, m represents the size of the minimum batch, and λ is the distribution coefficient;
[0020] Step 3: Use the test set to select the best liquid surface area detection model.
[0021] Moreover, the specific implementation method of sending the pre-processed image to the liquid surface area detection model for detection and segmentation in step 2 is:
[0022] Step 1: Using the liquid surface area sample in step 1 above, first cut out the image to obtain the liquid surface area ROI image. This ROI image consists of two parts, the upper half is the air layer, and the lower half is the liquid surface layer; then calibrate the liquid surface layer area to make a liquid surface segmentation sample, and divide it into training set, evaluation set and test set according to the proportion;
[0023] Step 2: The liquid level segmentation model uses the segmentation network Unet, and the training framework uses Pytorch. The training set and evaluation set prepared in step 1 are used to train the liquid level segmentation model. The liquid level segmentation model detects the liquid level area and segments the liquid level area.
[0024] Liquid surface segmentation model training, using softmax activation function, weighted cross entropy loss function, and weight calculation function to train model network parameters;
[0025] The specific expression of the Softmax activation function is as follows:
[0026]
[0027] Where C represents the number of categories, Represents the score of each category. The Softmax activation function transforms the output value of each pixel into a probability distribution with a positive value and a sum of 1, thereby obtaining the confidence S of each class in each pixel. i .
[0028] The specific expression of the weighted cross entropy loss function is as follows:
[0029]
[0030] Among them, E is the cross entropy loss, W(x) represents the true distribution of the sample, and p x (x) represents the predicted distribution of the sample;
[0031] Weight calculation function, the specific expression is as follows:
[0032]
[0033] Among them, W(x) is the weight to be calculated, W c (x) is the pre-computed true segmentation position, which is used to compensate for the different frequencies of pixels of each category in the training dataset; d 1 (x) is the distance to the nearest segmentation boundary, d 2 (x) is the distance to the second closest segmentation boundary.
[0034] Step 3: Use the test set to select the best liquid surface segmentation model.
[0035] Moreover, the specific method of step 3 is as follows: the present invention obtains the liquid level position by detecting and segmenting the input liquid level map, and then calculates the output liquid level scale value according to the corresponding relationship between the liquid level and the pixel. Figure 4 As shown;
[0036] The advantages and positive effects of the present invention are:
[0037] The present invention uses a liquid level meter connected to the evaporation bucket to reflect the position of the water in the evaporation bucket, and sequentially completes the acquisition of the image of the liquid level meter through the lens, image sensor, CPU and 4G module connected in sequence, calculates the evaporation amount through image processing, and transmits the evaporation amount data. The present invention uses intelligent imaging technology, video acquisition and analysis of liquid level changes to achieve automatic monitoring of evaporation, and uses a large focal length lens and a high-resolution image sensor to achieve more precise liquid level change detection, and the evaporation amount detection error is extremely small. The high-definition waterless ruler refines the liquid level change detection, and the evaporation amount detection error is smaller than the traditional error. At the same time, the present invention can minimize the image error by constructing a liquid surface area detection model and a liquid surface segmentation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a connection diagram of the device of the present invention;
[0039] Figure 2 It is a hardware structure diagram of the present invention;
[0040] Figure 3 A flowchart of the image processing calculation of the present invention;
[0041] Figure 4 It is a schematic diagram of calculating and outputting the liquid level scale value according to the present invention. DETAILED DESCRIPTION
[0042] The present invention is further described in detail below with reference to the accompanying drawings.
[0043] A system for measuring evaporation in natural waters using images, such as Figure 1 and Figure 2 As shown, it includes a liquid level meter, a water inlet pipe, a lens, an image sensor, a CPU, a 4G module and an evaporation bucket, wherein the evaporation bucket is used to hold water, and the evaporation bucket is connected to the liquid level meter next to it through the water inlet pipe; the water in the liquid level meter and the water in the evaporation bucket are at the same level; the shooting direction of the lens is toward the liquid level meter, the lens, the image sensor, the CPU and the 4G module are connected in sequence, the lens and the image sensor are used to collect images of the liquid level meter, the CPU processes the image and calculates the evaporation amount, and the 4G module is used to transmit data.
[0044] The lens uses a large focal length lens to magnify the image, and a high-resolution image processor is used to achieve more accurate liquid level measurement. The CPU's ISP unit module processes the image signal to obtain a high-definition image, which is then sent to the NPU unit module. The internal algorithm identifies the liquid level of the liquid level meter and calculates the evaporation amount based on the actual liquid level change. The 4G module reports the statistical evaporation amount to the water conservancy platform for displaying the evaporation amount.
[0045] A method for measuring the evaporation of natural waters by using an image system, comprising the following steps:
[0046] Step 1: Add an appropriate amount of water to the evaporating barrel so that the liquid level is within the range of the liquid level meter. There are two scale lines on the liquid level meter with a range of 30mm. The camera lens and image sensor collect high-definition images.
[0047] The specific implementation method of step 1 is: the specific implementation method of the camera lens and image sensor to collect high-definition images is: the image sensor uses a high-resolution 5-megapixel image sensor, and the number of pixels occupied by the measured 0.1mm liquid level is 8; and the pixels in the image are calibrated for every 0.1mm liquid level in the 0-30mm range, and 300 corresponding relationships between liquid levels and pixels are obtained and saved in the device memory with an accuracy of 0.1mm, and the pixels in the image are converted into high-precision liquid levels.
[0048] Moreover, the specific implementation method of the pre-processing and denoising in step 2 is: using Gaussian filtering to pre-process the high-definition liquid level image, suppress noise and smooth the image.
[0049] Step 2: Build a liquid level area detection model, initialize the liquid level gauge detection area in the image, the ISP unit module preprocesses the image in the detection area to remove noise, and the NPU unit module sends the preprocessed image to the liquid level segmentation model for detection and segmentation. The pixels where the liquid level is located are obtained through model detection and segmentation.
[0050] The specific implementation method of constructing the liquid surface area detection model in step 2 is:
[0051] Step 1: Collect high-definition and fine liquid surface images with rich scenes of different light intensities, different liquid turbidities, and different liquid surface fluctuations, and sort and calibrate local liquid surface area samples; and divide them into training sets, evaluation sets, and test sets according to the proportion;
[0052] Step 2: The liquid surface area detection model uses the Yolov8 network after the number of channels is trimmed, and the training framework uses Pytorch. The training set and evaluation set described in step 1 are used to train the liquid surface area detection model. The liquid surface area detection model is responsible for detecting the local liquid surface detection area in the input image, preparing for the next step of liquid surface segmentation in the ROI area.
[0053] The liquid surface area detection model is trained, and the model network parameters are trained using cross entropy loss and center loss. The specific expressions are as follows:
[0054]
[0055] Among them, L S is the cross entropy loss, L C For the center loss; is the output of the fully connected layer, and n represents the number of categories; Indicates the yth i The feature center of each category, x i represents the features before the fully connected layer, m represents the size of the minimum batch, and λ is the distribution coefficient;
[0056] Step 3: Use the test set to select the best liquid surface area detection model.
[0057] In step 2, the specific implementation method of sending the preprocessed image to the liquid surface area detection model for detection and segmentation is:
[0058] Step 1: Using the liquid surface area sample in step 1 above, first cut out the image to obtain the liquid surface area ROI image. This ROI image consists of two parts, the upper half is the air layer, and the lower half is the liquid surface layer; then calibrate the liquid surface layer area to make a liquid surface segmentation sample, and divide it into training set, evaluation set and test set according to the proportion;
[0059] Step 2: The liquid level segmentation model uses the segmentation network Unet, and the training framework uses Pytorch. The training set and evaluation set prepared in step 1 are used to train the liquid level segmentation model. The liquid level segmentation model detects the liquid level area and segments the liquid level area.
[0060] Liquid surface segmentation model training, using softmax activation function, weighted cross entropy loss function, and weight calculation function to train model network parameters;
[0061] The specific expression of the Softmax activation function is as follows:
[0062]
[0063] Where C represents the number of categories, Represents the score of each category. The Softmax activation function transforms the output value of each pixel into a probability distribution with positive values and a sum of 1, thereby obtaining the confidence S of each class in each pixel.
[0064] The specific expression of the weighted cross entropy loss function is as follows:
[0065]
[0066] Among them, E is the cross entropy loss, W(x) represents the true distribution of the sample, and p x (x) represents the predicted distribution of the sample;
[0067] Weight calculation function, the specific expression is as follows:
[0068]
[0069] Among them, W(x) is the weight to be calculated, W c (x) is the pre-computed true segmentation position, which is used to compensate for the different frequencies of pixels of each category in the training dataset; d 1 (x) is the distance to the nearest segmentation boundary, d 2 (x) is the distance to the second closest segmentation boundary.
[0070] Step 3: Use the test set to select the best liquid surface segmentation model.
[0071] Step 3: Calculate the liquid level scale value based on the liquid surface pixel and liquid level relationship table.
[0072] Moreover, the specific method of step 3 is as follows: the present invention obtains the liquid level position by detecting and segmenting the input liquid level map, and then calculates the output liquid level scale value according to the corresponding relationship between the liquid level and the pixel. Figure 4 As shown;
[0073] Step 4: Calculate the evaporation amount based on the liquid volume drop in the evaporation barrel during the observation time.
[0074] The evaporation amount statistics of the present invention are as follows: water is injected into the evaporation barrel from 8 o'clock, and the water in the evaporation barrel is at the same level as the water in the liquid level meter; the equipment monitors the liquid level of the liquid level meter in real time, and when the evaporation barrel is almost full of water and the liquid level of the liquid level meter reaches the high liquid level threshold, the water injection is stopped; the equipment algorithm identifies the current liquid level of the liquid level meter, outputs the liquid level value and saves it; at 8 o'clock the next day, the equipment outputs the current liquid level value, calculates the evaporation amount and transmits the data to the platform through the 4G signal; the evaporation barrel is injected with water again, and the evaporation amount statistics of the next day are carried out.
[0075] It should be emphasized that the embodiments described in the present invention are illustrative rather than restrictive. Therefore, the present invention includes but is not limited to the embodiments described in the specific implementation manner. Any other implementation manners derived by those skilled in the art based on the technical solution of the present invention also fall within the scope of protection of the present invention.
Claims
1. A system for measuring evaporation of natural waters by image, characterized in that: It includes a liquid level meter, a water inlet pipe, a lens, an image sensor, a CPU, a 4G module and an evaporation barrel, wherein the evaporation barrel is used to hold water, and the evaporation barrel is connected to the liquid level meter next to it through the water inlet pipe; the water in the liquid level meter and the water in the evaporation barrel are at the same level; the shooting direction of the lens is toward the liquid level meter, the lens, the image sensor, the CPU and the 4G module are connected in sequence, the lens and the image sensor are used to collect images of the liquid level meter, the CPU processes the image and calculates the evaporation amount, and the 4G module is used to transmit data.
2. The system for measuring evaporation of natural waters by image according to claim 1, characterized in that: The lens uses a large focal length lens to magnify the image, and uses a high-resolution image processor to achieve more accurate liquid level measurement. The ISP unit module of the CPU processes the image signal to obtain a high-definition image, which is then sent to the NPU unit module in the CPU. The internal algorithm identifies the liquid level of the liquid level meter and calculates the evaporation amount based on the actual liquid level change. The 4G module reports the statistical evaporation amount to the water conservancy platform for displaying the evaporation amount.
3. A method for measuring the evaporation of natural waters by using an image as claimed in claim 1, characterized in that: The following steps are involved: Step 1: Add an appropriate amount of water to the evaporation barrel so that the liquid level is within the range of the liquid level meter. There are two scale lines on the liquid level meter with a range of 30 mm. The camera lens and image sensor collect high-definition images. Step 2: Build a liquid level area detection model, initialize the liquid level gauge detection area in the image, the ISP unit module in the CPU preprocesses the image in the detection area to remove noise, and the NPU unit module in the CPU sends the preprocessed image to the liquid level segmentation model for detection and segmentation. The pixels where the liquid level is located are obtained through model detection and segmentation; Step 3: Calculate the liquid level scale value according to the liquid level pixel and liquid level relationship table; Step 4: Calculate the evaporation amount based on the liquid volume drop in the evaporation barrel during the observation time.
4. The method for measuring the evaporation of natural waters by using an image according to claim 3 is characterized by: The specific implementation method of step 1 is as follows: the specific implementation method of the camera lens and image sensor to collect high-definition images is as follows: the image sensor uses a high-resolution 5-megapixel image sensor, and the number of pixels occupied by the measured 0.1mm liquid level is 8; and the pixels in the image are calibrated for each 0.1mm liquid level in the 0-30mm range, and 300 corresponding relationships between liquid levels and pixels are obtained and saved in the device memory with an accuracy of 0.1mm, and the pixels in the image are converted into high-precision liquid levels.
5. The method for measuring the evaporation of natural waters by using an image according to claim 4, characterized in that: The specific implementation method of the pre-processing and denoising in step 2 is: use Gaussian filtering to pre-process the high-definition liquid level image, suppress noise and smooth the image.
6. The method for measuring the evaporation of natural waters by using an image according to claim 4, characterized in that: The specific implementation method of constructing the liquid surface area detection model in step 2 is: Step 2.1: Collect high-definition and fine liquid surface images with rich scenes of different light intensities, different liquid turbidities, and different liquid surface fluctuations, sort and calibrate local liquid surface area samples; and divide them into training sets, evaluation sets, and test sets according to the proportion; Step 2.2: The liquid surface area detection model uses the Yolov8 network after the number of channels is trimmed, and the training framework uses Pytorch. The training set and evaluation set described in step 2.1 are used to train the liquid surface area detection model. The liquid surface area detection model is responsible for detecting the local liquid surface detection area in the input image, preparing for the next step of liquid surface segmentation in the ROI area. The liquid surface area detection model is trained, and the model network parameters are trained using cross entropy loss and center loss. The specific expressions are as follows: Among them, L S is the cross entropy loss, L C For the center loss; is the output of the fully connected layer, and n represents the number of categories; Indicates y i The feature center of each category, x i represents the features before the fully connected layer, m represents the size of the minimum batch, and λ is the distribution coefficient; Step 2.3: Use the test set to evaluate the accuracy and recall of the liquid surface area detection model, and finally select the best liquid surface area detection model that meets the index requirements.
7. The method for measuring the evaporation of natural waters by using an image according to claim 6, characterized in that: The specific implementation method of sending the pre-processed image to the liquid surface area detection model for detection and segmentation in step 2 is: Step 2.4: Using the liquid surface area samples in step 2.1, first cut out the image to obtain the liquid surface area ROI image. This ROI image consists of two parts, the upper half is the air layer, and the lower half is the liquid surface layer; then calibrate the liquid surface layer area to make a liquid surface segmentation sample, and divide it into training set, evaluation set and test set according to the proportion; Step 2.5: The liquid level segmentation model uses the segmentation network Unet, and the training framework uses Pytorch. The training set and evaluation set prepared in step 2.4 are used to train the liquid level segmentation model. The liquid level segmentation model detects the liquid level area and segments the liquid level area. Liquid surface segmentation model training, using softmax activation function, weighted cross entropy loss function, and weight calculation function to train model network parameters; The specific expression of the Softmax activation function is as follows: Where C represents the number of categories, Represents the score of each category. The Softmax activation function transforms the output value of each pixel into a probability distribution with a positive value and a sum of 1, thereby obtaining the confidence S of each class in each pixel. i . The specific expression of the weighted cross entropy loss function is as follows: Among them, E is the cross entropy loss, W(x) represents the true distribution of the sample, and p x (x) represents the predicted distribution of the sample; Weight calculation function, the specific expression is as follows: Among them, W(x) is the weight to be calculated, W c (x) is the pre-computed true segmentation position used to compensate for the different frequencies of pixels of each category in the training dataset; d1(x) is the distance to the nearest segmentation boundary, and d2(x) is the distance to the second nearest segmentation boundary. Step 3: Use the test set to evaluate the accuracy and recall of the liquid surface segmentation model, and finally select the best liquid surface segmentation model that meets the index requirements.
8. The method for measuring the evaporation of natural waters by using images according to claim 7 is characterized by: The specific method of step 3 is: the present invention obtains the liquid level position by detecting and segmenting the input liquid level map, and then calculates the output liquid level scale value according to the corresponding relationship between the liquid level and the pixel. The schematic flow chart of the actual embodiment is shown in FIG4 .