Visual water gauge intelligent recognition method and system
By installing reference objects near the water ruler and using contour recognition technology to judge the occlusion situation, the problem of water level height recognition when the water ruler is blocked is solved, and accurate water level recognition is achieved without relying on labeling the occlusion image.
Patent Information
- Application Number
- CN202411929887.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The prior art is difficult to accurately identify the water level height when the water ruler is blocked, and the training work of marking the occlusion image on the artificial intelligence algorithm model is huge.
By installing a reference object near the water ruler and using the camera to take the water ruler image, the contour recognition technology is used to determine whether the water ruler is blocked, and corresponding identification strategies are adopted according to different occlusion conditions, including identifying the water level height when partially blocked or not, and adjusting the camera angle when completely blocked to capture a vertical image to identify the water level height.
The AI algorithm model is not needed to be recognized using the annotated occlusion image, which reduces the difficulty and computational complexity of the recognition algorithm and realizes accurate water level recognition in the occlusion situation.
Smart Images

Figure CN119723093B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a method and system for intelligent recognition of visual water gauges. Background Art
[0002] With the rapid development of technology, artificial intelligence (AI) has shown great potential and value in many fields. Among them, machine learning and computer vision technologies have been gradually applied to water resource management.
[0003] Generally, a water gauge is installed in a monitored water area, and a camera is installed near the water gauge. The water gauge image is captured by the camera, and an artificial intelligence algorithm model is used to identify the water gauge image to obtain the water level height of the monitored water area. However, if the water gauge is blocked by water plants, the scale line value of the true water level on the water gauge will also be blocked by the water plants. In this way, the true water level height cannot be obtained. As one of the solutions, the blocked water gauge image is used to train the artificial intelligence algorithm model so that the artificial intelligence algorithm model has the recognition ability in the case of occlusion.
[0004] However, it is also difficult to annotate the blocked water gauge image, and actual measurements need to be made. Thus, the workload required to generate a sufficient number of annotated images is huge. Summary of the Invention
[0005] The embodiments of this application provide a method and system for intelligent recognition of visual water gauges, so as to achieve the effect of accurately recognizing the water level height in the case of occlusion without using an artificial intelligence algorithm model capable of recognizing occlusion.
[0006] The embodiments of this application provide a method for intelligent recognition of visual water gauges. The water gauge is installed in a river, a reference object is calibrated near the water gauge, the reference object is provided with a reference surface, the camera is installed near the water gauge, and there is a communication connection between the recognition system and the camera. The method is applied to the recognition system and includes:
[0007] Receiving the water gauge image captured by the camera, performing contour recognition on the water gauge image, determining the target object corresponding to the contour according to the pixel value, shape, and positional relationship of the contour-encircled area in the contour recognition result, and obtaining the contours of multiple target objects and the positional relationship between the contours of each target object; wherein, the target objects include: the water gauge contour, the water body contour, and the water plant contour;
[0008] Judging whether the water gauge is blocked according to the positional relationship between the contours of each target object, and obtaining the occlusion situation of the water gauge; wherein, the occlusion situation includes no occlusion, partial occlusion, and complete occlusion;
[0009] When the occlusion situation is no occlusion or partial occlusion, the water level height is obtained by identifying the overlapping contour area and the area where the water gauge is located; among them, the overlapping contour area is the contour area in the water body contour that coincides with the water gauge contour.
[0010] When the occlusion situation is complete occlusion, control the camera to rotate to a vertical angle so that the reference surface of the reference object is perpendicular to the optical axis of the camera; obtain the vertical image taken by the camera at the vertical angle, and identify the vertical image to obtain the water level height.
[0011] In the above technical solution, after the camera captures the water gauge image, by extracting the contour of the water gauge image and identifying the target object corresponding to the contour, the contour corresponding to the target object and the positional relationship between each contour are obtained. In this way, the occlusion situation of the water gauge can be determined according to the contour corresponding to the target object and the positional relationship between each contour, and the water level recognition strategy can be determined according to different occlusion situations. When there is partial occlusion or no occlusion, the relationship between the water surface and the water gauge can be determined, and the water level height can be determined according to this relationship. When there is complete occlusion, by taking a picture of the reference object at a vertical angle, the relationship between the water level and the reference object is determined to realize water level monitoring. The above solution does not need to use the labeled occlusion image to identify the artificial intelligence algorithm model, and the water level of the occlusion image can be identified without labeling a large number of occlusion images, reducing the difficulty of the recognition algorithm. And because it is taken at a vertical angle, there is no need for a complex conversion process when calculating the height, reducing the algorithm complexity.
[0012] In a possible implementation manner, it is judged whether the water gauge is occluded according to the positional relationship between the contours of each target object, and the occlusion situation of the water gauge is obtained, specifically including:
[0013] If it is determined that there is an overlap between the water gauge contour and the water body contour, and there is an overlap between the water gauge contour and the waterweed contour, the occlusion situation of the water gauge is partial occlusion;
[0014] If it is determined that there is an overlap between the water gauge contour and the water body contour, and there is no overlap between the water gauge contour and the waterweed contour, the occlusion situation of the water gauge is no occlusion;
[0015] If it is determined that there is no overlap between the water gauge contour and the water body contour, and there is an overlap between the water gauge contour and the waterweed contour, the occlusion situation of the water gauge is complete occlusion.
[0016] In the above technical solution, by using the occlusion characteristics between objects, that is, mutual occlusion must have overlapping contours in the image, and then judge whether the water gauge is completely occluded, partially occluded or not occluded by waterweeds. In this way, there is no need to use an artificial intelligence algorithm model to identify the water gauge image, and the water body contour can also be used to further identify the water level height. By using the intermediate quantity of water level height recognition for occlusion discrimination, the complexity of the recognition algorithm can be reduced.
[0017] In a possible implementation, when the occlusion situation is no occlusion or partial occlusion, the water level height is obtained by identifying the overlapping contour area and the area where the water gauge is located, specifically including:
[0018] If the occlusion situation is partial occlusion or no occlusion, the scale lines in the area where the water gauge is located are identified to obtain an identification result, and the pixel distance between the overlapping contour area and the nearest scale line area is obtained according to the identification result;
[0019] According to the identification result, the pixel distance between two scale lines and the scale difference between the two scale lines are obtained, and a first conversion parameter between the pixel distance and the actual distance is determined according to the pixel distance between the two scale lines and the scale difference between the two scale lines;
[0020] The difference between the water body contour and the nearest scale line is calculated according to the first conversion parameter and the pixel distance between the overlapping contour area and the nearest scale line area; the water level height is obtained according to the scale value corresponding to the nearest scale line and the difference between the water body contour and the nearest scale line.
[0021] In the above technical solution, by extracting the scale lines in the area where the water gauge is located, the areas where each scale line is located and the scale value of each scale line are obtained. The pixel distance between two scale lines and the scale difference between the two scale lines are obtained from the identification result, and the conversion relationship between the single-pixel distance and the actual distance is obtained by dividing the scale difference by the pixel distance. In this way, the pixel distance between the nearest scale area and the overlapping contour area is converted into the actual distance, and the water level height is determined based on the actual distance and the scale value corresponding to the nearest scale area. Since no additional calibration method is required when converting the pixel distance and the actual distance, the algorithm complexity can be reduced.
[0022] In a possible implementation, if the occlusion situation is partial occlusion or no occlusion, the scale lines in the area where the water gauge is located are identified to obtain an identification result, specifically including:
[0023] The number of pixels corresponding to each pixel value in the area where the water gauge is located is counted, and the pixel value with the number of pixels greater than the preset number threshold is selected as the alternative pixel value;
[0024] The current alternative pixel value is selected, and a rectangular area with the pixel value of the current alternative pixel value is extracted from the area where the water gauge is located;
[0025] It is judged whether the rectangular area meets the water gauge design rule. If so, the rectangular area is the area where a scale line is located; meeting the water gauge design rule includes that if there are 3 rectangular areas with the same size distributed at intervals, and the interval between any two rectangular areas is the width of the rectangular area;
[0026] Search and match the area where the water gauge is located according to the distribution of scale lines and the size of the area where the scale lines are located, and obtain all scale line areas in the area where the water gauge is located;
[0027] Determine the scale value corresponding to each scale line area according to the water gauge design data and the positional relationship of multiple scale line areas.
[0028] In the above technical solution, by counting the number of pixels corresponding to each pixel value in the area where the water gauge is located, the alternative pixel values of the scale lines are determined. In this way, for the analysis of the pixel values in the area where the water gauge is located, a rectangular area where the pixel values are all alternative pixel values is extracted, and it is judged whether there are 3 rectangular areas distributed at intervals, and the interval between any two rectangular areas is the width of the rectangular area, that is, it is determined whether the rectangular area conforms to the water gauge scale line design. If so, it is determined that the rectangular area is the area corresponding to a scale line. After determining the area where the scale line is located, by searching and matching all areas of the water gauge, the recognition of the scale lines in the area where the water gauge is located is realized. Subsequently, according to the relative positional relationship of the areas where the scale lines are located and the water gauge design data, the scale value corresponding to each scale line is determined.
[0029] In a possible implementation manner, a plurality of pressure sensors are arranged along the height direction inside the water gauge, and the water gauge image captured by the camera is received, specifically including:
[0030] Monitor the pressure values sensed by each pressure sensor;
[0031] If the pressure value sensed by the pressure sensor meets the stable monitoring requirement, generate a water gauge shooting instruction, and the water gauge shooting instruction controls the camera to shoot a water gauge image;
[0032] Receive the water gauge image sent by the camera;
[0033] Among them, the pressure value meeting the stable monitoring requirement specifically includes: there is a pressure value of a certain pressure sensor changing from less than the lower pressure limit value to greater than the upper pressure limit value; or, there is a pressure value of a certain pressure sensor changing from greater than the lower pressure limit value to less than the upper pressure limit value.
[0034] In the above technical solution, by monitoring the pressure values sensed by each pressure sensor, the monitoring of the water level change can be realized. Triggering the camera to shoot the corresponding image when the water level changes can reduce the amount of image acquisition, reduce the data processing amount of the recognition system, and reduce the occupancy of hardware resources by the recognition system.
[0035] In a possible implementation manner, after monitoring the pressure values sensed by each pressure sensor, the method further includes:
[0036] When the pressure value sensed by the pressure sensor meets the oscillation monitoring requirement, a reference object photographing instruction is generated, and the photographing instruction controls the camera to continuously photograph multiple frames of reference object images;
[0037] Identify the water level height in each frame of the reference object image, perform statistical analysis on multiple water level heights, and use the statistical result as the water level height;
[0038] Among them, the pressure value meeting the oscillation monitoring requirement specifically includes: the pressure value of a certain pressure sensor changes from less than the lower pressure limit value to greater than the upper pressure limit value, and then changes to less than the lower pressure limit value.
[0039] In the above technical solution, when the pressure value sensed by the pressure sensor meets the oscillation monitoring requirement, it means that the water surface waves are relatively large and the water level is unstable. The obstruction of the river channel slope to the large-area water body will not generate larger waves. The water gauge only affects a small area of water body and is more likely to cause larger waves. Photograph and monitor the water level under the condition of generating smaller waves to achieve more accurate measurement.
[0040] In a possible implementation manner, the method further includes:
[0041] Obtain the river water flow rate collected by the flow meter located in the river channel, and generate a water level change function according to the obtained water level heights at multiple moments and the river water flow rates at multiple moments;
[0042] Predict the water level height at a future moment according to the water level change function, and control the opening of the river channel gate when the water level height at the future moment is greater than the alarm height.
[0043] In the above technical solution, by real-time monitoring of the river channel water level and the river water flow rate, fitting the water level change function using the river water flow rate and the river channel water level, and predicting the water level height at a future moment according to the water level change function, the flood discharge timing can be determined according to the water level height, and the floodgate can be opened in time for flood discharge.
[0044] An embodiment of the present application provides a visual water gauge intelligent recognition system, including:
[0045] A receiving module, configured to receive the water gauge image photographed by the camera, perform contour recognition on the water gauge image, determine the contour corresponding target object according to the pixel value, shape, and positional relationship of the contour surrounded area in the contour recognition result, and obtain the contours of multiple target objects and the positional relationship between the contours of each target object; among them, the target object includes: water gauge contour, water body contour, and waterweed contour;
[0046] A processing module, configured to judge whether the water gauge is blocked according to the positional relationship between the contours of each target object, and obtain the occlusion situation of the water gauge; among them, the occlusion situation includes no occlusion, partial occlusion, and complete occlusion;
[0047] When the occlusion situation is no occlusion or partial occlusion, the processing module is further configured to identify the overlapping contour area and the area where the water gauge is located to obtain the water level height; wherein, the overlapping contour area is the contour area in the water body contour that overlaps with the water gauge contour.
[0048] When the occlusion situation is complete occlusion, the processing module is further configured to control the camera to rotate to a vertical angle so that the reference surface of the reference object is perpendicular to the optical axis of the camera; obtain a vertical image captured by the camera at the vertical angle, and identify the water level height from the vertical image.
[0049] An embodiment of the present application provides an electronic device, including: a memory and a processor;
[0050] The memory stores computer-executable instructions;
[0051] The processor executes the computer-executable instructions stored in the memory, so that the processor executes various possible implementation manners as above.
[0052] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement various possible implementation manners as above.
[0053] An embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements various possible implementation manners as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0055] Figure 1 It is a schematic diagram of the scenario of the visual water gauge intelligent recognition method provided by the present application;
[0056] Figure 2 It is a flowchart of the visual water gauge intelligent recognition method provided by some embodiments of the present application;
[0057] Figure 3 It is an image of an unoccluded water gauge provided by some embodiments of the present application;
[0058] Figure 4 It is an image of a partially occluded water gauge provided by some embodiments of the present application;
[0059] Figure 5 It is an image of a completely occluded water gauge provided by some embodiments of the present application;
[0060] Figure 6 It is a schematic diagram of the area where a water gauge is located;
[0061] Figure 7 It is a schematic structural diagram of a visual water gauge intelligent recognition system provided by some embodiments of the present application.
[0062] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Specific Embodiments
[0063] Here, exemplary embodiments will be described in detail, and examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0064] With the wide application of artificial intelligence technology, the use of artificial intelligence algorithm models to recognize water gauge images captured by cameras has been widely used. In order to enable the artificial intelligence algorithm model to recognize the true water level in the case where the water gauge is blocked, a large number of labeled blocked images are required. However, when labeling the blocked images, it is necessary to obtain them through on-site measurement in the actual scenario, so it is difficult to obtain the labeled blocked images. Furthermore, the workload required to generate a sufficient number of labeled images is huge.
[0065] To solve the above problems, the present application provides a visual intelligent recognition method and system. By extracting the contours of the target objects in the water gauge image, determining the occlusion situation according to the positional relationship between the contours of the target objects, in the case of partial occlusion or no occlusion, determining the water level height according to the relationship between the contour that coincides with the contour of the water gauge in the water body contour and the scale line. In the case of complete occlusion, the angle of the camera is adjusted to the vertical angle, a vertical image of the reference object is captured, and the relationship between the water level and the reference object in the vertical image is recognized, thereby obtaining the water level height. In this way, it is possible to achieve water level recognition in the case of occlusion without labeling the blocked water gauge, which can reduce the workload of labeling.
[0066] Figure 1 It is a schematic diagram of the scenario of the visual water gauge intelligent recognition method provided by the present application, as Figure 1As shown in the figure, the specific application scenario of this application is as follows: Install a water gauge near a reference object. For example, install a water gauge in the river near a sluice gate, and install a camera 100 near the water gauge to align the camera 100 with the water gauge to capture an image of the water gauge. The camera 100 sends the water gauge image to a visual water gauge intelligent recognition system 200 (hereinafter referred to as the recognition system). The recognition system 200 recognizes the water gauge image to obtain the water level height. In addition, after determining that the water gauge is completely blocked, control the camera 100 to adjust the vertical angle and then take an image, and recognize the relationship between the water level and the reference object in the vertical image, so as to obtain the water level height.
[0067] The following uses specific embodiments to elaborate in detail on the technical solution of this application and how the technical solution of this application solves the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0068] Figure 2 It is a schematic flowchart of a visual water gauge intelligent recognition method provided by some embodiments of this application. As Figure 2 shown, this method specifically includes:
[0069] S101. The recognition system receives the water gauge image captured by the camera, performs contour recognition on the water gauge image, determines the target type according to the pixel values of the contour enclosing area, the shape of the contour enclosing area, and the positional relationship between the contour enclosing areas, and obtains the contours of multiple target objects and the positional relationship between the contours of each target object.
[0070] Among them, the camera captures the water gauge image and sends the water gauge image to the recognition system. The recognition system performs gray conversion on the water gauge image to obtain the gray value of the water gauge image. Perform binary processing on the gray value of the water gauge image, and use a contour detection function to process the binary processed water gauge image to obtain multiple contours and the positional relationship between each contour.
[0071] For each contour, obtain the pixel values of the contour enclosing area, the shape of the contour enclosing area, and the positional relationship between each contour enclosing area from the water gauge image. Perform target category recognition according to the pixel values of the contour enclosing area, the shape of the contour enclosing area, and the positional relationship between each contour enclosing area.
[0072] Among them, the contours of the target objects include various combinations of water gauge contours, water body contours, and waterweed contours. The shape of the contour enclosing area of the water gauge contour is a slender strip shape, and the pixel values of the contour enclosing area of the water gauge contour have two colors, one is the color of the water gauge main body, and the other is the color of the scale line. The water gauge can be determined according to the shape of the contour enclosing area and the pixel values within the enclosing area.
[0073] Waterweeds are usually green, and the waterweeds can be determined according to the pixel values of the pixels surrounding the area. If the water body is near the water gauge and below the water gauge, the water body can be determined according to the positional relationship.
[0074] S102. The recognition system determines whether the water gauge is blocked according to the positional relationship between the contours of each target object, and obtains the occlusion situation of the water gauge; the occlusion situation includes no occlusion, partial occlusion, and complete occlusion.
[0075] Among them, it is determined whether there is an overlapping relationship between the contour of the water gauge and the contour of the water body, and whether there is an overlapping relationship between the contour of the water gauge and the contour of the waterweeds. The occlusion situation of the water gauge is determined according to whether there is an overlapping relationship between the contour of the water gauge and the contour of the water body, and whether there is an overlapping relationship between the contour of the water gauge and the contour of the waterweeds.
[0076] More specifically, Figure 3 For the water gauge image without occlusion provided by some embodiments of the present application, as Figure 3 shown, there is an overlapping relationship between the contour of the water gauge and the contour of the water body, but there is no overlapping relationship between the contour of the water gauge and the contour of the waterweeds, then it is determined that the water gauge is not occluded.
[0077] Figure 4 For the water gauge image with partial occlusion provided by some embodiments of the present application, as Figure 4 shown, there is an overlapping relationship between the contour of the water gauge and the contour of the water body, and there is an overlapping relationship between the contour of the water gauge and the contour of the waterweeds, then it is determined that the water gauge is partially occluded.
[0078] Figure 5 For the water gauge image with complete occlusion provided by some embodiments of the present application, as Figure 5 shown, there is no overlapping relationship between the contour of the water gauge and the contour of the water body, but there is an overlapping relationship between the contour of the water gauge and the contour of the waterweeds, then it is determined that the water gauge is completely occluded.
[0079] In the above technical solution, by using the occlusion characteristics between objects, that is, mutual occlusion necessarily results in overlapping contours in the image, and then determining whether the water gauge is completely occluded, partially occluded or not occluded by waterweeds. In this way, there is no need to use an artificial intelligence algorithm model to identify the water gauge image, and the contour of the water body can also be used to further identify the water level height. By using the intermediate quantity of water level height recognition for occlusion discrimination, the complexity of the recognition algorithm can be reduced.
[0080] In other words, the above technical solution has the following technical effects:
[0081] Directly utilize the image contour information to improve the occlusion judgment efficiency: In this embodiment, the positional relationship between the water gauge contour, the water body contour, and the waterweed contour is directly utilized. By judging whether these contours overlap, the occlusion situation of the water gauge is determined. Without complex image processing and artificial intelligence algorithm models, directly based on the contour information of the image itself, the occlusion judgment efficiency is significantly improved.
[0082] Precisely distinguish the occlusion situation and enhance the recognition accuracy: By carefully distinguishing the overlapping situations between the water gauge contour and the water body contour, and the waterweed contour, this embodiment can accurately judge whether the water gauge is completely occluded, partially occluded, or not occluded by the waterweed. This refined discrimination method enhances the recognition accuracy and provides a reliable basis for subsequent water level recognition strategies.
[0083] Reduce the algorithm complexity and improve the system performance: Compared with using artificial intelligence algorithm models to recognize occluded images, this embodiment can realize the recognition of the occlusion situation through simple contour overlap judgment, greatly reducing the algorithm complexity. This not only reduces the consumption of computing resources but also improves the overall performance of the system, enabling it to respond and process image data more quickly.
[0084] Additional utilization of the water body contour to enhance the system versatility: While judging the occlusion situation, this embodiment also retains the information of the water body contour. This information can not only be used to further identify the water level height but also provide data support for other related applications (such as water flow velocity estimation, water quality monitoring, etc.). This design of versatility enhances the practicality and flexibility of the system.
[0085] Strong adaptability and applicable to various water area environments: This embodiment does not depend on a specific water area environment or water gauge type. As long as there are recognizable target objects such as water gauges, water bodies, and waterweeds in the water area, this method can be applied to perform occlusion judgment and water level recognition.
[0086] S103. When the occlusion situation is no occlusion or partial occlusion, the recognition system recognizes the overlapping contour area and the area where the water gauge is located to obtain the water level height.
[0087] Among them, when it is determined that the occlusion situation is no occlusion or partial occlusion, that is, the relative positional relationship between the water surface and the water gauge can be obtained in the water gauge image.
[0088] The overlapping contour area is the contour area in the water body contour that overlaps with the water gauge contour. By identifying which scale line in the overlapping contour area aligns with the water gauge, the water level height can be obtained. More specifically, the recognition system performs scale line recognition on the area where the water gauge is located to obtain the area where the scale line is located, calculates the relationship between the overlapping contour area and the area where the scale line is located, and obtains the water level height.
[0089] S104. If the occlusion situation is complete occlusion, control the camera to rotate to the vertical angle so that the reference plane of the reference object is perpendicular to the optical axis of the camera. Obtain the vertical image captured by the camera at the vertical angle, and obtain the water level height based on the vertical image.
[0090] Among them, if the occlusion situation is complete occlusion, control the camera to capture an image of the reference object. When capturing the reference object, rotate the shooting angle of the camera so that the reference plane of the reference object is perpendicular to the optical axis of the camera.
[0091] When calculating the water level height based on the vertical image, obtain the position of the water level on the reference plane, and through the conversion of the pitch angle of the camera, the water level height can be obtained. When calculating the water level height based on the reference object in the vertical image, there is no need for a complex conversion process, reducing the algorithm complexity.
[0092] In the above technical solution, after the camera captures the water gauge image, by extracting the contour of the water gauge image and identifying the target object corresponding to the contour, obtain the contour corresponding to the target object and the positional relationship between each contour. In this way, the occlusion situation of the water gauge can be determined according to the contour corresponding to the target object and the positional relationship between each contour, and the water level recognition strategy can be determined according to different occlusion situations. When there is partial occlusion or no occlusion, the relationship between the water surface and the water gauge can be determined, and the water level height can be determined according to this relationship. When there is complete occlusion, by taking a picture of the reference object at the vertical angle, determine the relationship between the water level and the reference object to achieve water level monitoring. The above solution does not need to use the labeled occluded image to identify the artificial intelligence algorithm model, and the water level of the occluded image can be identified without labeling a large number of occluded images, reducing the difficulty of the recognition algorithm. And because it is captured at the vertical angle, there is no need for a complex conversion process when calculating the height, reducing the algorithm complexity.
[0093] In other words, the above solution has the following specific technical effects:
[0094] Efficient and accurate target object recognition: By receiving the water gauge image captured by the camera and performing contour recognition on the image, target objects such as the water gauge contour, water body contour, and waterweed contour can be accurately recognized. This step is based on the pixel values, shapes, and positional relationships of the regions surrounded by the contours, ensuring the accuracy and efficiency of target object recognition.
[0095] Intelligent occlusion situation judgment: According to the positional relationship between the contours of each identified target object, it is possible to intelligently judge whether the water gauge is occluded and the specific occlusion situation (no occlusion, partial occlusion, complete occlusion). This function provides a key basis for the subsequent water level recognition strategy, improving the flexibility and adaptability of recognition.
[0096] Adaptive water level height recognition strategy: Different water level recognition strategies are adopted for different occlusion situations. When there is no occlusion or partial occlusion, the water level height is directly calculated by identifying the relationship between the overlapping contour area and the area where the water gauge is located; when there is complete occlusion, the camera is controlled to rotate to a vertical angle to capture a vertical image of the reference object, and then the water level height is recognized. This adaptive strategy effectively copes with complex and changeable occlusion situations, ensuring the accuracy and reliability of water level recognition.
[0097] Reduce annotation cost and workload: There is no need to use annotated occlusion images to train the artificial intelligence algorithm model, thus avoiding a large amount of annotation work. This not only reduces the annotation cost and workload, but also improves the practicality and universality of the recognition algorithm.
[0098] Simplify the height calculation process: In the case of complete occlusion, by capturing an image of the reference object at a vertical angle, the relative height between the water level and the reference object can be directly calculated without complex image conversion or geometric calculations. This step simplifies the height calculation process, reduces the algorithm complexity, and improves the calculation efficiency.
[0099] Improve the real-time performance and accuracy of water level monitoring: By receiving and processing the water gauge images captured by the camera in real time, real-time monitoring of water level changes can be achieved. At the same time, through intelligent recognition of occlusion situations and adaptive water level recognition strategies, the accuracy and reliability of water level monitoring are ensured. This provides strong technical support for water resource management and flood control and disaster reduction work.
[0100] In a possible implementation manner, S103, when the occlusion situation is no occlusion or partial occlusion, identify the overlapping contour area and the area where the water gauge is located to obtain the water level height, specifically including:
[0101] S201, if the occlusion situation is partial occlusion or no occlusion, identify the scale lines in the area where the water gauge is located to obtain the recognition result. According to the recognition result, obtain the pixel distance between the overlapping contour area and the nearest scale line area.
[0102] Among them, if the occlusion situation is partial occlusion or no occlusion, obtain the pixel values of each column of pixel points in the area where the water gauge is located. Analyze the pixel value distribution of each pixel point in the area where the water gauge is located, and determine the area where the scale line is located according to the pixel value distribution situation.
[0103] For each scale line area, calculate the pixel distance between the scale line area and the overlapping contour area, and select the one with the shortest pixel distance as the pixel distance between the overlapping contour area and the nearest scale line area. Take this scale line area as the nearest scale line area.
[0104] S202. Obtain the pixel distance between two scale lines and the scale difference between the two scale lines according to the recognition result, and determine the first conversion parameter between the pixel distance and the actual distance based on the pixel distance between the two scale lines and the scale difference between the two scale lines.
[0105] Obtain the pixel distance between two scale lines from the recognition result, as well as the scale difference between the two scale lines, and divide the scale difference by the pixel distance to obtain the first conversion parameter representing the actual distance corresponding to the unit pixel distance.
[0106] S203. Calculate the difference between the water body contour and the nearest scale line according to the first conversion parameter and the pixel distance between the overlapping contour region and the nearest scale line region; obtain the water level height according to the scale value corresponding to the nearest scale line and the difference between the water body contour and the nearest scale line.
[0107] Among them, calculate the product of the first conversion parameter and the pixel distance between the overlapping contour region and the nearest scale line region, and use the product result as the difference between the water body contour and the nearest scale line. Calculate the sum of the scale value corresponding to the nearest scale line and the difference between the water body contour and the nearest scale line to obtain the water level height.
[0108] In the above technical solution, by extracting the scale lines in the area where the water gauge is located, obtain the area where each scale line is located and the scale value of each scale line. Obtain the pixel distance between two scale lines from the recognition result, as well as the scale difference between the two scale lines, and divide the scale difference by the pixel distance to obtain the conversion relationship between the single pixel distance and the actual distance. In this way, the pixel distance between the nearest scale region and the overlapping contour region is converted into the actual distance, and the water level height is determined based on the actual distance and the scale value corresponding to the nearest scale region. Since no additional calibration method is required when converting the pixel distance and the actual distance, the algorithm complexity can be reduced.
[0109] In other words, the above solution has the following specific technical effects:
[0110] Directly utilize the scale line recognition result to improve the water level calculation accuracy: When the occlusion situation is partial occlusion or no occlusion, this embodiment directly performs scale line recognition on the area where the water gauge is located, and obtains the pixel distance between the overlapping contour region and the nearest scale line region from the recognition result. This method avoids the difficulty of scale line recognition caused by occlusion in the traditional method, thereby improving the accuracy of water level calculation.
[0111] Based on the pixel distance conversion of the scale line interval, simplify the calculation process: By obtaining the pixel distance between two scale lines and the corresponding scale difference, this embodiment calculates the first conversion parameter between the pixel distance and the actual distance. This conversion parameter enables subsequent water level calculations to be directly based on the pixel distance, without additional calibration or conversion steps, simplifying the calculation process.
[0112] No additional calibration is required, reducing the algorithm complexity: Compared with traditional methods, in this embodiment, no additional calibration method is needed when converting pixel distance to actual distance. This not only reduces the workload of calibration work but also lowers the algorithm complexity, making the entire water level recognition process more efficient and reliable.
[0113] Improve the real-time performance and automation level of water level recognition: Since this embodiment avoids complex calibration and conversion steps, the water level recognition process becomes faster and more efficient. At the same time, the automated water level recognition process reduces the need for manual intervention, improving the real-time performance and automation level of the system.
[0114] Strong adaptability, applicable to various water gauge types and environmental conditions: This embodiment does not depend on specific water gauge types or environmental conditions. As long as there are recognizable scale lines on the water gauge, this method can be applied for water level recognition. This wide adaptability enables this method to play a role in a variety of practical application scenarios.
[0115] In some embodiments, S201. If the occlusion situation is partial occlusion or no occlusion, perform scale line recognition on the area where the water gauge is located to obtain the recognition result, specifically including:
[0116] S301. Count the number of pixels corresponding to each pixel value in the area where the water gauge is located, and select the pixel values with the number of pixels greater than the preset number threshold as candidate pixel values.
[0117] Among them, the preset number threshold is determined according to the total number of pixels in the area where the water gauge is located. Since the water gauge contains two main colors, the water gauge background color and the scale line color, and the pixel values correspond to the colors on the water gauge, by counting the number of pixels corresponding to each pixel value, select the pixel values with a relatively large number of pixels as candidate pixel values for scale line area extraction.
[0118] S302. Select the current candidate pixel value, and extract a rectangular area from the area where the water gauge is located where the pixel values are all the current candidate pixel value.
[0119] Among them, select one from multiple candidate pixel values as the current candidate pixel value, analyze the pixel values of each pixel in the area where the water gauge is located, and extract a rectangular area from the area where the water gauge is located where the pixel values are all the current candidate pixel value according to the analysis result.
[0120] S303. Determine whether the rectangular area meets the water gauge design rules. If there are 3 rectangular areas with the same size distributed at intervals, and the interval between any two rectangular areas is the width of the rectangular area, then this rectangular area is an area where a scale line is located. If not, enter S306.
[0121] Among them, the distribution of rectangular regions is statistically analyzed to determine whether there are three rectangular regions with the same size that are spaced apart, and the interval between any two rectangular regions is the width of the rectangular region. If there are three rectangular regions with the same size that are spaced apart, and the interval between any two rectangular regions is the width of the rectangular region, then the rectangular region is the region where a scale line is located.
[0122] S304. Search and match the region where the water gauge is located according to the distribution of scale lines and the size of the region where the scale lines are located, and obtain all scale line regions in the region where the water gauge is located.
[0123] Among them, the distribution of scale lines is determined according to the water gauge design data. The search direction is determined according to the distribution of scale lines.
[0124] The next matching region is determined according to the current matching region and the search direction, and it is judged whether there is a continuous region that meets the conditions in the next matching region. Meeting the conditions means that the size of the continuous region is the size of the region where the scale line is located, and all pixel values in the continuous region are the pixel values of the pixels in the region where the scale value is located. If there is a continuous region that meets the conditions, then this region is the region where the scale line is located. Through the above method, the scale line recognition efficiency can be improved.
[0125] Among them, Figure 6 is a schematic diagram of the region where the water gauge is located. As Figure 6 shown, the pixel values of the region where the water gauge is located are statistically analyzed. There are two kinds of pixel values, one is represented by blank filling, and the other is represented by grid filling. The rectangular pixel regions filled with grids are extracted from the region where the water gauge is located. There are three sizes of rectangular pixel regions, and only the rectangular pixel region with a size of 2×7 meets the conditions, that is, there are three rectangular regions with the same size that are spaced apart, and the interval between any two rectangular regions is the width of the rectangular region. The size of a scale line is determined to be a region of 2×7. And search in the region where the water gauge is located with the region of 2×7 as a template, and extract all the regions where the scale lines are located in the region where the water gauge is located.
[0126] S305. Determine the scale value corresponding to each scale line region according to the water gauge design data and the positional relationship of multiple scale line regions.
[0127] For example: The total range of the water gauge is 10m. According to the water gauge design data, the difference between two adjacent but non - connected scale lines is 0.2m, and the difference between two adjacent and connected scale lines is 0.1m.
[0128] The top - most scale line is 10m. The second scale line is two rows of pixels different from the top - most scale line. The second scale line is 9.8. The third scale line is two rows of pixels different from the second scale line. The third scale line is 9.6.
[0129] The 4th scale line is connected to the 3rd scale line, and the 4th scale line is 9.5. The 5th scale line is two rows of pixels different from the 4th scale line, and the 5th scale line is 9.3. The 6th scale line is two rows of pixels different from the 5th scale line, and the 6th scale line is 9.1. The 7th scale line is connected to the 6th scale line, and the 7th scale line is 9.0.
[0130] S306. If there are no three rectangular regions distributed at intervals, update the current alternative pixel value and return to S302.
[0131] Among them, if the rectangular region under the current alternative pixel value does not meet the conditions, continue to update the current alternative pixel value and continue to judge whether the new rectangular region meets the conditions.
[0132] In the above technical solution, by counting the number of pixels corresponding to each pixel value in the area where the water gauge is located, the alternative pixel values of the scale lines are determined. In this way, the pixel values in the area where the water gauge is located can be analyzed, improving the algorithm efficiency. Extract the rectangular regions with pixel values all being alternative pixel values, and judge whether there are three rectangular regions distributed at intervals, and the interval between any two rectangular regions is the width of the rectangular region, that is, determine whether the rectangular region meets the water gauge scale line design. If so, determine that the rectangular region corresponds to the area of one scale line. After determining the area where the scale line is located, by searching and matching all areas of the water gauge, the scale lines in the area where the water gauge is located are identified. Subsequently, according to the relative position relationship of the areas where the scale lines are located and the water gauge design data, the scale value corresponding to each scale line is determined.
[0133] In other words, the above solution has the following specific technical effects:
[0134] Improve the accuracy and robustness of scale line recognition: By counting the number of pixels corresponding to each pixel value in the area where the water gauge is located and selecting the pixel value with the number of pixels greater than the preset number threshold as the alternative pixel value, this step effectively filters out noise and interference, improving the accuracy of subsequent scale line recognition. At the same time, this method has strong robustness to different lighting conditions and image quality and can work stably in complex environments.
[0135] Intelligently extract the scale line area: Select the current alternative pixel value and extract the rectangular regions with pixel values all being the current alternative pixel value from the area where the water gauge is located. This step intelligently locates the possible scale line areas. By further judging whether these rectangular regions meet the water gauge design rules (such as the existence of three rectangular regions with the same size distributed at intervals and the interval being the width of the rectangular region), the area where the scale line is located can be accurately identified. This method avoids the limitations of manually setting thresholds or template matching in traditional methods and improves the intelligent level of recognition.
[0136] Full search and matching to ensure the integrity of scale line recognition: After determining the basic features of the area where the scale lines are located, all scale line areas can be obtained by comprehensively searching and matching the area where the water gauge is located. This step ensures the integrity of scale line recognition and avoids omissions or misidentifications.
[0137] Precisely determine the scale values to improve the accuracy of water level calculation: Based on the design data of the water gauge and the positional relationship of multiple scale line areas, the scale value corresponding to each scale line area can be precisely determined. This step provides accurate data support for subsequent water level calculations, improving the accuracy and reliability of water level calculations.
[0138] In a possible implementation manner, a reference line is provided on the reference plane. S104. Obtain the vertical image captured by the camera at a vertical angle, and obtain the water level height according to the vertical image, specifically including:
[0139] S401. Extract the pixel distance between the water level and the lower reference line, and the pixel distance between the upper reference line and the lower reference line from the vertical image. According to the designed distance between the upper reference line and the lower reference line and the pixel distance between the upper reference line and the lower reference line, calculate the second conversion parameter between the pixel distance and the actual distance.
[0140] Among them, use the contour recognition algorithm to extract multiple contours in the vertical image, and determine the target type corresponding to the contour enclosing area according to the shape of the contour enclosing area, the positional relationship of the contour enclosing area, and the pixel values within the contour enclosing area.
[0141] For example: The reference object is a bridge pier. The bridge pier is columnar and is located above the water body. A plane on the bridge pier is used as the reference plane, and the reference line can be drawn in yellow or red on the bridge pier. The reference line can be located first, and the reference plane can be located through the reference line.
[0142] Through the above method, the area where the water body is located, the area where the reference object is located, the area where the reference plane in the reference object is located, the area where the upper reference line is located, and the area where the lower reference line is located can be obtained from the vertical image.
[0143] Extract the contour area close to the lower reference line from the contour line of the area where the water body is located. According to the position of the contour area close to the lower reference line and the position of the lower reference line, calculate the pixel distance between the contour area close to the lower reference line and the lower reference line. Use the pixel distance between the contour area close to the lower reference line and the lower reference line as the pixel distance between the water level and the lower reference line, and calculate the pixel distance between the upper reference line and the lower reference line. Divide the designed distance between the upper reference line and the lower reference line by the pixel distance between the upper reference line and the lower reference line to obtain the second conversion parameter.
[0144] S402. Calculate the actual distance between the water level and the lower reference line based on the pixel distance between the water level and the lower reference line and the second conversion parameter, and calculate the height difference between the water level and the lower reference line based on the actual distance between the water level and the lower reference line and the pitch angle of the camera.
[0145] Among them, calculate the product of the pixel distance between the water level and the lower reference line and the second conversion parameter to obtain the actual distance between the water level and the reference line, and calculate the cosine value of the actual distance between the water level and the lower reference line and the pitch angle of the camera to obtain the height difference between the water level and the reference object.
[0146] S403. Determine the water level height based on the height difference between the water level and the lower reference line and the scale line value corresponding to the lower reference line stored locally.
[0147] Among them, obtain the scale value corresponding to the lower reference line through on-site surveying and mapping. By calculating the sum of the height difference between the water level and the lower reference line and the scale line value corresponding to the lower reference line stored locally, the height value of the water level on the water gauge can be determined.
[0148] In the above technical solution, after the water gauge is completely blocked, by taking a vertical image of the reference object, identifying the area where the water body is located, the area where the upper reference line is located, and the area where the lower reference line is located in the vertical image, the pixel distance between the water level and the lower reference line, as well as the pixel distance between the upper reference line and the lower reference line, can be further obtained. According to the designed distance between the upper and lower reference lines and the pixel distance between the upper and lower reference lines, the actual distance per unit pixel distance is determined. In this way, the pixel distance between the water body and the lower reference line is converted into the actual distance, and through angle conversion, the height difference between the water body and the lower reference line can be obtained. Finally, according to the relationship between the lower reference line and the scale line of the water gauge, the height of the water body on the water gauge can be obtained. In this way, the water level height can be accurately obtained under the completely blocked condition. The above solution does not need to use the labeled blocked image to identify the artificial intelligence algorithm model, and the water level of the blocked image can be identified without labeling a large number of blocked images, reducing the difficulty of the recognition algorithm.
[0149] In other words, the above solution has the following specific technical effects:
[0150] Directly use the vertical image to realize the water level height measurement under the completely blocked condition: When the water gauge is completely blocked, in this embodiment, by taking a vertical image of the reference object, the information in the image is directly used to calculate the water level height. This method avoids the recognition difficulty caused by the blockage of the water gauge and realizes the accurate measurement of the water level height under the completely blocked condition.
[0151] Pixel distance conversion based on the designed distance of the reference line to improve measurement accuracy: By extracting the pixel distance between the water level and the lower reference line in the vertical image, as well as the pixel distance between the upper reference line and the lower reference line, and combining the designed distances of the upper and lower reference lines, this embodiment calculates the second conversion parameter between the pixel distance and the actual distance. This conversion parameter enables subsequent calculation of the water level height to be directly based on the pixel distance, improving the measurement accuracy.
[0152] Considering the camera pitch angle to achieve height difference calculation in three-dimensional space: After calculating the actual distance between the water level and the lower reference line, this embodiment also considers the camera pitch angle and calculates the height difference between the water level and the lower reference line through angle conversion. This step converts the two-dimensional image information into height information in three-dimensional space, making the measurement result more in line with the actual situation.
[0153] Combining local stored data to quickly determine the water level height: According to the height difference between the water level and the lower reference line and the scale value corresponding to the lower reference line stored locally, this embodiment can quickly determine the water level height. This method does not require additional data query or calculation steps, improving the measurement efficiency and real-time performance.
[0154] Improving the adaptability and reliability of the system: This embodiment does not depend on a specific type of water gauge or environmental conditions. As long as there is a reference line on the reference surface and the camera can capture a vertical image, this method can be applied to measure the water level height. This wide adaptability enables this method to play a role in a variety of actual application scenarios, improving the reliability and stability of the system.
[0155] In a possible implementation manner, there is no reference line on the reference surface, the reference object is the river slope, the reference surface is the river slope surface. S104. Obtain a vertical image captured by the camera at a vertical angle, and obtain the water level height according to the vertical image, specifically including:
[0156] S501. Extract the area where the water body is located from the vertical image, obtain the pixel height of the area where the water body is located in the observation direction, and use the pixel height to look up the mapping relationship table to obtain the water level height.
[0157] Among them, the change of the river water rise and fall in the image is the change of the pixel height of the area where the water body is located. By fixing the shooting angle, controlling the optical axis of the camera to be perpendicular to the river slope surface, shooting the observation images at different water levels, and analyzing the height change of the area where the water body is located in the observation images, a mapping relationship between the pixel height and the water level height is generated.
[0158] Since the area where the water body is located is usually irregular in shape, an observation direction can be set. When analyzing each observation image, the pixel height of the area where the water body is located along the observation direction is extracted to generate the mapping relationship between the pixel height and the water level height. For example, the direction along the extension direction of the pixel column is selected as the observation direction, or the direction with a fixed angle to the extension direction of the pixel column is selected as the observation direction.
[0159] Use the contour recognition algorithm to extract multiple contours in the vertical image, and determine the target object corresponding to the contour-enclosed area according to the shape of the contour-enclosed area, the positional relationship of the contour-enclosed areas, and the pixel values within the contour-enclosed area. In this way, the area where the water body is located and the area where the reference object is located are obtained from the vertical image.
[0160] Obtain the locally stored observation direction, and obtain the pixel height of the area where the water body is located from the area where the water body is located along the observation direction. Use the pixel height to look up the mapping relationship table to obtain the water level height.
[0161] In the above technical solution, the change of the rise and fall of the river water in the image is the change of the pixel height of the area where the water body is located. By fixing the shooting angle, the river water images at different water levels are taken, and the height change of the area where the water body is located in the river water image is analyzed to generate the mapping relationship between the pixel height and the water level height. After the water gauge is completely blocked, the water level height can be obtained by observing the pixel height of the area occupied by the water body in the vertical image. The above solution does not need to use the labeled occluded images to identify the artificial intelligence algorithm model, and the water level of the occluded image can be identified without labeling a large number of occluded images, reducing the difficulty of the recognition algorithm.
[0162] In other words, the above solution has the following specific technical effects:
[0163] Flexible application without relying on reference lines: This implementation does not rely on the reference lines on the reference surface, but obtains the water level height by directly analyzing the pixel height of the area where the water body is located in the vertical image. This enables the method to be flexibly applied without a preset reference line, improving the adaptability and flexibility of the system.
[0164] Direct measurement based on pixel height: By extracting the area where the water body is located from the vertical image and obtaining its pixel height along the observation direction, this method realizes the direct measurement of the water level height. This method avoids the complex steps of identifying scale lines or reference lines in traditional methods and simplifies the measurement process.
[0165] Quickly determine the water level height using the mapping relationship table: Using the pre-generated mapping relationship table between the pixel height and the water level height, this method can quickly and accurately determine the water level height according to the pixel height of the area where the water body is located in the vertical image. This method does not require complex calculations or recognition algorithms, improving the efficiency and accuracy of the measurement.
[0166] Improve the real-time performance and accuracy of monitoring: By taking pictures of the river water images at different water levels from a fixed shooting angle and generating a mapping relationship table between the pixel height and the water level height, this method can still maintain the real-time performance and accuracy of monitoring even when the water gauge is completely blocked. This is of great significance for flood control, disaster relief, water resource management and other fields.
[0167] The visual water gauge intelligent recognition method provided by some other embodiments of this application specifically includes the following steps:
[0168] S601. Monitor the pressure values sensed by each pressure sensor.
[0169] Among them, pressure sensors are laid inside the water gauge, and the pressure sensors are laid along the height. When the water level increases, the water pressure on the part of the water gauge immersed in water is different, and the deeper the depth, the greater the water pressure. The pressure sensors laid on the part of the water gauge immersed in water can sense the water pressure. The pressure sensors exposed in the air on the water gauge are not affected by water pressure, so they will not sense pressure values.
[0170] The rise of the water level will cause some pressure sensors to change from not sensing pressure values to sensing water pressure. The fall of the water level will cause some pressure sensors to change from sensing water pressure to not sensing pressure values. By monitoring the pressure values sensed by each pressure sensor, the monitoring of the water level change can be realized.
[0171] S602. Judge whether the pressure value meets the stable monitoring requirement. If so, generate a shooting instruction, and the shooting instruction controls the camera to take a picture of the water gauge. If not, go to S607.
[0172] Among them, the pressure value meeting the stable monitoring requirement specifically includes: there is a pressure value of a certain pressure sensor changing from less than the lower pressure limit value to greater than the upper pressure limit value; or, there is a pressure value of a certain pressure sensor changing from greater than the lower pressure limit value to less than the upper pressure limit value.
[0173] If there is a pressure value of a certain pressure sensor changing from less than the lower pressure limit value to greater than the upper pressure limit value, it means that the water level is rising and the pressure sensor changes from not sensing pressure values to sensing water pressure. If there is a pressure value of a certain pressure sensor changing from greater than the lower pressure limit value to less than the upper pressure limit value, it means that the water level is falling and the pressure sensor changes from sensing water pressure to not sensing pressure values.
[0174] If the pressure value sensed by the pressure sensor meets the monitoring requirement, it is determined that the water level has changed, triggering the camera to take a picture of the water gauge and monitoring the rise and fall of the water level.
[0175] In the above solution, by monitoring the pressure values sensed by each pressure sensor, the system can perceive the change of water level in real time. When the water level rises or falls, the corresponding pressure sensor will detect the change of pressure value, so as to realize the real-time monitoring of the water level change. When the pressure value of the pressure sensor meets the stable monitoring requirement (that is, the pressure value of a certain pressure sensor changes from less than the lower pressure limit value to greater than the upper pressure limit value, or from greater than the lower pressure limit value to less than the upper pressure limit value), the system will generate a water gauge shooting instruction to control the camera to shoot the water gauge image. This intelligent triggering mechanism avoids unnecessary image acquisition, reduces the amount of image data, and improves the efficiency of the system. Since the camera is only triggered to shoot images when the water level changes, the amount of image data that the system needs to process is greatly reduced. This reduces the data processing burden of the recognition system, enabling the system to respond and process new image data more quickly. By reducing the amount of image acquisition and data processing, this embodiment also optimizes the utilization of hardware resources. The system no longer needs to continuously process a large amount of image data, thus reducing the burden on the computing device and storage device and extending the service life of the device. Since images are only taken when the water level changes, the system can more accurately capture the critical moment of the water level change. This helps to improve the accuracy and efficiency of water level recognition, enabling the system to provide more reliable water level data support.
[0176] S603. The recognition system receives the water gauge image taken by the camera, performs contour recognition on the water gauge image, determines the target type according to the pixel values of the contour-enclosed area, the shape of the contour-enclosed area, and the positional relationship between the contour-enclosed areas, and obtains the contours of multiple target objects and the positional relationship between the contours of each target object.
[0177] S604. The recognition system determines whether the water gauge is blocked according to the positional relationship between the contours of each target object, and obtains the occlusion situation of the water gauge; the occlusion situation includes no occlusion, partial occlusion, and complete occlusion.
[0178] S605. If the occlusion situation is no occlusion or partial occlusion, the recognition system recognizes the overlapping contour area and the area where the water gauge is located to obtain the water level height.
[0179] S606. If the occlusion situation is complete occlusion, control the camera to rotate to the vertical angle so that the reference surface of the reference object is perpendicular to the optical axis of the camera; obtain the vertical image taken by the camera at the vertical angle, and obtain the water level height according to the vertical image, and the vertical image includes the reference object.
[0180] S607. Judge whether the pressure value meets the oscillation monitoring requirement. If so, generate a shooting instruction for the river channel slope, and the shooting instruction controls the camera to continuously shoot multiple frames of river channel slope images.
[0181] Among them, the pressure value meeting the oscillation monitoring requirements specifically includes: there exists a pressure value of a certain pressure sensor that changes from being less than the lower pressure limit value to being greater than the upper pressure limit value, and then changes to be less than the lower pressure limit value, that is, the pressure value shows an oscillating change.
[0182] When it is determined that the pressure value of a certain pressure sensor shows an oscillating change, it indicates that the waves on the water surface are relatively large. The large - area blockage of the water body by the river channel slope is not likely to cause larger splashes. The small - area blockage of the water body by the water gauge is likely to cause larger splashes. When it is determined that the waves on the water surface are relatively large, the water level monitoring is achieved by monitoring the water level change on the river channel slope.
[0183] S608. Identify the water level height in each frame of the river channel slope image, conduct statistical analysis on multiple water level heights, and use the statistical result as the water level height.
[0184] Among them, there are upper reference line and lower reference line set on the river channel slope, and the second conversion parameter is obtained through the upper and lower reference lines. By performing contour recognition on the river channel slope image, according to the shape of the area surrounded by each contour, the positional relationship of the areas surrounded by the contours, and the pixel values of the areas surrounded by the contours, target type recognition is performed on the areas surrounded by the contours to obtain the water body area, the river channel slope area, the upper reference line area, and the lower reference line area. The height of the water level relative to the lower reference line is obtained according to the pixel distance between the contour line of the water body area and the lower reference line area and the second conversion parameter, and then the actual water level height is obtained based on the actual height of the lower reference line.
[0185] Identify the water level height in each frame of the river channel slope image, conduct statistical analysis on multiple water level heights, obtain the peak water level height and the trough water level height, and calculate the average value of the peak water level height and the trough water level height as the actual water level height.
[0186] In the above - mentioned technical solution, when the pressure value sensed by the pressure sensor meets the oscillation monitoring requirements, it indicates that the water surface splashes are relatively large and the water level is unstable. Since the water gauge blocks the water flow and is likely to cause larger splashes, the water level height cannot be accurately obtained through the water gauge. Control the camera to capture the image of the reference object. The larger reference surface of the reference object can reduce the size of the splashes and achieve more accurate measurement.
[0187] Specifically, by monitoring the pressure values sensed by each pressure sensor, the system can accurately identify the oscillation of the water surface. When the pressure value of a certain pressure sensor changes from less than the lower pressure limit value to greater than the upper pressure limit value and then changes back to less than the lower pressure limit value, the system can determine that there are large waves on the water surface, that is, the water level surface is unstable. When the pressure value meets the oscillation monitoring requirements, the system generates a reference object shooting instruction to control the camera to continuously capture multiple frames of reference object images. This intelligent trigger mechanism ensures that in the case of large water surface oscillations, the system can obtain sufficient image data for analysis, thereby improving the accuracy of water level measurement. By identifying the water level height in each frame of the reference object image and statistically analyzing multiple water level heights, the system can obtain a more accurate water level height value. This method avoids the errors that may be brought by a single image and improves the accuracy and reliability of water level measurement. Among them, in the case where the large-area water body is blocked by the river channel slope and does not generate larger waves, the small-area water body around the water gauge is more likely to cause larger waves. This embodiment adapts to the complex water surface environment by monitoring the water surface oscillation and performing shooting monitoring when the oscillation is small, ensuring the accuracy of water level measurement. By judging whether there is oscillation on the water surface, the system can select an appropriate shooting time. Shooting when the waves are small and the water surface is relatively stable can reduce the measurement error caused by water surface fluctuations and improve the measurement accuracy. This embodiment improves the intelligence level of the system by introducing pressure sensor monitoring and an intelligent shooting instruction generation mechanism. The system can automatically judge the water surface situation and adopt corresponding shooting strategies, and can complete accurate water level measurement without manual intervention.
[0188] In a possible implementation manner, the method further includes:
[0189] S701. Obtain the river water flow collected by the flowmeter located in the river channel, and generate a water level change function according to the obtained water level heights at multiple moments and the river water flows at multiple moments.
[0190] Among them, a flowmeter is arranged in the river channel, and the flowmeter is used to detect the river water flow at each moment in the river channel in real time. Obtain the images collected by the camera and the image collection time, and identify the water level height at the collection time for the collected images.
[0191] Use existing fitting tools to perform fitting analysis on the water level heights at multiple moments and the river water flows at multiple moments to generate a water level change function
[0192] S702. Predict the water level height at a future moment according to the water level change function, and control the river channel gate to open when the water level height at the future moment is greater than the alarm height.
[0193] Among them, according to the water level change function, the water level height at a future moment is predicted. When it is determined that the water level height at the future moment is greater than the alarm height, the river channel gate is controlled to open to prevent the water level from exceeding the alarm height.
[0194] In the above technical solution, by real-time monitoring of the river channel water level and river water flow, fitting the water level change function using the river water flow and the river channel water level, and predicting the water level height at a future moment according to the water level change function, the flood discharge timing can be determined according to the water level height, and the floodgate can be opened in time for flood discharge.
[0195] Specifically, by real-time monitoring of the river channel water level and river water flow, the system can dynamically master the changes in the river channel water situation. This real-time monitoring ability enables the system to quickly respond to changes in water level and flow, providing timely and accurate data support for subsequent prediction and decision-making. Then, using the water level height and river water flow data at multiple moments, the system can accurately fit the water level change function. This function accurately describes the relationship between the water level and the flow, providing a solid mathematical basis for subsequent water level prediction. Through the water level change function, the system can predict the water level height at a future moment. When the predicted water level height exceeds the alarm threshold, the system will issue an early warning in advance, providing a valuable time window for the river channel management department to formulate corresponding countermeasures. When the predicted water level height exceeds the alarm threshold, the system will automatically control the opening of the river channel gate to achieve flood discharge. This automated decision-making and rapid response mechanism greatly reduces the need for manual intervention, improving the efficiency and accuracy of dealing with flood disasters. By determining the flood discharge timing according to the water level height, the system can open the gate for flood discharge at the best timing, effectively reducing the river channel water level and minimizing the impact and losses of flood disasters on the surrounding areas.
[0196] Figure 7 It is a schematic structural diagram of the visual water gauge intelligent recognition system provided by some embodiments of the present application. As Figure 7 shown, the visual water gauge intelligent recognition system 800 provided in this embodiment includes:
[0197] A receiving module 810, configured to receive the water gauge image captured by the camera, perform contour recognition on the water gauge image, determine the target object corresponding to the contour according to the pixel value of the area surrounded by the contour, the shape of the area surrounded by the contour, and the positional relationship between the areas surrounded by the contours in the contour recognition result, and obtain the contours of multiple target objects and the positional relationship between the contours of each target object; wherein, the target objects include: water gauge contour, water body contour, and waterweed contour;
[0198] A processing module 820, configured to determine whether the water gauge is blocked according to the positional relationship between the contours of each target object, and obtain the occlusion situation of the water gauge; wherein, the occlusion situation includes no occlusion, partial occlusion, and complete occlusion;
[0199] The processing module 820 is further configured to identify the overlapping contour area and the area where the water gauge is located to obtain the water level height when the occlusion situation is no occlusion or partial occlusion; wherein, the overlapping contour area is the contour area in the water body contour that overlaps with the water gauge contour.
[0200] When the occlusion situation is complete occlusion, the processing module 820 is further configured to control the camera to rotate to a vertical angle so that the reference surface of the reference object is perpendicular to the optical axis of the camera; obtain a vertical image captured by the camera at the vertical angle, and identify the vertical image to obtain the water level height.
[0201] The visual water gauge intelligent recognition system provided in this embodiment includes: at least one processor and a memory. Optionally, the device further includes a communication component. Among them, the processor, the memory, and the communication component are connected through a bus.
[0202] In a specific implementation process, at least one processor executes computer-executable instructions stored in the memory, so that at least one processor executes the above method.
[0203] For the specific implementation process of the processor, reference can be made to the above method embodiment, and its implementation principle and technical effects are similar, so they will not be elaborated here in this embodiment.
[0204] In the above embodiment, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, abbreviated as: CPU), or other general-purpose processors, digital signal processors (English: Digital Signal Processor, abbreviated as: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, abbreviated as: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0205] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0206] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of easy representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.
[0207] This application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0208] This application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the above method is implemented.
[0209] The above-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disc. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.
[0210] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.
[0211] The division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in an electrical, mechanical or other forms.
[0212] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] In addition, in each embodiment of the present invention, each functional unit may be integrated in a processing unit, may exist physically alone for each unit, or two or more units may be integrated in one unit.
[0214] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0215] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium includes: various media such as ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0216] Finally, it should be noted that: after considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other implementation schemes of the present invention. The present invention aims to cover any variations, uses, or adaptive changes of the present invention. These variations, uses, or adaptive changes follow the general principles of the present invention and include common general knowledge or conventional technical means in the technical field of the present invention that are not disclosed in the present invention. It is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.
Claims
1. A visual water gauge intelligent recognition method, characterized in that: A water gauge is installed in a river channel, a reference object is calibrated near the water gauge, the reference object is provided with a reference surface, a camera is installed near the water gauge, a recognition system and the camera are communicatively connected, the method is applied to the recognition system, and the method comprises: Receive a water gauge image taken by the camera, perform contour recognition on the water gauge image, determine the target object corresponding to the contour according to the pixel value of the contour enclosed area, the shape of the contour enclosed area and the positional relationship between the contour enclosed areas in the contour recognition result, and obtain the contours of multiple target objects and the positional relationship between the contours of each target object; wherein the target objects include: a water gauge contour, a water body contour and aquatic plant contour; Determine whether the water gauge is blocked according to the positional relationship between the contours of each target object, and obtain the blocking condition of the water gauge; wherein the blocking condition includes no blocking, partial blocking and complete blocking; If the occlusion condition is no occlusion or partial occlusion, the overlapping contour area and the area where the water gauge is located are identified to obtain the water level height; wherein the overlapping contour area is the contour area in the water body contour that overlaps with the water gauge contour; If the occlusion is complete occlusion, control the camera to rotate to a vertical angle so that the reference surface of the reference object is perpendicular to the optical axis of the camera; obtain a vertical image taken by the camera at the vertical angle, and identify the vertical image to obtain the water level height.
2. The visual water gauge intelligent recognition method according to claim 1 is characterized in that: Determining whether the water gauge is blocked according to the positional relationship between the contours of each target object and obtaining the blocking condition of the water gauge specifically includes: If it is determined that the water gauge outline and the water body outline overlap, and the water gauge outline and the aquatic plant outline overlap, the occlusion condition of the water gauge is partial occlusion; If it is determined that the water gauge outline and the water body outline overlap, and the water gauge outline and the aquatic plant outline do not overlap, the obstruction condition of the water gauge is no obstruction; If it is determined that the water gauge outline and the water body outline do not overlap, and the water gauge outline and the aquatic plant outline overlap, the occlusion condition of the water gauge is complete occlusion.
3. The visual water gauge intelligent recognition method according to claim 2 is characterized in that: If the occlusion condition is no occlusion or partial occlusion, the overlapping contour area and the area where the water gauge is located are identified to obtain the water level height, specifically including: If the occlusion is partial occlusion or no occlusion, the scale line recognition is performed on the area where the water gauge is located to obtain a recognition result, and the pixel distance between the overlapped contour area and the nearest scale line area is obtained according to the recognition result; Acquire the pixel distance between the two scale lines and the scale difference between the two scale lines according to the recognition result, and determine the first conversion parameter of the pixel distance and the actual distance according to the pixel distance between the two scale lines and the scale difference between the two scale lines; The difference between the water body contour and the nearest scale line is calculated based on the first conversion parameter and the pixel distance between the overlapping contour area and the nearest scale line area; the water level height is obtained based on the scale value corresponding to the nearest scale line and the difference between the water body contour and the nearest scale line.
4. The visual water gauge intelligent recognition method according to claim 3 is characterized in that: If the occlusion is partial occlusion or no occlusion, the scale line recognition is performed on the area where the water gauge is located to obtain a recognition result, specifically including: Counting the number of pixels corresponding to each pixel value in the area where the water gauge is located, and selecting a pixel value whose number of pixels is greater than a preset number threshold as a candidate pixel value; Select the current candidate pixel value, and extract a rectangular area where all pixel values are the current candidate pixel value from the area where the water gauge is located; Determine whether the rectangular area meets the water gauge design rule. If so, the rectangular area is the area where a scale line is located. Meeting the water gauge design rule includes if there are three rectangular areas of the same size distributed at intervals, and the interval between any two rectangular areas is the width of the rectangular area; Search and match the area where the water gauge is located according to the distribution of scale lines and the size of the area where the scale lines are located, and obtain all scale line areas in the area where the water gauge is located; The scale value corresponding to each scale line area is determined according to the positional relationship between the water gauge design data and the multiple scale line areas.
5. The visual water gauge intelligent recognition method according to any one of claims 1 to 4, characterized in that: A plurality of pressure sensors are arranged inside the water gauge along the height direction to receive the water gauge image captured by the camera, specifically including: monitoring a sensed pressure value of each pressure sensor; If the pressure value sensed by the pressure sensor meets the requirement of stable monitoring, a water gauge shooting instruction is generated, and the water gauge shooting instruction controls the camera to shoot a water gauge image; Receiving the water ruler image sent by the camera; Among them, the pressure value meets the requirement of stable monitoring specifically including: the pressure value of a certain pressure sensor changes from less than the lower pressure limit value to greater than the upper pressure limit value; or the pressure value of a certain pressure sensor changes from greater than the lower pressure limit value to less than the upper pressure limit value.
6. The visual water gauge intelligent recognition method according to claim 5 is characterized in that: After monitoring the sensed pressure value of each pressure sensor, the method further includes: If the pressure value sensed by the pressure sensor meets the oscillation monitoring requirement, a shooting instruction of the river slope is generated, and the shooting instruction controls the camera to continuously shoot multiple frames of river slope images; Identify the water level in each frame of the river slope image, perform statistical analysis on multiple water level heights, and use the statistical results as the water level height; The pressure value meeting the oscillation monitoring requirement specifically includes: the pressure value of a certain pressure sensor changes from being less than the lower pressure limit value to being greater than the upper pressure limit value, and then changes to being less than the lower pressure limit value.
7. The visual water gauge intelligent recognition method according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtain a flow meter located in the river channel to collect river flow, and generate a water level change function according to the obtained water level heights at multiple moments and river flow at multiple moments; The water level height at a future moment is predicted according to the water level variation function, and when the water level height at a future moment is greater than the alarm height, the river gate is controlled to open.
8. A visual water gauge intelligent recognition system, characterized in that: include: The receiving module is used to receive a water gauge image taken by a camera, perform contour recognition on the water gauge image, determine the target object corresponding to the contour according to the pixel value of the contour enclosed area, the shape of the contour enclosed area and the positional relationship between the contour enclosed areas in the contour recognition result, and obtain the contours of multiple target objects and the positional relationship between the contours of each target object; wherein the target objects include: a water gauge contour, a water body contour and a waterweed contour; A processing module, used to determine whether the water gauge is blocked according to the positional relationship between the contours of each target object, and obtain the blocking condition of the water gauge; wherein the blocking condition includes no blocking, partial blocking and complete blocking; The processing module is further used to identify the overlapping contour area and the area where the water gauge is located to obtain the water level height if the occlusion condition is no occlusion or partial occlusion; wherein the overlapping contour area is the contour area in the water body contour that overlaps with the water gauge contour; The processing module is also used to control the camera to rotate to a vertical angle if the occlusion is complete, so that the reference surface of the reference object is perpendicular to the optical axis of the camera; obtain a vertical image taken by the camera at the vertical angle, and identify the vertical image to obtain the water level height.
9. An electronic device, characterized in that: include: processor; as well as, A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
A water gauge image feature weighted learning recognition method under a shielding condition
CN109726724A
Camera shielding detection method and device, camera equipment and storage medium
CN116249015A