Water level detection method and device based on fitting function
By combining a camera and a fitting function, the problem of water level detection affected by environmental factors was solved, achieving high-precision and low-cost water level detection.
Patent Information
- Application Number
- CN202510164809.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-02-14
AI Technical Summary
Existing water level detection technologies are affected by factors such as temperature, humidity, wind and waves, electromagnetic interference, and signal transmission lines, resulting in low measurement accuracy, limited sensor lifespan, high maintenance costs, and large errors in high-precision scenarios due to visual detection methods.
Video images of the pool are acquired using a camera. By installing buoys and scales, a pre-trained target recognition network is used to identify the scale markings and the center point of the buoys. An exponential fitting function is constructed, and the fitting parameters are optimized by combining prior distribution and likelihood estimation to achieve accurate calculation of water level.
It improves the accuracy and reliability of water level detection, reduces measurement errors, lowers maintenance costs, and eliminates reliance on sensors.
Smart Images

Figure CN119624974B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of water level detection technology, and in particular to a water level detection method and apparatus based on a fitting function. Background Technology
[0002] In key areas such as water resource management, flood warning, and environmental monitoring, water level detection technology is crucial for understanding water level changes in rivers, lakes, and reservoirs. However, existing water level detection technologies primarily rely on sensor technology, which has several limitations. Specifically, sensors are exposed to harsh outdoor environments for extended periods, making their measurement accuracy susceptible to factors such as temperature, humidity, and wind / waves, leading to significant errors. Furthermore, electromagnetic interference and signal transmission line issues can also interfere with sensor signals, affecting the accuracy of measurement results. When the sensor's measurement range does not match the actual water level range, inaccurate measurement data can also result. The physical properties of sensors limit their lifespan, necessitating periodic replacement, which increases maintenance costs.
[0003] With the popularization of artificial intelligence, existing technologies generally use visual inspection to directly detect water levels by visually detecting the readings of scales in the water. However, visual inspection is easily affected by factors such as lighting and target occlusion. In addition, there are reflections and refractions on the water surface, so the error of using a camera for visual inspection is very large. Moreover, the accuracy requirements for water level detection are also very high, often at the millimeter level. Therefore, visual inspection cannot be applied to many high-precision scenarios. Summary of the Invention
[0004] This application provides a water level detection method and apparatus based on a fitting function. By installing a float on a scale and a camera next to the pool, the accurate water level data of the pool is obtained by monitoring the video images in the camera and analyzing and calculating the scale values and float values in the images based on the fitting function.
[0005] In a first aspect, embodiments of this application provide a water level detection method based on a fitting function, the method comprising:
[0006] A scale and buoy are deployed in the water area to be monitored, and monitoring images including the scale and buoy are acquired in real time from a top-down perspective.
[0007] A pre-trained target recognition network is used to identify each scale mark and buoy center point in the monitoring image, and the two-dimensional coordinate values of each scale mark and buoy center point are obtained in the form of pixel coordinates.
[0008] An exponential fitting function is constructed, and initial fitting parameters are set for the exponential fitting function. The actual scale value, the ordinate of the two-dimensional coordinate value of each scale mark, and the ordinate of the two-dimensional coordinate value of the buoy center point are normalized and substituted into the exponential fitting function for iterative solution to obtain the optimal fitting parameters. The water level is obtained based on the optimal fitting parameters and the normalized ordinate of the two-dimensional coordinate value of the buoy center point. The value range of the initial fitting parameters is (1, 2).
[0009] Secondly, embodiments of this application provide a water level detection device based on a fitting function, comprising:
[0010] The acquisition module is used to deploy scales and buoys in the water area to be monitored and acquire monitoring images containing scales and buoys in real time from a top-down perspective;
[0011] The recognition module is used to identify each scale mark and buoy center point in the monitoring image using a pre-trained target recognition network, and to obtain the two-dimensional coordinate values of each scale mark and buoy center point in the form of pixel coordinates.
[0012] The fitting module is used to construct an exponential fitting function and set initial fitting parameters for the exponential fitting function. The actual scale value of the scale, the ordinate of the two-dimensional coordinate value of each scale scale, and the ordinate of the two-dimensional coordinate value of the buoy center point are normalized and substituted into the exponential fitting function for iterative solution to obtain the optimal fitting parameters. The water level height is obtained based on the optimal fitting parameters and the normalized ordinate of the two-dimensional coordinate value of the buoy center point. The value range of the initial fitting parameters is (1, 2).
[0013] Thirdly, embodiments of this application provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform a water level detection method based on a fitting function.
[0014] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including a water level detection method based on a fitting function.
[0015] The main contributions and innovations of this invention are as follows:
[0016] This application embodiment utilizes a camera to capture video streams and processes frame images through a target recognition convolutional neural network model. This eliminates the reliance on sensors in traditional water level detection technologies and overcomes the problems of large measurement errors, limited lifespan, and high maintenance costs caused by factors such as temperature, humidity, wind and waves, electromagnetic interference, signal transmission lines, and measurement range matching. In the detection step, this application embodiment acquires image data, identifies targets, and obtains coordinates. Based on image features, a suitable fitting function is determined, and a prior distribution is introduced to incorporate experience or previous experimental data, providing initial information for the fitting parameters. Likelihood estimation accurately measures the degree of data fit, while the posterior distribution updates parameter information by combining prior and likelihood functions. The synergistic effect of these three elements makes the solution of fitting parameters more accurate and stable, thereby greatly improving the accuracy and reliability of water level detection.
[0017] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a flowchart of a water level detection method based on a fitting function according to an embodiment of this application;
[0020] Figure 2 This is a schematic diagram illustrating the connection relationship between a buoy and a through hole according to an embodiment of this application;
[0021] Figure 3 It is a graph of an exponential fitting function according to an embodiment of this application;
[0022] Figure 4 This is a structural block diagram of a water level detection device based on a fitting function according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0025] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0026] Example 1:
[0027] This application provides a water level detection method based on a fitting function. A buoy is installed on a scale, and a camera is installed beside the pool. By monitoring the video images from the camera, accurate water level data is calculated based on the scale readings in the images and the buoy readings, using a fitting function analysis. Specifically, refer to... Figure 1 The method includes:
[0028] A scale and buoy are deployed in the water area to be monitored, and monitoring images including the scale and buoy are acquired in real time from a top-down perspective.
[0029] A pre-trained target recognition network is used to identify each scale mark and buoy center point in the monitoring image, and the two-dimensional coordinate values of each scale mark and buoy center point are obtained in the form of pixel coordinates.
[0030] An exponential fitting function is constructed, and initial fitting parameters are set for the exponential fitting function. The actual scale value, the ordinate of the two-dimensional coordinate value of each scale mark, and the ordinate of the two-dimensional coordinate value of the buoy center point are normalized and substituted into the exponential fitting function for iterative solution to obtain the optimal fitting parameters. The water level is obtained based on the optimal fitting parameters and the normalized ordinate of the two-dimensional coordinate value of the buoy center point. The value range of the initial fitting parameters is (1, 2).
[0031] In some specific embodiments, a through hole is provided at the center of the buoy, and the buoy is fitted onto the scale through this through hole. The connection relationship between the buoy and the through hole is as follows: Figure 2As shown, this solution connects the buoy and the scale through a through hole, preventing the buoy from being carried away by the water flow, and ensuring normal water level detection even in turbulent water conditions.
[0032] In some embodiments, a camera is installed in the water area to be detected to acquire a video stream of the water area. The video stream is then decoded according to the camera's frame rate to obtain n frames of monitoring images containing a scale and a buoy to detect the water level of the water area.
[0033] In some specific embodiments, any target recognition network can be used to identify the monitored images, such as YOLO, GhostNet, etc., and this solution does not limit this.
[0034] Specifically, this solution uses a camera to pull video streams and processes frame images through a target recognition convolutional neural network model, thus eliminating the dependence of traditional water level detection technology on sensors. It overcomes the problems of large measurement errors, limited service life, and high maintenance costs caused by factors such as temperature, humidity, wind and waves, electromagnetic interference, signal transmission lines, and measurement range matching.
[0035] In some embodiments, the two-dimensional coordinate values of each scale mark and the buoy center point are calculated with the lower left corner of the monitoring image as the origin of the coordinate system. The two-dimensional coordinate values of each scale mark and the buoy center point are represented by the position of the pixel in the monitoring image. If each scale mark and the buoy center point occupy multiple pixels, the center point of the area occupied by the multiple pixels is used as the two-dimensional coordinate value of the corresponding scale mark or the buoy center point.
[0036] Specifically, taking the lower left corner of the monitored image as the origin (0, 0), the two-dimensional coordinates of the m scale values on the scale are (x1, y1), (x2, y2), ..., (x...). m ,y m The two-dimensional coordinates of the buoy's center point are (x... m+1 ,y m+1 ).
[0037] For example, if the ruler scale occupies 30 pixels horizontally and 40 pixels vertically, the center point of the image area occupied by the ruler scale is used as the two-dimensional coordinate value of the ruler scale.
[0038] Specifically, this scheme uses pixel coordinates to accurately represent the position of the scale mark and the center point of the buoy, which facilitates subsequent fitting calculations.
[0039] In some embodiments, since the scale is vertical, it can be inferred that the actual scale value and the vertical axis of the scale's two-dimensional coordinates have an exponential relationship. Therefore, this scheme uses an exponential fitting function for fitting, and the formula is expressed as follows:
[0040] ;
[0041] The characteristic of the exponential fitting function is that it must pass through specific points (0, 0) and (1, e), while the ordinate of the scale value and the scale value must pass through points (0, 0) and (b, c). Therefore, the fitting function can be rewritten as:
[0042] ;
[0043] Where b represents the maximum value of the ruler scale, c represents the height of the image, a is the initial fitting parameter, and y i v represents the ordinate of m scale readings and the center point of the buoy. i This represents the water level.
[0044] In some embodiments, the actual scale value of the scale, the ordinate of the two-dimensional coordinate value of each scale mark, and the ordinate of the two-dimensional coordinate value of the buoy center point are normalized based on the image height of the monitoring image.
[0045] Specifically, since there is a significant difference between the image height and the scale value in the camera video stream during actual measurement, the image height is usually three to four digits, while the scale value is usually a single digit. In order to make the fitting function more intuitively represent the scale value, the scale value is normalized by monitoring the image height, so that its range is unified to 0-100.
[0046] Specifically, the normalized ordinate of the m scale values and the buoy center point is as follows:
[0047] ;
[0048] Where c represents the height of the image, y i This represents the m scale values and the unnormalized ordinate of the buoy's center point.
[0049] The normalized scale values are:
[0050] ;
[0051] Where b represents the maximum value of the ruler scale, d represents the minimum value of the ruler scale, and v i This represents m scale values.
[0052] Then, based on the normalization result, the fitted function is transformed into:
[0053] ;
[0054] Where a is the fitting parameter, This represents the normalized ordinate value. This represents the normalized scale value (i.e., water level height).
[0055] In some specific embodiments, since the camera acquires monitoring images from a top-down perspective, based on the basic properties of the exponential function and the relationship between the ordinate of the scale value and the scale value, it can be concluded that: increasing the ordinate of the scale value will lead to an increase in the spacing between adjacent scale values. Therefore, the initial fitting parameter is set to a range of (1, 2) to obtain a better fitting effect and a faster convergence speed.
[0056] In this scheme, the curve of the exponential fitting function is as follows: Figure 3 As shown, a prior distribution is set for the initial fitting parameters. In each iteration, the deviation between the current exponential fitting function value and the actual scale value is calculated to obtain the deviation result. The likelihood estimate is calculated based on the deviation result. The likelihood estimate is then used to calculate the posterior distribution of the current iteration. The total deviation result of each actual scale value in each iteration is calculated. The fitting parameters are updated based on the total deviation result and the posterior distribution until the optimal fitting parameters are obtained.
[0057] Specifically, the prior distribution is used to select the most suitable value for the initial fitting parameters within the range of values, the likelihood estimation is used to represent the matching situation of the fitting parameters in the current iteration, and the posterior distribution is used to adjust the fitting parameters in each iteration based on the likelihood estimation.
[0058] For example, if the prior distribution follows a normal distribution, and an initial fitting parameter a0 is selected based on the prior distribution, then for the initial fitting parameter a0, the deviation between the corresponding fitted function value and the normalized value of each scale mark is calculated. The deviation result of the i-th scale mark value is:
[0059] ;
[0060] in, This represents the normalized scale value. This represents the normalized scale value calculated by the fitted function, i.e., the water level height.
[0061] The total deviation S in the current iteration is:
[0062] ;
[0063] The smaller S is, the better the fitting parameter a is to the scale value from the current perspective.
[0064] In this scheme, the ordinate of the scale values on the image is continuously substituted into the exponential fitting function as input, and the fitting parameter a is continuously adjusted with a step size of 0.0001 for iteration. In each iteration, the fitting parameter a is updated and the total deviation value S is recalculated. When the iteration number T is reached, or when the total deviation value S does not decrease significantly or begins to increase in consecutive iterations, it indicates that the fitting parameter a has converged. At this point, the iteration is stopped, and the fitting parameter a at the point of convergence is taken as the optimal fitting parameter.
[0065] The ordinate of the normalized two-dimensional coordinates of the buoy's center point is:
[0066] ;
[0067] Among them, y m+1 The ordinate representing the center point of the buoy, after normalization, is the ordinate of the center point of the buoy. By inputting the fitting function, the normalized scale value of the buoy's center point can be calculated. Therefore, the scale value after normalizing the buoy's center point is... The water level (v) in the pool can be obtained by converting the reading to the actual scale value of the buoy's center point. m+1 :
[0068] ;
[0069] in, 'b' represents the normalized scale value of the buoy's center point, 'd' represents the maximum scale value, and 'd' represents the minimum scale value.
[0070] Specifically, this scheme determines a suitable fitting function based on image features and introduces a prior distribution to incorporate experience or previous experimental data to provide initial information for the fitting parameters. Likelihood estimation can accurately measure the degree of data fit, while the posterior distribution combines the prior and likelihood functions to update parameter information. The synergistic effect of these three factors makes the solution of fitting parameters more accurate and stable, thereby greatly improving the accuracy and reliability of water level detection.
[0071] Example 2:
[0072] Based on the same concept, referencing Figure 4 This application also proposes a water level detection device based on a fitting function, comprising:
[0073] The acquisition module is used to deploy scales and buoys in the water area to be monitored and acquire monitoring images containing scales and buoys in real time from a top-down perspective;
[0074] The recognition module is used to identify each scale mark and buoy center point in the monitoring image using a pre-trained target recognition network, and to obtain the two-dimensional coordinate values of each scale mark and buoy center point in the form of pixel coordinates.
[0075] The fitting module is used to construct an exponential fitting function and set initial fitting parameters for the exponential fitting function. The actual scale value of the scale, the ordinate of the two-dimensional coordinate value of each scale scale, and the ordinate of the two-dimensional coordinate value of the buoy center point are normalized and substituted into the exponential fitting function for iterative solution to obtain the optimal fitting parameters. The water level height is obtained based on the optimal fitting parameters and the normalized ordinate of the two-dimensional coordinate value of the buoy center point. The value range of the initial fitting parameters is (1, 2).
[0076] Example 3:
[0077] This embodiment also provides an electronic device, see reference. Figure 5 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.
[0078] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0079] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0080] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.
[0081] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any of the water level detection methods based on fitting functions in the above embodiments.
[0082] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.
[0083] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0084] The input / output device 408 is used to input or output information. In this embodiment, the input information may be monitoring images, initial fitting parameters, etc., and the output information may be optimal fitting parameters, water level height, etc.
[0085] Optionally, in this embodiment, the processor 402 can be configured to perform the following steps via a computer program:
[0086] A scale and buoy are deployed in the water area to be monitored, and monitoring images including the scale and buoy are acquired in real time from a top-down perspective.
[0087] A pre-trained target recognition network is used to identify each scale mark and buoy center point in the monitoring image, and the two-dimensional coordinate values of each scale mark and buoy center point are obtained in the form of pixel coordinates.
[0088] An exponential fitting function is constructed, and initial fitting parameters are set for the exponential fitting function. The actual scale value, the ordinate of the two-dimensional coordinate value of each scale mark, and the ordinate of the two-dimensional coordinate value of the buoy center point are normalized and substituted into the exponential fitting function for iterative solution to obtain the optimal fitting parameters. The water level is obtained based on the optimal fitting parameters and the normalized ordinate of the two-dimensional coordinate value of the buoy center point. The value range of the initial fitting parameters is (1, 2).
[0089] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0090] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0091] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 5 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0092] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0093] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A water level detection method based on a fitting function, characterized in that, Includes the following steps: Scales and buoys are deployed in the waters to be monitored, and monitoring images including scales and buoys are acquired in real time from a top-down perspective. A pre-trained target recognition network is used to identify each scale mark and buoy center point in the monitoring image, and the two-dimensional coordinate values of each scale mark and buoy center point are obtained in the form of pixel coordinates. An exponential fitting function is constructed, and initial fitting parameters are set for the exponential fitting function. The actual scale values and the ordinates of the two-dimensional coordinates of each scale scale value are normalized and substituted into the exponential fitting function for iterative solution to obtain the optimal fitting parameters. The water level is obtained based on the optimal fitting parameters and the ordinates of the two-dimensional coordinates of the buoy center point after normalization. The initial fitting parameters are in the range of (1, 2). A prior distribution is set for the initial fitting parameters. In each iteration, the deviation between the current exponential fitting function value and the actual scale value is calculated to obtain the deviation result. The likelihood estimate is calculated based on the deviation result, and then the likelihood estimate is used to calculate the posterior distribution of the current iteration. The total deviation result of each actual scale value in each iteration is calculated. The fitting parameters are updated based on the total deviation result and the posterior distribution until the optimal fitting parameters are obtained. The prior distribution is used to select a value for the initial fitting parameters within the range of values. The likelihood estimate is used to represent the matching situation of the fitting parameters in the current iteration. The posterior distribution is used to adjust the fitting parameters in each iteration based on the likelihood estimate.
2. The water level detection method based on a fitting function according to claim 1, characterized in that, The buoy has a through hole in its center, through which the buoy is fitted onto the scale.
3. The water level detection method based on a fitting function according to claim 1, characterized in that, The two-dimensional coordinates of each scale mark and the buoy center point are calculated with the lower left corner of the monitoring image as the origin. The two-dimensional coordinates of each scale mark and the buoy center point are represented by the position of the pixel in the monitoring image. If each scale mark and the buoy center point occupy multiple pixels, the center point of the area occupied by the multiple pixels is used as the two-dimensional coordinates of the corresponding scale mark or the buoy center point.
4. The water level detection method based on a fitting function according to claim 1, characterized in that, Based on the image height of the monitoring image, the actual scale value of the scale, the ordinate of the two-dimensional coordinate value of each scale mark, and the ordinate of the two-dimensional coordinate value of the buoy center point are normalized.
5. A water level detection device based on a fitting function, characterized in that, include: The acquisition module is used to deploy scales and buoys in the water area to be monitored and acquire monitoring images containing scales and buoys in real time from a top-down perspective; The recognition module is used to identify each scale mark and buoy center point in the monitoring image using a pre-trained target recognition network, and to obtain the two-dimensional coordinate values of each scale mark and buoy center point in the form of pixel coordinates. The fitting module is used to construct an exponential fitting function and set initial fitting parameters for the exponential fitting function. It normalizes the actual scale values and the ordinate of each scale scale's two-dimensional coordinate value, and substitutes them into the exponential fitting function for iterative solution to obtain the optimal fitting parameters. Based on the optimal fitting parameters and the ordinate of the normalized buoy center point's two-dimensional coordinate value, the water level is obtained. The initial fitting parameters have a value range of (1, 2). A prior distribution is set for the initial fitting parameters. In each iteration, the deviation between the current exponential fitting function value and the actual scale value is calculated to obtain the deviation result. Based on the deviation result, a likelihood estimate is calculated, and then the likelihood estimate is used to calculate the posterior distribution of the current iteration. The total deviation result for each actual scale value in each iteration is calculated. Based on the total deviation result and the posterior distribution, the fitting parameters are updated until the optimal fitting parameters are obtained. The prior distribution is used to select a value for the initial fitting parameters within the value range. The likelihood estimate is used to represent the matching status of the fitting parameters in the current iteration. The posterior distribution is used to adjust the fitting parameters in each iteration based on the likelihood estimate.
6. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform a water level detection method based on a fitting function as described in any one of claims 1-4.
7. A readable storage medium, characterized in that, The readable storage medium stores a computer program, the computer program including program code for controlling a process to execute the process, the process including a water level detection method based on a fitting function according to any one of claims 1-4.
Citation Information
Patent Citations
Water level measuring system and method based on digital image processing
CN103017869A