Visual water gauge intelligent identification method and system
By contour recognition and occlusion of the water ruler image, combined with water body contour and vertical image recognition technology, the problem of water level height recognition when the water ruler is blocked is solved, efficient and accurate water level recognition is achieved, and algorithm complexity and labeling workload are reduced.
Patent Information
- Application Number
- CN202411929887.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-28
- 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 contour recognition of the water ruler image, we can determine whether the water ruler is blocked and determine the water level recognition strategy based on different occlusion conditions. When partially blocked or unblocked, the water level height is identified by the overlap between the water profile and the water ruler; when completely blocked, adjust the camera angle to take a vertical image of the reference object to identify the water level height.
The artificial intelligence algorithm model is not needed to be identified using the annotated occlusion image, which reduces the difficulty and calculation complexity of the recognition algorithm and realizes accurate identification of the water level height in the occlusion situation.
Smart Images

Figure CN119723093A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and system for intelligently identifying a visual water gauge. Background Art
[0002] With the rapid development of science and technology, artificial intelligence (AI) has shown great potential and value in many fields. Among them, machine learning and computer vision technologies have gradually been applied to water resources management.
[0003] Usually, a water gauge is installed in the monitored water area, and a camera is installed near the water gauge. The water gauge image is captured by the camera, and the water gauge image is recognized by the artificial intelligence algorithm model to obtain the water level of the monitored water area. However, if the water gauge is blocked by aquatic plants, the scale line value of the real water level on the water gauge will also be blocked by the aquatic plants. In this way, the real water level cannot be obtained. As one of the solutions, the artificial intelligence algorithm model is tested using the blocked water gauge image to enable the artificial intelligence algorithm model to have recognition capabilities under occlusion.
[0004] However, it is also difficult to annotate the obscured water level gauge image, which requires actual measurement, and the workload required to generate a sufficient number of annotated images is enormous. Summary of the invention
[0005] The embodiments of the present application provide a visual water gauge intelligent recognition method and system for achieving the effect of being ready to identify the water level height in the case of occlusion without using an artificial intelligence algorithm model that can recognize occlusion.
[0006] The embodiment of the present application provides a visual water gauge intelligent recognition method, the water gauge is installed in a river channel, a reference object is calibrated near the water gauge, the reference object has a reference surface, a camera is installed near the water gauge, the recognition system and the camera are connected in communication, the method is applied to the recognition system, and the method includes:
[0007] 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 aquatic plant contour;
[0008] 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;
[0009] If the occlusion situation 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;
[0010] If the occlusion is complete, 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 a 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, the contour of the water gauge image is extracted, and the target object corresponding to the contour is identified to obtain the contour corresponding to the target object and the positional relationship between each contour. In this way, the occlusion of the water gauge can be determined based on 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 conditions. When partially occluded or not occluded, the relationship between the water surface and the water gauge can be determined, and the water level height can be determined based on the relationship. When completely occluded, the relationship between the water level and the reference object is determined by taking a picture of the reference object at a vertical angle to achieve water level monitoring. The above solution does not need to use the annotated occluded image to identify the artificial intelligence algorithm model, and can achieve water level recognition of the occluded image without annotating a large number of occluded images, thereby reducing the difficulty of the recognition algorithm. And because it is shot at a vertical angle, there is no need for a complex conversion process when calculating the height, which reduces the complexity of the algorithm.
[0012] In a possible implementation, 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:
[0013] 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 of the water gauge is partial occlusion;
[0014] 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 of the water gauge is no obstruction;
[0015] 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.
[0016] In the above technical scheme, the occlusion characteristics between objects are utilized, that is, mutual occlusion must have overlapping contours in the image, and then it is determined whether the water gauge is completely, partially or not obscured by aquatic plants. In this way, there is no need to use an artificial intelligence algorithm model to recognize the water gauge image, and the water body contour can also be used to further identify the water level. By using the intermediate quantity of water level recognition for occlusion judgment, the complexity of the recognition algorithm can be reduced.
[0017] In a possible implementation manner, if the occlusion situation 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:
[0018] 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 the recognition result, and the pixel distance between the overlapping contour area and the nearest scale line area is obtained according to the recognition result;
[0019] 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;
[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 scale values of the areas where the scale lines are located and each scale line are obtained, the pixel distance between the two scale lines and the scale difference between the two scale lines are obtained from the recognition results, and the scale difference is divided by the pixel distance to obtain the conversion relationship between the single pixel distance and the actual distance, so that the pixel distance between the nearest scale area and the overlapping contour area is converted to the actual distance, and the water level is determined based on the actual distance and the corresponding scale value of 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 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, which specifically includes:
[0023] Counting the number of pixels corresponding to each pixel value in the area where the water gauge is located, and selecting the pixel value whose number of pixels is greater than a preset number threshold as the candidate pixel value;
[0024] 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;
[0025] Determine whether the rectangular area meets the water gauge design rules. If so, the rectangular area is the area where a scale line is located. Meeting the water gauge design rules 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;
[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] 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.
[0028] In the above technical solution, the candidate pixel values of the scale lines are determined by counting the number of pixels corresponding to each pixel value in the area where the water gauge is located. In this way, the pixel values in the area where the water gauge is located can be analyzed, and the rectangular area whose pixel values are all candidate pixel values can be extracted to determine whether there are three rectangular areas with intervals, and the interval between any two rectangular areas is the width of the rectangular area, that is, to determine whether the rectangular area meets the water gauge scale line design. If so, the rectangular area is determined to be the area corresponding to a scale line. After determining the area where the scale line is located, the scale line in the area where the water gauge is located is identified by searching and matching all areas of the water gauge. Then, the scale value corresponding to each scale line is determined according to the relative position relationship of the area where the scale line is located and the water gauge design data.
[0029] In a possible implementation, 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:
[0030] monitoring a sensed pressure value of each pressure sensor;
[0031] 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;
[0032] Receive the water level image sent by the camera;
[0033] 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.
[0034] In the above technical solution, the water level change can be monitored by monitoring the pressure value sensed by each pressure sensor. When the water level changes, the camera is triggered to capture the corresponding image, which can reduce the image acquisition amount, reduce the data processing amount of the recognition system, and reduce the hardware resource occupation of the recognition system.
[0035] In a possible implementation, after monitoring the pressure value sensed by each pressure sensor, the method further includes:
[0036] If the pressure value sensed by the pressure sensor meets the oscillation monitoring requirement, a reference object shooting instruction is generated, and the shooting instruction controls the camera to continuously shoot 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 results as the water level height;
[0038] 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.
[0039] In the above technical solution, if the pressure value sensed by the pressure sensor meets the oscillation monitoring requirements, it means that the water surface waves are relatively large and the horizontal plane is unstable. The river slope blocks the large area of water and will not produce larger waves. The water gauge only affects the small area of water, which is more likely to cause larger waves. When smaller waves are generated, the water level can be photographed and monitored to achieve more accurate measurement.
[0040] In a possible implementation, the method further includes:
[0041] 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;
[0042] 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.
[0043] In the above technical scheme, by real-time monitoring of river water level and river flow, using river flow and river water level to fit the water level change function, and predicting the water level height at future times according to the water level change function, the timing of flood discharge can be determined according to the water level height, and the gates can be opened in time to discharge the flood.
[0044] The present application embodiment provides a visual water gauge intelligent recognition system, including:
[0045] 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;
[0046] 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;
[0047] 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;
[0048] 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 the vertical image taken by the camera at the vertical angle, and identify the vertical image to obtain the water level height.
[0049] An embodiment of the present application provides an electronic device, including: a memory, a processor;
[0050] Memory stores computer-executable instructions;
[0051] The processor executes the computer-executable instructions stored in the memory, so that the processor executes various possible implementations as described above.
[0052] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the various possible implementation methods described above.
[0053] An embodiment of the present application provides a computer program product, including a computer program, which implements the above various possible implementation methods when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0055] Figure 1 A schematic diagram of a scenario for the visual water gauge intelligent recognition method provided in this application;
[0056] Figure 2 A schematic diagram of the flow of a visual water gauge intelligent recognition method provided in some embodiments of the present application;
[0057] Figure 3 An unobstructed water gauge image provided for some embodiments of the present application;
[0058] Figure 4 A partially occluded water gauge image provided in some embodiments of the present application;
[0059] Figure 5 A fully occluded water gauge image provided for some embodiments of the present application;
[0060] Figure 6 A schematic diagram of the area where a water gauge is located;
[0061] Figure 7 A schematic diagram of the structure of a visual water gauge intelligent recognition system provided in some embodiments of the present application.
[0062] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope 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. DETAILED DESCRIPTION
[0063] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, 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 widespread application of artificial intelligence technology, the use of artificial intelligence algorithm models to identify water gauge images taken by cameras has been widely used. In order for the artificial intelligence algorithm model to identify the real water level when the water gauge is obscured, a large number of annotated obscured images are required. However, when annotating the obscured images, it is necessary to obtain them by actual measurement in the actual scene, which makes it difficult to obtain annotated obscured images. The workload required to generate a sufficient number of annotated images is huge.
[0065] In order to solve the above problems, the present application provides a visual intelligent recognition method and system. By extracting the outline of the target object in the water gauge image, the occlusion situation is determined according to the positional relationship between the outlines of the target object. In the case of partial occlusion or no occlusion, the water level is determined according to the relationship between the outline of the water body that coincides with the outline of the water gauge and the scale line. In the case of complete occlusion, the angle of the camera is adjusted to a vertical angle, a vertical image of the reference object is taken, and the relationship between the water level and the reference object in the vertical image is identified to obtain the water level. In this way, the water level recognition in the case of occlusion can be achieved without marking the occluded water gauge, which can reduce the workload of marking.
[0066] Figure 1 A schematic diagram of a scenario of a visual water gauge intelligent recognition method provided in this application, such as Figure 1As shown, the specific application scenario of the present application is: installing a water gauge near a reference object, for example: installing a water gauge in a river channel near a gate, and installing a camera 100 near the water gauge, aiming the camera 100 at the water gauge, capturing a water gauge image, and sending the water gauge image to a visual water gauge intelligent recognition system 200 (hereinafter referred to as the recognition system), which recognizes the water gauge image and obtains the water level. In addition, after determining that the water gauge is completely blocked, the camera 100 is controlled to adjust the vertical angle and then capture the image, and the relationship between the water level and the reference object in the vertical image is recognized to obtain the water level.
[0067] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0068] Figure 2 A flow chart of a visual water gauge intelligent recognition method provided in some embodiments of the present application, such as Figure 2 As shown, the method specifically includes:
[0069] S101, the recognition system receives a water gauge image taken by a camera, performs contour recognition on the water gauge image, determines the target type 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, and obtains the contours of multiple target objects and the positional relationship between the contours of each target object.
[0070] The camera captures the water gauge image and sends it to the recognition system. The recognition system performs grayscale conversion on the water gauge image to obtain the grayscale value of the water gauge image. The grayscale value of the water gauge image is binarized, and the binarized water gauge image is processed using a contour detection function to obtain multiple contours and the positional relationship between each contour.
[0071] For each contour, the pixel value of the contour enclosed area, the shape of the contour enclosed area and the positional relationship between each contour enclosed area are obtained from the water gauge image. The target category is identified based on the pixel value of the contour enclosed area, the shape of the contour enclosed area and the positional relationship between each contour enclosed area.
[0072] The contour of the target object includes: a combination of a water gauge contour, a water body contour and a waterweed contour. The shape of the area surrounded by the water gauge contour is a long and thin strip. The pixel values of the area surrounded by the water gauge contour have two colors, one is the main color of the water gauge and the other is the scale color. The water gauge can be determined according to the shape of the area surrounded by the contour and the pixel values in the area surrounded.
[0073] Water plants are usually green, and can be identified based on the pixel values of the area surrounded by the outline. If a water body is near and below the water gauge, the water body can be identified based on 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 blocking condition of the water gauge; the blocking condition includes no blocking, partial blocking and complete blocking.
[0075] Among them, it is determined whether there is an overlap between the water gauge outline and the water body outline, and whether there is an overlap between the water gauge outline and the water grass outline. The occlusion of the water gauge is determined based on whether there is an overlap between the water gauge outline and the water body outline, and whether there is an overlap between the water gauge outline and the water grass outline.
[0076] More specifically, Figure 3 The unobstructed water gauge image provided by some embodiments of the present application, such as Figure 3 As shown, there is an overlap between the water gauge outline and the water body outline, but there is no overlap between the water gauge outline and the aquatic plant outline, so it is determined that the water gauge is not blocked.
[0077] Figure 4 Some embodiments of the present application provide partially blocked water gauge images, such as Figure 4 As shown, there is an overlap between the water gauge outline and the water body outline, and there is an overlap between the water gauge outline and the aquatic plant outline, which means that the water gauge is partially blocked.
[0078] Figure 5 A completely occluded water gauge image provided by some embodiments of the present application, such as Figure 5 As shown, there is no overlap between the water gauge outline and the water body outline, but there is an overlap between the water gauge outline and the aquatic plant outline, so it is determined that the water gauge is completely blocked.
[0079] In the above technical scheme, the occlusion characteristics between objects are utilized, that is, mutual occlusion must have overlapping contours in the image, and then it is determined whether the water gauge is completely, partially or not obscured by aquatic plants. In this way, there is no need to use an artificial intelligence algorithm model to recognize the water gauge image, and the water body contour can also be used to further identify the water level. By using the intermediate quantity of water level recognition for occlusion judgment, the complexity of the recognition algorithm can be reduced.
[0080] In other words, the above technical solution has the following technical effects:
[0081] Directly use image contour information to improve occlusion judgment efficiency: This implementation method directly uses the positional relationship between the water gauge contour, water body contour and aquatic plant contour to determine whether these contours overlap to determine the occlusion of the water gauge. No complex image processing and artificial intelligence algorithm model is required, and the efficiency of occlusion judgment is significantly improved based on the contour information of the image itself.
[0082] Accurately distinguish the occlusion situation and enhance the recognition accuracy: By carefully distinguishing the overlap between the water gauge outline and the water body outline and the water grass outline, this implementation can accurately determine whether the water gauge is completely blocked, partially blocked, or not blocked by the water grass. This refined distinction method enhances the recognition accuracy and provides a reliable basis for the subsequent water level recognition strategy.
[0083] Reduce algorithm complexity and improve system performance: Compared with using artificial intelligence algorithm models to identify occluded images, this implementation can achieve occlusion recognition through simple contour coincidence judgment, which greatly reduces the complexity of the algorithm. 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 use of water body contours to enhance system versatility: While determining the occlusion situation, this implementation also retains information about the water body contour. This information can not only be used to further identify the water level, but also provide data support for other related applications (such as water flow velocity estimation, water quality monitoring, etc.). This multifunctional design enhances the practicality and flexibility of the system.
[0085] Strong adaptability, suitable for a variety of water environments: This implementation does not rely on a specific water environment or water gauge type. As long as there are identifiable target objects such as water gauges, water bodies, and aquatic plants in the water area, this method can be applied for occlusion judgment and water level recognition.
[0086] S103: If the occlusion condition is no occlusion or partial occlusion, the recognition system identifies the overlapping contour area and the area where the water gauge is located to obtain the water level height.
[0087] If the occlusion situation is determined to be no occlusion or partial occlusion, that is, the relative position 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 water gauge the overlapping contour area is aligned with, 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 is complete, 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 a vertical angle, and obtain the water level according to the vertical image.
[0090] If the occlusion is complete, the camera is controlled to capture an image of the reference object. When capturing the reference object, the camera is rotated at a shooting angle so that a reference surface of the reference object is perpendicular to an optical axis of the camera.
[0091] When calculating the water level height based on the vertical image, the position of the water level on the reference plane is obtained, and the water level height can be obtained by converting the pitch angle of the camera. When calculating the water level height based on the vertical image reference object, no complicated conversion process is required, reducing the complexity of the algorithm.
[0092] In the above technical solution, after the camera captures the water gauge image, the contour of the water gauge image is extracted, and the target object corresponding to the contour is identified to obtain the contour corresponding to the target object and the positional relationship between each contour. In this way, the occlusion of the water gauge can be determined based on 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 conditions. When partially occluded or not occluded, the relationship between the water surface and the water gauge can be determined, and the water level height can be determined based on the relationship. When completely occluded, the relationship between the water level and the reference object is determined by taking a picture of the reference object at a vertical angle to achieve water level monitoring. The above solution does not need to use the annotated occluded image to identify the artificial intelligence algorithm model, and can achieve water level recognition of the occluded image without annotating a large number of occluded images, thereby reducing the difficulty of the recognition algorithm. And because it is shot at a vertical angle, there is no need for a complex conversion process when calculating the height, which reduces the complexity of the algorithm.
[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 taken by the camera and performing contour recognition on the image, it can accurately identify target objects such as the water gauge contour, water body contour, and aquatic plant contour. This step is based on the pixel value, shape, and position relationship of the contour-enclosed area, ensuring the accuracy and efficiency of target object recognition.
[0095] Intelligent occlusion judgment: Based on the positional relationship between the identified contours of each target object, it can intelligently judge whether the water gauge is blocked, as well as the specific situation of the occlusion (no occlusion, partial occlusion, complete occlusion). This function provides a key basis for subsequent water level recognition strategies and improves the flexibility and adaptability of recognition.
[0096] Adaptive water level recognition strategy: Different water level recognition strategies are adopted for different occlusion situations. When there is no occlusion or partial occlusion, the water level 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 is recognized. This adaptive strategy effectively copes with complex and changeable occlusion situations and ensures the accuracy and reliability of water level recognition.
[0097] Reduced labeling costs and workload: There is no need to use the annotated occluded images to train the AI algorithm model, thus avoiding a lot of labeling work. This not only reduces the labeling costs 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 taking 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 calculation. This step simplifies the height calculation process, reduces the algorithm complexity, and improves the calculation efficiency.
[0099] Improve the real-time and accuracy of water level monitoring: By receiving and processing the water gauge images taken by the camera in real time, it is possible to monitor the water level changes in real time. At the same time, through intelligent identification of occlusion and adaptive water level identification strategies, the accuracy and reliability of water level monitoring are ensured. This provides strong technical support for water resources management and flood prevention and disaster reduction.
[0100] In a possible implementation, S103, if the occlusion condition is no occlusion or partial occlusion, identifying the overlapping contour area and the area where the water gauge is located to obtain the water level height, specifically includes:
[0101] S201: If the occlusion is partial occlusion or no occlusion, identify the scale lines in the area where the water gauge is located to obtain a recognition result. According to the recognition result, the pixel distance between the overlapping contour area and the nearest scale line area is obtained.
[0102] If the occlusion is partial or no occlusion, the pixel values of each column of pixels in the area where the water gauge is located are obtained. The pixel value distribution of each pixel in the area where the water gauge is located is analyzed, and the area where the scale line is located is determined according to the pixel value distribution.
[0103] For each scale line area, the pixel distance between the scale line area and the coincident contour area is calculated, and the shortest pixel distance is selected as the pixel distance between the coincident contour area and the nearest scale line area. This scale line area is taken as the nearest scale line area.
[0104] S202, obtaining a pixel distance between two scale lines and a scale difference between the two scale lines according to the recognition result, and determining a 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.
[0105] The pixel distance between the two scale lines and the scale difference between the two scale lines are obtained from the recognition result, and the scale difference is divided by the pixel distance to obtain a first conversion parameter representing the actual distance corresponding to the unit pixel distance.
[0106] S203, calculating 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 area and the nearest scale line area; obtaining the water level 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] The product of the first conversion parameter and the pixel distance between the overlapping contour area and the nearest scale line area is calculated, and the product result is used as the difference between the water body contour and the nearest scale line. 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 is calculated to obtain the water level.
[0108] In the above technical solution, by extracting the scale lines in the area where the water gauge is located, the scale values of the areas where the scale lines are located and each scale line are obtained, the pixel distance between the two scale lines and the scale difference between the two scale lines are obtained from the recognition results, and the scale difference is divided by the pixel distance to obtain the conversion relationship between the single pixel distance and the actual distance, so that the pixel distance between the nearest scale area and the overlapping contour area is converted to the actual distance, and the water level is determined based on the actual distance and the corresponding scale value of 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.
[0109] In other words, the above solution has the following specific technical effects:
[0110] Directly use the scale line recognition results to improve the accuracy of water level calculation: When the occlusion is partial or no occlusion, this implementation directly recognizes the scale lines in the area where the water gauge is located, and obtains the pixel distance between the overlapping contour area and the nearest scale line area from the recognition results. This method avoids the difficulty of scale line recognition caused by occlusion in traditional methods, thereby improving the accuracy of water level calculation.
[0111] Pixel distance conversion based on scale line interval simplifies 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 the subsequent water level calculation to be performed directly based on the pixel distance without the need for additional calibration or conversion steps, thus simplifying the calculation process.
[0112] No additional calibration is required, reducing algorithm complexity: Compared with the traditional method, this implementation does not require additional calibration when converting pixel distance to actual distance. This not only reduces the workload of calibration work, but also reduces the complexity of the algorithm, making the entire water level recognition process more efficient and reliable.
[0113] Improve the real-time and automation of water level identification: Since this embodiment avoids complex calibration and conversion steps, the water level identification process is faster and more efficient. At the same time, the automated water level identification process reduces the need for manual intervention and improves the real-time and automation of the system.
[0114] Strong adaptability, applicable to a variety of water gauge types and environmental conditions: This implementation does not rely on a specific water gauge type or environmental conditions. As long as there are identifiable scale lines on the water gauge, this method can be used to identify the water level. 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 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:
[0116] S301, counting the number of pixels corresponding to each pixel value in the area where the water gauge is located, and selecting the pixel value whose number of pixels is greater than a preset number threshold as the candidate pixel value.
[0117] Among them, the preset quantity threshold is determined according to the total pixels in the area where the water ruler is located. Since the water ruler contains two main colors, the water ruler background color and the scale line color, the pixel value corresponds to the color on the water ruler. By counting the number of pixels corresponding to each pixel value, the pixel value with a relatively large number of pixels is selected as the alternative pixel value to extract the scale line area.
[0118] S302, selecting the current candidate pixel value, and extracting a rectangular area whose pixel values are all the current candidate pixel values from the area where the water gauge is located.
[0119] Among them, one is selected from multiple candidate pixel values as the current candidate pixel value, the pixel values of each pixel in the area where the water gauge is located are analyzed, and according to the analysis result, a rectangular area whose pixel values are all the current candidate pixel values is extracted from the area where the water gauge is located.
[0120] S303, judging whether the rectangular area meets the water gauge design rules, if there are three rectangular areas of the same size spaced apart, and the interval between any two rectangular areas is the width of the rectangular area, then the rectangular area is the area where a scale line is located. If not, proceed to S306.
[0121] Among them, the distribution of rectangular areas is counted to determine whether 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. 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, then the rectangular area is the area where a scale line is located.
[0122] S304, searching and matching the area where the water gauge is located according to the distribution of the scale lines and the size of the area where the scale lines are located, to obtain all the scale line areas in the area where the water gauge is located.
[0123] The distribution of the scale lines is determined according to the water gauge design data, and the search direction is determined according to the distribution of the scale lines.
[0124] The next matching area is determined according to the current matching area and the search direction, and it is judged whether there is a continuous area that meets the conditions in the next matching area. Meeting the conditions means that the size of the continuous area is the size of the area where the scale line is located, and all pixel values in the continuous area are the pixel values of the pixels in the area where the scale value is located. If there is a continuous area that meets the conditions, then the area is the area where the scale line is located. In this way, the efficiency of scale line recognition can be improved.
[0125] in, Figure 6 is a schematic diagram of the area where a water gauge is located, such as Figure 6 As shown in the figure, the pixel values of the area where the water gauge is located are counted. There are two kinds of pixel values, one is represented by blank filling and the other is represented by grid filling. The rectangular pixel area filled with grid is extracted from the area where the water gauge is located. There are three sizes of rectangular pixel areas. Only the rectangular pixel area of 2×7 size meets the conditions, that is, 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. Determine an area with a scale line size of 2×7. And use the 2×7 size area as a template to search in the area where the water gauge is located, and extract the areas where all scale lines are located in the area where the water gauge is located.
[0126] S305, determining the scale value corresponding to each scale line area according to the positional relationship between the water gauge design data and the plurality of scale line areas.
[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 unconnected scale lines is 0.2m, and the difference between two adjacent and connected scale lines is 0.1m.
[0128] The top scale line is 10m, the second scale line is two rows of pixels away from the top scale line, and the second scale line is 9.8, the third scale line is two rows of pixels away from the second scale line, and 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 lines of pixels away from the 4th scale line, and the 5th scale line is 9.3. The 6th scale line is two lines of pixels away 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 areas spaced apart, update the current candidate pixel value and return to S302.
[0131] If the rectangular area under the current candidate pixel value does not meet the condition, the current candidate pixel value continues to be updated to continue to determine whether the new rectangular area meets the condition.
[0132] In the above technical solution, the candidate pixel values of the scale lines are determined by counting the number of pixels corresponding to each pixel value in the area where the water gauge is located, so that the pixel values in the area where the water gauge is located can be analyzed to improve the efficiency of the algorithm. The rectangular area whose pixel values are all candidate pixel values is extracted, and it is determined whether there are three rectangular areas with interval distribution, and the interval between any two rectangular areas is the width of the rectangular area, that is, whether the rectangular area meets the water gauge scale line design. If so, the rectangular area is determined to be the area corresponding to a scale line. After determining the area where the scale line is located, the scale line recognition in the area where the water gauge is located is realized by searching and matching all areas of the water gauge. Then, the scale value corresponding to each scale line is determined according to the relative position relationship of the area where the scale line is located and the water gauge design data.
[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 a number of pixels greater than the preset number threshold as the candidate pixel value, this step effectively filters out noise and interference, and improves the accuracy of subsequent scale line recognition. At the same time, this method is highly robust to different lighting conditions and image quality, and can work stably in complex environments.
[0135] Intelligent extraction of scale line area: Select the current candidate pixel value, and extract the rectangular area whose pixel values are all the current candidate pixel values from the area where the water gauge is located. This step intelligently locates the possible scale line area. By further judging whether these rectangular areas meet the water gauge design rules (such as the existence of three rectangular areas of the same size distributed at intervals, and the interval is the width of the rectangular area), the area where the scale line is located can be accurately identified. This method avoids the limitations of the traditional method of manually setting thresholds or template matching, and improves the intelligent level of recognition.
[0136] Comprehensive search and matching to ensure the integrity of scale line recognition: After determining the basic features of the scale line area, all scale line areas can be obtained by comprehensive search and matching of the water gauge area. This step ensures the integrity of scale line recognition and avoids omissions or misidentification.
[0137] Accurately determine the scale value and improve the accuracy of water level calculation: According to the water gauge design data and the positional relationship between multiple scale line areas, the scale value corresponding to each scale line area can be accurately determined. This step provides accurate data support for subsequent water level calculations and improves the accuracy and reliability of water level calculations.
[0138] In a possible implementation manner, a reference line is provided on the reference surface, and S104, obtaining a vertical image taken by a camera at a vertical angle, and obtaining a water level height according to the vertical image, specifically includes:
[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, and calculate a second conversion parameter between the pixel distance and the actual distance 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.
[0140] Among them, a contour recognition algorithm is used to extract multiple contours in the vertical image, and the target type corresponding to the contour enclosed area is determined according to the shape of the contour enclosed area, the positional relationship of the contour enclosed area, and the pixel value in the contour enclosed area.
[0141] For example, the reference object is a bridge pier, which is columnar and located above a body of water. A plane on the pier is used as the reference surface, and a reference line can be drawn on the pier in yellow or red. The reference line can be located first, and then the reference surface can be located by the reference line.
[0142] In the above manner, the area where the water body is located, the area where the reference object is located, the area where the reference surface 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, and calculate the pixel distance between the contour area close to the lower reference line and the lower reference line according to the position of the contour area close to the lower reference line and the position of 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 pixel distance between the upper reference line and the lower reference line by the design distance between the upper reference line and the lower reference line to obtain the second conversion parameter.
[0144] S402, calculating the actual distance between the water level and the lower reference line according to the pixel distance between the water level and the lower reference line and the second conversion parameter, and calculating the height difference between the water level and the lower reference line according to the actual distance between the water level and the lower reference line and the pitch angle of the camera.
[0145] Among them, the product of the pixel distance between the water level and the lower reference line and the second conversion parameter is calculated to obtain the actual distance between the water level and the reference line, and the actual distance between the water level and the lower reference line and the cosine value of the camera's pitch angle are calculated to obtain the height difference between the water level and the reference object.
[0146] S403: Determine the water level height according to 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, the scale value corresponding to the lower reference line is obtained through on-site surveying. By calculating 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, 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 are identified, so that 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, and the actual distance under the unit pixel distance is determined according to the design distance of the upper and lower reference lines and the pixel distance between the upper and lower reference lines, so that the pixel distance between the water body and the lower reference line is converted into the actual distance, and then through angle conversion, the height difference between the water body and the lower reference line can be obtained, and finally the height of the water body on the water gauge is obtained according to the relationship between the lower reference line and the scale line of the water gauge, so that the water level height is accurately obtained under complete occlusion. The above solution does not need to use the annotated occluded image to identify the artificial intelligence algorithm model, and can realize the water level recognition of the occluded image without annotating a large number of occluded images, thereby reducing the difficulty of the recognition algorithm.
[0149] In other words, the above solution has the following specific technical effects:
[0150] Directly use vertical images to achieve water level measurement under completely blocked conditions: When the water gauge is completely blocked, this implementation method directly uses the information in the image to calculate the water level by taking a vertical image of the reference object. This method avoids the difficulty of identification caused by the water gauge being blocked and achieves accurate measurement of the water level under completely blocked conditions.
[0151] Pixel distance conversion based on reference line design distance to improve measurement accuracy: By extracting the pixel distance between the water level and the lower reference line in the vertical image, and the pixel distance between the upper reference line and the lower reference line, and combining the design distances of the upper and lower reference lines, this embodiment calculates a second conversion parameter between the pixel distance and the actual distance. This conversion parameter enables subsequent water level height calculations to be performed directly based on the pixel distance, thereby improving measurement accuracy.
[0152] Considering the camera pitch angle to calculate the height difference in three-dimensional space: After calculating the actual distance between the water level and the lower reference line, this implementation 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 consistent with the actual situation.
[0153] Combined with locally stored data, the water level can be quickly determined: Based on the height difference between the water level and the lower reference line and the scale line value corresponding to the locally stored lower reference line, this implementation can quickly determine the water level. This method does not require additional data query or calculation steps, which improves the efficiency and real-time performance of the measurement.
[0154] Improve the adaptability and reliability of the system: This implementation does not depend on a specific water gauge type or environmental conditions. As long as a reference line is provided on the reference surface and the camera can capture a vertical image, this method can be applied to measure the water level. This wide adaptability enables this method to play a role in a variety of practical 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 a river slope, and the reference surface is a river slope. S104, obtaining a vertical image taken by a camera at a vertical angle, and obtaining a water level height according to the vertical image, specifically includes:
[0156] S501, extracting the area where the water body is located from the vertical image, obtaining the pixel height of the area where the water body is located along the observation direction, and using the pixel height to search the mapping relationship table to obtain the water level height.
[0157] Among them, the change of river water level in the image is the change of pixel height in the water area. By fixing the shooting angle and controlling the optical axis of the camera to be perpendicular to the river slope, observation images under different water levels are taken, and the height change of the water area in the observation image is analyzed to generate a mapping relationship between pixel height and water level height.
[0158] Since the area where the water body is located is usually irregular in shape, a direction can be set as the observation direction. When analyzing each observed image, the pixel height of the area where the water body is located along the observation direction is extracted to generate a mapping relationship between the pixel height and the water level height. For example: select the direction along the extension of the pixel column as the observation direction, or the direction with a fixed angle to the extension of the pixel column as the observation direction.
[0159] The contour recognition algorithm is used to extract multiple contours in the vertical image, and the target object corresponding to the contour enclosed area is identified according to the shape of the contour enclosed area, the positional relationship of the contour enclosed area, and the pixel value in 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] Get the locally stored observation direction, and get the pixel height of the water body area from the water body area along the observation direction. Use the pixel height to look up the mapping relationship table to get the water level height.
[0161] In the above technical solution, the change of river water level in the image is the change of pixel height in the area where the water body is located. By fixing the shooting angle, taking river water images at different water levels, analyzing the height change of the area where the water body is located in the river water image, and generating a mapping relationship between pixel height and 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 annotated occluded image to identify the artificial intelligence algorithm model, and can realize the water level recognition of the occluded image without annotating a large number of occluded images, thereby reducing the difficulty of the recognition algorithm.
[0162] In other words, the above solution has the following specific technical effects:
[0163] Flexible application without reference line dependence: This implementation does not rely on the reference line on the reference surface, but directly analyzes the pixel height of the area where the water body is located in the vertical image to obtain the water level. This allows 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 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] Using a mapping table to quickly determine the water level: Using a pre-generated mapping table between pixel height and water level, this method can quickly and accurately determine the water level based on 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, which improves the efficiency and accuracy of the measurement.
[0166] Improve the real-time and accuracy of monitoring: By shooting river water images at different water levels at a fixed shooting angle and generating a mapping table between pixel height and water level height, this method can maintain the real-time and accuracy of monitoring even when the water gauge is completely blocked. This is of great significance to flood prevention and disaster relief, water resources management and other fields.
[0167] Some other embodiments of the present application provide a visual water gauge intelligent recognition method, which specifically includes the following steps:
[0168] S601 : Monitor the pressure value 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 submerged in the water is different, and the water pressure increases with the depth. The pressure sensors laid on the part of the water gauge submerged in the water can sense the water pressure. The pressure sensors on the water gauge exposed to the air are not subject to water pressure, so they will not sense the pressure value.
[0170] The rise of water level will cause some pressure sensors to change from not sensing pressure value to sensing water pressure. The drop of water level will cause some pressure sensors to change from sensing water pressure to not sensing pressure value. By monitoring the pressure value sensed by each pressure sensor, the water level change can be monitored.
[0171] S602, determine whether the pressure value meets the requirement of stable monitoring, if yes, generate a shooting instruction, the shooting instruction controls the camera to shoot the water gauge image. If no, go to S607.
[0172] 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.
[0173] If the pressure value of a certain pressure sensor changes from less than the lower pressure limit to greater than the upper pressure limit, it means that the water level has risen, and the pressure sensor has gone from not sensing the pressure value to sensing the water pressure. If the pressure value of a certain pressure sensor changes from greater than the lower pressure limit to less than the upper pressure limit, it means that the water level has dropped, and the pressure sensor has gone from sensing the water pressure to not sensing the pressure value.
[0174] If the pressure value sensed by the pressure sensor meets the monitoring requirements, it is determined that the water level has changed, triggering the camera to capture the water gauge image and monitor the rise and fall of the water level.
[0175] In the above scheme, by monitoring the pressure value 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, thereby realizing real-time monitoring of water level change. When the pressure value of the pressure sensor meets the requirement of stable monitoring (that is, the pressure value of a certain pressure sensor changes from less than the lower pressure limit to greater than the upper pressure limit, or from greater than the lower pressure limit to less than the upper pressure limit), 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 triggered to shoot images only 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, allowing 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, thereby reducing the burden on computing devices and storage devices and extending the service life of the equipment. Since images are only shot when the water level changes, the system can more accurately capture the key moments of water level changes. This helps improve the accuracy and efficiency of water level identification, allowing the system to provide water level data support more reliably.
[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 value 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 blocking condition of the water gauge; the blocking condition includes no blocking, partial blocking and complete blocking.
[0178] S605: If the occlusion condition is no occlusion or partial occlusion, the recognition system identifies the overlapping contour area and the area where the water gauge is located to obtain the water level height.
[0179] S606. If the occlusion is complete, 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 a vertical angle, and obtain the water level height according to the vertical image, wherein the vertical image includes the reference object.
[0180] S607, determining whether the pressure value meets the oscillation monitoring requirement, and if so, generating a shooting instruction of the river slope, the shooting instruction controls the camera to continuously shoot multiple frames of river slope images.
[0181] Among them, the pressure value meets the oscillation monitoring requirements 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, and then changes to 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 means that the waves on the water surface are relatively large. The river slope blocks a large area of the water body and is not likely to cause larger waves. The water gauge blocks a small area of the water body and is likely to cause larger waves. When it is determined that the waves on the water surface are relatively large, water level monitoring is achieved by monitoring the water level changes on the river slope.
[0183] S608, identifying the water level in each frame of the river slope image, performing statistical analysis on multiple water level heights, and using the statistical results as the water level height.
[0184] Among them, an upper reference line and a lower reference line are provided on the river slope, and the second conversion parameter is obtained through the upper and lower reference lines. By performing contour recognition on the river slope image, the target type of the contour enclosed area is identified according to the shape of each contour enclosed area, the positional relationship of the contour enclosed area, and the pixel value of the contour enclosed area, and the water body area, river slope area, upper reference line area, and lower reference line area are obtained. 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 height of the water level is obtained based on the actual height of the lower reference line.
[0185] The water level in each frame of the river slope image is identified, multiple water level heights are statistically analyzed to obtain the crest water level height and the trough water level height, and the average value of the crest water level height and the trough water level height is calculated as the actual water level height.
[0186] In the above technical solution, if the pressure value sensed by the pressure sensor meets the oscillation monitoring requirements, it means that the water surface has large waves and the horizontal plane is unstable. The water gauge blocks the water flow and easily causes larger waves. The water level cannot be accurately obtained through the water gauge. The camera is controlled to capture the image of the reference object. The larger reference surface of the reference object can reduce the size of the waves and achieve more accurate measurement.
[0187] Specifically, by monitoring the pressure value 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 to greater than the upper pressure limit, and then changes to less than the lower pressure limit, the system can determine that there are large waves on the water surface, that is, the horizontal plane is unstable. When the pressure value meets the oscillation monitoring requirements, the system will generate a reference object shooting instruction to control the camera to continuously shoot multiple frames of reference object images. This intelligent triggering mechanism ensures that when the water surface oscillates greatly, the system can obtain enough 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 performing statistical analysis on multiple water level heights, the system can obtain more accurate water level height values. This method avoids the errors that may be caused by a single image and improves the accuracy and reliability of water level measurement. Among them, when the river slope blocks a large area of water and does not produce larger waves, the small area of water around the water gauge is more likely to cause larger waves. This embodiment adapts to the complex water surface environment and ensures the accuracy of water level measurement by monitoring the oscillation of the water surface and taking pictures when the oscillation is small. By judging whether there is oscillation on the water surface, the system can choose the appropriate time to shoot. 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 accuracy of measurement. This embodiment improves the intelligence level of the system by introducing pressure sensor monitoring and intelligent shooting command generation mechanism. The system can automatically judge the water surface conditions and adopt corresponding shooting strategies, and can complete accurate water level measurement without human intervention.
[0188] In a possible implementation, the method further includes:
[0189] S701, obtaining a flow meter located in the river channel to collect river flow, and generating a water level change function according to the obtained water level heights at multiple moments and river flow at multiple moments.
[0190] Among them, a flow meter is arranged in the river channel, and the flow meter is used to detect the river flow in the river channel at various times in real time. The image captured by the camera and the image acquisition time are obtained, and the captured image is recognized to obtain the water level height at the acquisition time.
[0191] Use existing fitting tools to fit the water level heights and river flow at multiple times to generate a water level change function.
[0192] S702. Predict the water level at a future time according to the water level change function, and when the water level at the future time is greater than the alarm height, control the river gate to open.
[0193] Among them, the water level height at a future time is predicted according to the water level change function. When it is judged that the water level height at a future time is greater than the alarm height, the river gate is controlled to open to prevent the water level from exceeding the alarm height.
[0194] In the above technical scheme, by real-time monitoring of river water level and river flow, using river flow and river water level to fit the water level change function, and predicting the water level height at future times according to the water level change function, the timing of flood discharge can be determined according to the water level height, and the gates can be opened in time to discharge the flood.
[0195] Specifically, by real-time monitoring of river water level and river flow, the system can dynamically grasp the changes in river water conditions. This real-time monitoring capability enables the system to respond quickly to changes in water level and flow, providing timely and accurate data support for subsequent predictions and decisions. Then, using the water level height and river flow data at multiple times, the system can accurately fit the water level change function. This function accurately describes the relationship between water level and flow, providing a solid mathematical foundation for subsequent water level prediction. Through the water level change function, the system can predict the water level height at future times. When the predicted water level height exceeds the alarm threshold, the system will issue an early warning, providing a valuable time window for the river management department to formulate corresponding response measures. When the predicted water level height exceeds the alarm threshold, the system will automatically control the river gate to open and discharge floods. This automated decision-making and rapid response mechanism greatly reduces the need for manual intervention and improves the efficiency and accuracy of responding to flood disasters. By determining the timing of flood discharge according to the water level height, the system can open the gate to discharge floods at the best time, thereby effectively lowering the river water level and reducing the impact and losses of flood disasters on surrounding areas.
[0196] Figure 7 This is a schematic diagram of the structure of the visual water gauge intelligent recognition system provided in some embodiments of the present application. Figure 7 As shown, the visual water gauge intelligent recognition system 800 provided in this embodiment includes:
[0197] The receiving module 810 is used to receive a water gauge image captured 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;
[0198] The processing module 820 is used to determine whether the water gauge is blocked according to the position 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;
[0199] The processing module 820 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;
[0200] The processing module 820 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 the vertical image taken 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 also includes a communication component. The processor, the memory and the communication component are connected via a bus.
[0202] In a specific implementation process, at least one processor executes computer-executable instructions stored in a memory, so that at least one processor executes the above method.
[0203] The specific implementation process of the processor can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0204] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be 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 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0207] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0208] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0209] The above-mentioned 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, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0210] An exemplary readable storage medium is coupled to a 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 circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0211] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0212] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into 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 this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0215] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0216] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only 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
Method and device for automatically correcting camera
CN117097987A
Identification method, identification system, and non-transitory computer-readable storage medium storing a program
US20220129690A1
Cited By
Flood prevention monitoring system and monitoring method based on gate opening
CN120869258A
Intelligent control system for water yield of water purifier
CN121028618A