Water level identification method and system in complex outdoor scenarios

By using deep learning models and character sequence interpolation algorithms, the system automatically locates water level targets and fills in any missed characters, solving the problem of low water level recognition accuracy in complex scenarios and achieving high-precision automatic water level recognition.

CN117095408BActive Publication Date: 2025-10-31ECCOM NETWORK SYST CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311063342.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-22
Publication Date
2025-10-31
Estimated Expiration
2043-08-22

AI Technical Summary

Technical Problem

Existing water level identification technologies are affected by external factors such as changes in light intensity, foreign object adhesion, and water level corrosion in complex scenarios, resulting in reduced identification accuracy and increased maintenance difficulty due to the need for prior information.

Method used

By combining the deep learning-based SDTC segmentation model and the Yolov5m target detection model with a character sequence interpolation algorithm, the system can automatically locate water level targets, identify scale characters, and estimate water level height by judging character distance error and interpolating to fill in missing characters.

Benefits of technology

It improves water level recognition accuracy in complex scenarios, reduces reliance on prior information, and enhances the robustness and automation of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117095408B_ABST
    Figure CN117095408B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for water level identification in complex outdoor scenarios, including: image preprocessing, water level gauge target segmentation, water level gauge scale character recognition, grouping the water level gauge scale characters into an "E" character sequence located on the left side of the water level gauge and a character sequence located on the right side of the water level gauge, dynamically interpolating the character sequences to complete missed characters, and a water level estimation step. This invention addresses the problem that the visibility of scale characters on the water level gauge surface is affected by complex external environments, causing the target detection model to be unable to identify all characters on the water level gauge, through a water level identification algorithm model based on deep learning character detection and sequence interpolation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to water level recognition technology based on machine vision algorithms, specifically to a method and system for water level recognition in complex outdoor scenarios. In particular, based on deep learning-based water level detection and character detection algorithms, a water level recognition scheme based on character sequence interpolation is provided. Background Technology

[0002] Hydrological infrastructure is one of the fundamental pillars of national economic development. Hydrological measurement data provides crucial decision-making support for water conservancy projects, flood control and development, drought and flood prevention, and water resource protection and utilization. Among these, water level measurement, as one of the most important hydrological information sources, has always been a focus of attention in the water conservancy industry, and it is also a key technical support for the flood prevention, early warning, forecasting, and rehearsal platform.

[0003] There are three main categories of existing water level identification technologies:

[0004] 1) Traditional method based on manual reading: Manual reading is time-consuming and labor-intensive, especially during the flood season when the safety of the measuring personnel cannot be guaranteed.

[0005] 2) Measurement using sensors: Automatic water level data can be collected using electronic water level gauges with sensors, but this method has the problems of high equipment cost, difficulty in installation, and difficulty in equipment maintenance.

[0006] 3) AI-based visual detection methods: Image-based water level recognition methods have become an important branch of water level measurement research due to their advantages such as easy equipment installation, low cost, and no need for manual reading. They utilize traditional image processing techniques, deep learning object detection, classification, and other algorithms to detect and recognize characters on the water level gauge. These methods have two relatively obvious problems: First, they require varying degrees of prior information, such as the position and color of the water level gauge, and camera calibration, which increases the difficulty of later maintenance. Second, the application background of water level recognition algorithms is relatively complex, and the robustness of the algorithms in complex environments is limited. Changes in light intensity, foreign object adhesion, and natural corrosion of the water level gauge can all reduce the detection accuracy of the algorithms.

[0007] However, image-based recognition methods are often affected by complex external environmental factors, which limits the accuracy of the algorithm. Summary of the Invention

[0008] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for water level identification in complex outdoor scenarios.

[0009] A water level identification method for complex outdoor scenes according to the present invention is characterized by comprising:

[0010] Image preprocessing step S1: Preprocess the original image captured by the camera to obtain a preprocessed image;

[0011] Water level target segmentation step S2: Based on the pre-processed image, automatically locate the water level target and extract the water level line position;

[0012] Step S3: For the water gauge target, identify the scale characters on the water gauge;

[0013] Water gauge marking character grouping step S4: Divide the marking characters into two character sequences according to character category: the E character sequence located on the left side of the water gauge, and the sequence located on the right side of the water gauge. Character sequence;

[0014] Step S5 of dynamic interpolation to complete missing characters in character sequence: Calculate the distance error between adjacent characters in the character sequence, determine whether there are missing characters based on the distance error, and fill in the missing characters to obtain the completed image;

[0015] Water level estimation step S6: Based on the completed image, convert the pixel distance into the actual water level height.

[0016] Preferably, in the water level target segmentation step S2, the SDTC segmentation model is used to locate the water level target. The SDTC model is used to perform pixel-level target detection and classification on the pre-processed image, generating a target binary mask image to identify the water level target; simultaneously, the water level line edge information is extracted, and the water level line coordinate Y is calculated as follows:

[0017] Y = max(P) y ) Formula 1

[0018] Among them, P y Represents the set of vertical coordinates of points on the water gauge outline;

[0019] In the water gauge scale character recognition step S3, the region of the water gauge target in the image is determined based on the target binary mask image. The YOLOv5m algorithm is then used to detect the water gauge scale characters in the target region, identifying the letter E and the character on the water gauge. For two types of characters, obtain the center point coordinates and length and width of the detection box for each character.

[0020] Preferably, the step S5 of dynamically interpolating and completing the missing characters in the character sequence includes:

[0021] Step S501: For tick characters belonging to the same category in the vertical direction of the image, calculate the distance error between two adjacent characters, and the distance error r in the character sequence. i The calculation method is as follows:

[0022]

[0023] Among them, D (i-1,i) D represents the pixel distance in the vertical direction between two adjacent characters, where the (i-1)th character and the ith character are considered. (i,i+1) This represents the pixel distance in the vertical direction between two adjacent characters, i-th and (i+1)-th characters. The more characters are missed, the greater the pixel distance. i The closer to 1;

[0024] Step S502: Search for missed characters and perform sequence interpolation; where, when r i If the threshold α is not exceeded, it is considered that there are no missed characters; when r i When the threshold α is exceeded, it is considered that a character has been missed. At this time, the character sequence is interpolated to fill the character sequence with the vertical pixel coordinates of the missed character. The interpolation ν is calculated as follows:

[0025]

[0026] Among them, c i ν represents the vertical coordinate of the character at the i-th position in the current character sequence; insert ν into the character sequence c, ensuring that the character sequence c is an ascending sequence; after one interpolation, the coordinate sequence needs to be traversed from the beginning to perform a new round of missing character search until all missing characters are filled;

[0027] Step S503: Merge and sort the two completed character sequences to obtain the final water ruler character sequence s:

[0028] s = sort(a∩b) Formula 4

[0029] Where sort represents the sorting function, a represents the character sequence to the left of the watermark after interpolation, and b represents the character sequence to the right of the watermark after interpolation.

[0030] Preferably, in the water level estimation step S6, the pixel coordinates are converted into the actual water level height using linear interpolation, as shown in Formula 5:

[0031]

[0032] Where W represents the actual water level height, L is the actual length of the water gauge, N is the number of characters in the completed character sequence, Y is the vertical coordinate of the water level line, and s is the final water gauge character sequence obtained after interpolation and completion. N-1 This represents the (N-1)th character of the final water ruler character sequence s. N-2 This represents the (N-2)th character of the final water level character sequence s, where scale is a scale character indicating the actual height.

[0033] A water level identification system for complex outdoor scenes provided by the present invention includes:

[0034] Image preprocessing module M1: preprocesses the raw images captured by the camera to obtain preprocessed images;

[0035] Water level target segmentation module M2: Based on the pre-processed image, automatically locate the water level target and extract the water level line position;

[0036] Water gauge scale character recognition module M3: Recognizes the scale characters on the water gauge target;

[0037] Water gauge scale character grouping module M4: Divides the scale characters into two character sequences according to character category: the E character sequence on the left side of the water gauge, and the sequence on the right side of the water gauge... Character sequence;

[0038] M5, a module for dynamic interpolation and completion of missing characters in a character sequence, calculates the distance error between adjacent characters in the character sequence, determines whether there are missing characters based on the distance error, and completes the corresponding characters at the missing locations to obtain the completed image.

[0039] Water level estimation module M6: Based on the completed image, converts pixel distances into actual water level heights.

[0040] Preferably, in the water level target segmentation module M2, the SDTC segmentation model is used to locate the water level target. The SDTC model is used to perform pixel-level target detection and classification on the pre-processed image, generating a binary mask image of the target to identify the water level target; simultaneously, the water level line edge information is extracted, and the water level line coordinate Y is calculated as follows:

[0041] Y = max(P) y ) Formula 1

[0042] Among them, P y Represents the set of vertical coordinates of points on the water gauge outline;

[0043] In the water gauge scale character recognition module M3, the region of the water gauge target in the image is determined based on the target binary mask image. Then, using YOLOv5m, the water gauge scale characters are detected in the target region, identifying the letter E and the character on the water gauge. For two types of characters, obtain the center point coordinates and length and width of the detection box for each character.

[0044] Preferably, the character sequence dynamic interpolation and missing character completion module M5 includes:

[0045] Module M501: For tick marks belonging to the same category in the vertical direction of the image, calculate the distance error between two adjacent characters, and the distance error r in the character sequence. i The calculation method is as follows:

[0046]

[0047] Among them, D (i-1,i) D represents the pixel distance in the vertical direction between two adjacent characters, where the (i-1)th character and the ith character are considered. (i,i+1) This represents the pixel distance in the vertical direction between two adjacent characters, i-th and (i+1)-th characters. The more characters are missed, the greater the pixel distance. i The closer to 1;

[0048] Module M502: Searches for missed characters and performs sequence interpolation; where, when r i If the threshold α is not exceeded, it is considered that there are no missed characters; when r i When the threshold α is exceeded, it is considered that a character has been missed. At this time, the character sequence is interpolated to fill the character sequence with the vertical pixel coordinates of the missed character. The interpolation ν is calculated as follows:

[0049]

[0050] Among them, c i ν represents the vertical coordinate of the character at the i-th position in the current character sequence; insert ν into the character sequence c, ensuring that the character sequence c is an ascending sequence; after one interpolation, the coordinate sequence needs to be traversed from the beginning to perform a new round of missing character search until all missing characters are filled;

[0051] Module M503: Merges and sorts the two completed character sequences to obtain the final water ruler character sequence s:

[0052] s = sort(a∩b) Formula 4

[0053] Where sort represents the sorting function, a represents the character sequence to the left of the watermark after interpolation, and b represents the character sequence to the right of the watermark after interpolation.

[0054] Preferably, in the water level estimation module M6, linear interpolation is used to convert the pixel coordinates into the actual water level height, as shown in Formula 5:

[0055]

[0056] Where W represents the actual water level height, L is the actual length of the water gauge, N is the number of characters in the completed character sequence, Y is the vertical coordinate of the water level line, and s is the final water gauge character sequence obtained after interpolation and completion. N-1This represents the (N-1)th character of the final water ruler character sequence s. N-2 This represents the (N-2)th character of the final water level character sequence s, where scale is a scale character indicating the actual height.

[0057] According to the present invention, a computer-readable storage medium storing a computer program is provided, wherein when the computer program is executed by a processor, the steps of the water level identification method in complex outdoor scenarios are implemented.

[0058] An electronic device according to the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the water level identification method in complex outdoor scenarios.

[0059] Compared with the prior art, the present invention has the following beneficial effects:

[0060] 1. External factors such as changes in light intensity causing white spots on the surface of the water level gauge, foreign matter adhering to the surface, and rust on some metal water level gauges can all reduce the accuracy of water level recognition. To improve the accuracy of water level recognition algorithms in complex scenarios, this invention addresses the problem that the visibility of scale characters on the water level gauge surface is affected by complex external environments, causing the target detection model to be unable to recognize all characters on the water level gauge. This is achieved through a water level recognition algorithm model based on deep learning character detection and sequence interpolation.

[0061] 2. This invention combines a deep learning semantic segmentation model and a target detection model to achieve automatic water level height recognition without any prior conditions.

[0062] 3. This invention uses a sequence interpolation post-processing algorithm to reduce the missed detection of scale characters and improve the accuracy of water level recognition in complex scenarios such as foreign objects adhering to the water gauge or the water gauge being dirty. Attached Figure Description

[0063] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0064] Figure 1 This is a schematic diagram illustrating the working principle. Detailed Implementation

[0065] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the scope of protection of the present invention.

[0066] This invention proposes a water level recognition method for complex image-based scenes, improving the accuracy of character detection-based water level recognition algorithms. Specifically, it includes:

[0067] Image preprocessing step S1: Convert the input RGB image to grayscale and normalize the data preprocessing.

[0068] Water level target segmentation step S2: The water level target is automatically located using a deep learning semantic segmentation model, and the water level line position is extracted simultaneously. In this water level target segmentation step S2: to avoid camera calibration and achieve truly automated water level detection, this invention uses the SDTC segmentation model to locate the water level target. The STTC model can perform pixel-level target detection and classification on images, generating a target mask image. While identifying the water level target, it can also extract the water level line edge information. Formula 1 represents the calculation method for the water level line coordinate Y, P... y Represents the set of vertical coordinates of the points on the water gauge outline:

[0069] Y = max(P) y ) Formula 1

[0070] Step S3 of the water gauge scale character recognition process: Extract the scale characters on the water gauge using a deep learning object detection model. In step S3, it was observed that most of the water gauge scale characters are small, and directly using the original image captured by the camera for character detection is not ideal. Therefore, the target localization obtained in the previous step S2 can be used to narrow down the target detection range, remove the influence of complex backgrounds on character detection, and reduce the computational time complexity of the model. Specifically, the target binary mask image obtained by the STDC segmentation model is used to determine the region of the water gauge target in the image. Yolov5m is then used to detect the water gauge scale characters in the target region. To ensure the integrity of the recognized characters, the image is expanded in the four directions (up, down, left, and right) of the water gauge image. The characters "E" and "..." on the water gauge are then identified. For two types of characters, obtain the center coordinates and width (x, y, w, h) of the detection box for each character. x represents the row coordinate, y represents the column coordinate, w represents the length, and h represents the width.

[0071] Water gauge marking character grouping step S4: Divide the detected water gauge marking characters into two groups according to character category. Generally, the character E is located on the left side of the water gauge, and the character... It is located to the right of the water gauge.

[0072] Step S5: Dynamic interpolation of character sequences to complete missed characters: Due to the influence of complex environmental factors, some water level scale characters obtained through character detection may be missed. Missed characters directly affect the accuracy of the final water level estimation. To compensate for the insufficient ability of the character detection model to recognize scale characters in complex environments, the natural sequence characteristics of the water level scale characters are utilized to complete the missed characters. A character distance checking algorithm is used to calculate the distance error between adjacent characters in the sequence to determine if there are any missing characters. The missing characters are then filled in, and the approximate location of the missing characters in the image is estimated. Step S5, dynamic interpolation of character sequences to complete missed characters, includes:

[0073] Step S501: Calculate the character distance error. Observation of a large amount of watermark data reveals that in the vertical direction of the image, scale characters belonging to the same category have very small distance errors between them and their adjacent characters. The distance error r in the character sequence... i The calculation method is as follows, see Formula 2:

[0074]

[0075] Among them, D (i-1,i) D represents the pixel distance in the vertical direction between two adjacent characters, where the (i-1)th character and the ith character are considered. (i,i+1) Let r represent the pixel distance in the vertical direction between two adjacent characters, i-th and (i+1)-th characters. Typically, the size difference between adjacent characters on the ruler is small, in which case r... i It's a relatively small value. However, when a character is missed, r... i It will become very large, and the more characters are missed, the more r... i The closer it is to 1.

[0076] Step S502: Search for missed characters and perform sequence interpolation. A threshold α is set to determine if any characters are missed. i When the value exceeds α, it is considered that a character has been missed. In this case, the sequence is interpolated, and the vertical pixel coordinates of the missed character are filled into the sequence. The interpolation ν is calculated as shown in Formula 3:

[0077]

[0078] Among them, c i This represents the vertical coordinate of the character at position i in the current character sequence. Insert ν into the character sequence c, ensuring that c is an ascending sequence. After one interpolation, the coordinate sequence needs to be traversed from the beginning to perform a new round of missing character search until all missing characters are filled.

[0079] Step S503: Character Sequence Merging. Merge and sort the two completed character sequences as shown in Formula 4 to obtain the final water ruler character sequence s:

[0080] s = sort(a∩b) Formula 4

[0081] Where sort represents the sorting function, a represents the character sequence to the left of the water ruler after interpolation, and b represents the character sequence to the right of the water ruler after interpolation;

[0082] Water level estimation step S6: Using linear transformation, combined with data such as the actual height of the scale characters and the water level gauge height, the pixel distance is converted into the actual water level height. In the water level estimation step S6, linear interpolation is used to convert the pixel coordinates into the actual water level height, as shown in Formula 5:

[0083]

[0084] Where W represents the actual water level height, L is the actual length of the water gauge, N is the number of characters in the completed character sequence, Y is the vertical coordinate of the water level line, and s is the final water gauge character sequence obtained after interpolation and completion. N-1 This represents the (N-1)th character of the final water ruler character sequence s. N-2 This represents the (N-2)th character of the final water level character sequence s, where scale is a scale character indicating the actual height.

[0085] This invention also provides a water level identification system for complex outdoor scenarios. The system can be implemented by executing the steps of the water level identification method for complex outdoor scenarios. Those skilled in the art can understand the water level identification method for complex outdoor scenarios as a preferred embodiment of the water level identification system for complex outdoor scenarios. Those skilled in the art know that, besides implementing the system, device, and its modules provided by this invention in purely computer-readable program code, the same program can be implemented by logically programming the method steps, making the system, device, and its modules in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system, device, and its modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; the modules for implementing various functions can also be considered as both software programs implementing the method and structures within the hardware component.

[0086] A water level identification system for complex outdoor scenes provided by the present invention includes:

[0087] Image preprocessing module M1: preprocesses the raw images captured by the camera to obtain preprocessed images;

[0088] Water level target segmentation module M2: Based on the pre-processed image, automatically locate the water level target and extract the water level line position;

[0089] Water gauge scale character recognition module M3: Recognizes the scale characters on the water gauge target;

[0090] Water gauge scale character grouping module M4: Divides the scale characters into two character sequences according to character category: the E character sequence on the left side of the water gauge, and the sequence on the right side of the water gauge... Character sequence;

[0091] M5, a module for dynamic interpolation and completion of missing characters in a character sequence, calculates the distance error between adjacent characters in the character sequence, determines whether there are missing characters based on the distance error, and completes the corresponding characters at the missing locations to obtain the completed image.

[0092] Water level estimation module M6: Based on the completed image, converts pixel distances into actual water level heights.

[0093] In the water level target segmentation module M2, the SDTC segmentation model is used to locate the water level target. The STDC model is used to perform pixel-level target detection and classification on the pre-processed image, generating a binary mask image of the target to identify the water level target; simultaneously, the water level line edge information is extracted, and the water level line coordinate Y is calculated as follows:

[0094] Y = max(P) y ) Formula 1

[0095] Among them, P y Represents the set of vertical coordinates of points on the water gauge outline;

[0096] In the water gauge scale character recognition module M3, the region of the water gauge target in the image is determined based on the target binary mask image. Then, using YOLOv5m, the water gauge scale characters are detected in the target region, identifying the letter E and the character on the water gauge. For two types of characters, obtain the center point coordinates and length and width of the detection box for each character.

[0097] The character sequence dynamic interpolation and missing character completion module M5 includes:

[0098] Module M501: For tick marks belonging to the same category in the vertical direction of the image, calculate the distance error between two adjacent characters, and the distance error r in the character sequence. i The calculation method is as follows:

[0099]

[0100] Among them, D (i-1,i) D represents the pixel distance in the vertical direction between two adjacent characters, where the (i-1)th character and the ith character are considered. (i,i+1) This represents the pixel distance in the vertical direction between two adjacent characters, i-th and (i+1)-th characters. The more characters are missed, the greater the pixel distance. i The closer to 1;

[0101] Module M502: Searches for missed characters and performs sequence interpolation; where, when r i If the threshold α is not exceeded, it is considered that there are no missed characters; when r i When the threshold α is exceeded, it is considered that a character has been missed. At this time, the character sequence is interpolated to fill the character sequence with the vertical pixel coordinates of the missed character. The interpolation ν is calculated as follows:

[0102]

[0103] Among them, c i ν represents the vertical coordinate of the character at the i-th position in the current character sequence; insert ν into the character sequence c, ensuring that the character sequence c is an ascending sequence; after one interpolation, the coordinate sequence needs to be traversed from the beginning to perform a new round of missing character search until all missing characters are filled;

[0104] Module M503: Merges and sorts the two completed character sequences to obtain the final water ruler character sequence s:

[0105] s = sort(a∩b) Formula 4

[0106] Where sort represents the sorting function, a represents the character sequence to the left of the watermark after interpolation, and b represents the character sequence to the right of the watermark after interpolation.

[0107] In the water level estimation module M6, linear interpolation is used to convert pixel coordinates into actual water level height, as shown in Formula 5:

[0108]

[0109] Where W represents the actual water level height, L is the actual length of the water gauge, N is the number of characters in the completed character sequence, Y is the vertical coordinate of the water level line, and s is the final water gauge character sequence obtained after interpolation and completion. N-1 This represents the (N-1)th character of the final water ruler character sequence s. N-2 This represents the (N-2)th character of the final water level character sequence s, where scale is a scale character indicating the actual height.

[0110] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A method for water level identification in complex outdoor scenarios, characterized in that, include: Image preprocessing step S1: Preprocess the original image captured by the camera to obtain a preprocessed image; Water level target segmentation step S2: Based on the pre-processed image, automatically locate the water level target and extract the water level line position; Step S3: For the water gauge target, identify the scale characters on the water gauge; Water gauge marking character grouping step S4: Divide the marking characters into two character sequences according to character category: the E character sequence located on the left side of the water gauge, and the sequence located on the right side of the water gauge. Character sequence; Step S5 of dynamic interpolation to complete missing characters in character sequence: Calculate the distance error between adjacent characters in the character sequence, determine whether there are missing characters based on the distance error, and fill in the missing characters to obtain the completed image; Water level estimation step S6: Based on the completed image, convert the pixel distance into the actual water level height; The step S5, which involves dynamically interpolating and completing the missing characters in the character sequence, includes: Step S501: For tick marks belonging to the same category in the vertical direction of the image, calculate the distance error between two adjacent characters, and the distance error in the character sequence. The calculation method is as follows: Formula 2 in, This represents the pixel distance in the vertical direction between two adjacent characters, i-th and i-th. This represents the pixel distance in the vertical direction between two adjacent characters, i-th and (i+1)-th characters. The more characters are missed, the more... The closer to 1; Step S502: Search for missed characters and perform sequence interpolation; where, when Not exceeding the threshold When, it is assumed that no characters are missed; when Exceeding the threshold If a character is missed, the character sequence is interpolated by filling the sequence with the vertical pixel coordinates of the missed character. The calculation method is as follows: Formula 3 in, This represents the vertical coordinate of the character at the i-th position in the current character sequence; Insert character sequence In, ensure the character sequence It is an ascending sequence; after one interpolation is completed, the coordinate sequence needs to be traversed from the beginning to perform a new round of missing character search until all missing characters are filled. Step S503: Merge and sort the two completed character sequences to obtain the final water ruler character sequence. : Formula 4 in, Represents the sorting function. This represents the sequence of characters to the left of the watermark after interpolation. This represents the character sequence to the right of the watermark after interpolation.

2. The water level identification method in complex outdoor scenarios according to claim 1, characterized in that, In the water level target segmentation step S2, the SDTC segmentation model is used to locate the water level target; the STDC model is used to perform pixel-level target detection and classification on the preprocessed image, generating a target binary mask image to identify the water level target; simultaneously, water level line edge information and water level line coordinates are extracted. The calculation method is as follows: Formula 1 in, Represents the set of vertical coordinates of points on the water gauge outline; In the water gauge scale character recognition step S3, the region of the water gauge target in the image is determined based on the target binary mask image. The YOLOv5m algorithm is then used to detect the water gauge scale characters in the target region, identifying the letter E and the character on the water gauge. For two types of characters, obtain the center point coordinates and length and width of the detection box for each character.

3. The water level identification method in complex outdoor scenarios according to claim 1, characterized in that, In the water level estimation step S6, the pixel coordinates are converted into the actual water level height using linear interpolation, as shown in Formula 5: Formula 5 Where W represents the actual water level, L is the actual length of the water gauge, N is the number of characters in the completed character sequence, and Y is the ordinate of the water level line. It is the final watermark character sequence obtained after interpolation, completion, and merging. This represents the final water ruler character sequence. The (N-1)th character, This represents the final water ruler character sequence. The (N-2)th character, scale, is a tick mark indicating the actual height.

4. A water level recognition system for complex outdoor scenarios, characterized in that, include: Image preprocessing module M1: preprocesses the raw images captured by the camera to obtain preprocessed images; Water level target segmentation module M2: Based on the pre-processed image, automatically locate the water level target and extract the water level line position; Water gauge scale character recognition module M3: Recognizes the scale characters on the water gauge target; Water gauge scale character grouping module M4: Divides the scale characters into two character sequences according to character category: the E character sequence on the left side of the water gauge, and the sequence on the right side of the water gauge... Character sequence; M5, a module for dynamic interpolation and completion of missing characters in a character sequence, calculates the distance error between adjacent characters in the character sequence, determines whether there are missing characters based on the distance error, and completes the corresponding characters at the missing locations to obtain the completed image. Water level estimation module M6: Based on the completed image, converts pixel distances into actual water level heights; The character sequence dynamic interpolation and missing character completion module M5 includes: Module M501: For tick marks belonging to the same category in the vertical direction of the image, calculate the distance error between two adjacent characters, and the distance error within the character sequence. The calculation method is as follows: Formula 2 in, This represents the pixel distance in the vertical direction between two adjacent characters, i-th and i-th. This represents the pixel distance in the vertical direction between two adjacent characters, i-th and (i+1)-th characters. The more characters are missed, the more... The closer to 1; Module M502: Searches for missed characters and performs sequence interpolation; where, when Not exceeding the threshold When, it is assumed that no characters are missed; when Exceeding the threshold If a character is missed, the character sequence is interpolated by filling the sequence with the vertical pixel coordinates of the missed character. The calculation method is as follows: Formula 3 in, This represents the vertical coordinate of the character at the i-th position in the current character sequence; Insert character sequence In, ensure the character sequence It is an ascending sequence; after one interpolation is completed, the coordinate sequence needs to be traversed from the beginning to perform a new round of missing character search until all missing characters are filled. Module M503: Merges and sorts the two completed character sequences to obtain the final water ruler character sequence. : Formula 4 in, Represents the sorting function. This represents the sequence of characters to the left of the watermark after interpolation. This represents the character sequence to the right of the watermark after interpolation.

5. The water level identification system for complex outdoor scenarios according to claim 4, characterized in that, In the water level target segmentation module M2, the SDTC segmentation model is used to locate the water level target; the STDC model is used to perform pixel-level target detection and classification on the pre-processed image, generating a target binary mask image to identify the water level target; simultaneously, water level line edge information and water level line coordinates are extracted. The calculation method is as follows: Formula 1 in, Represents the set of vertical coordinates of points on the water gauge outline; In the water gauge scale character recognition module M3, the region of the water gauge target in the image is determined based on the target binary mask image. Then, using YOLOv5m, the water gauge scale characters are detected in the target region, identifying the letter E and the character on the water gauge. For two types of characters, obtain the center point coordinates and length and width of the detection box for each character.

6. The water level identification system for complex outdoor scenarios according to claim 4, characterized in that, In the water level estimation module M6, linear interpolation is used to convert pixel coordinates into actual water level height, as shown in Formula 5: Formula 5 Where W represents the actual water level, L is the actual length of the water gauge, N is the number of characters in the completed character sequence, and Y is the ordinate of the water level line. It is the final watermark character sequence obtained after interpolation, completion, and merging. This represents the final water ruler character sequence. The (N-1)th character, This represents the final water ruler character sequence. The (N-2)th character, scale, is a tick mark indicating the actual height.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the water level identification method in any one of claims 1 to 3 in complex outdoor scenarios.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the water level identification method in any one of claims 1 to 3 in complex outdoor scenarios.

Citation Information

Patent Citations

  • A water level identification method based on image identification

    CN109766886A

  • Water level identification method, device and apparatus for water gauge

    CN111259890A

  • Water level identification method based on water gauge character detection and identification

    CN114067095A