Hydropower station dam osmometer automatic reading method based on machine vision and deep learning

By combining machine vision and deep learning technologies with image preprocessing and deep learning models, the robustness and accuracy issues of piezometer readings have been resolved, enabling efficient and intelligent automatic piezometer readings. This technology is applicable to various dam types and instrument types, supporting intelligent operation and maintenance of water conservancy projects.

CN121999474APending Publication Date: 2026-05-08STATE GRID ZHEJIANG ELECTRIC POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID ZHEJIANG ELECTRIC POWER CO LTD
Filing Date
2025-12-02
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, piezometer readings rely on manual inspection, which is inefficient. Traditional automated methods are not robust and have low recognition accuracy under complex lighting, reflection, and noise interference, making it difficult to meet the development needs of intelligent and digital operation and maintenance of water conservancy projects.

Method used

By employing machine vision and deep learning-based methods, image preprocessing, geometric feature extraction, deep learning object detection, and OCR character recognition, combined with isolated forest anomaly detection, high-precision and robust automatic reading of piezometers is achieved.

Benefits of technology

It achieves high-precision, fully automatic piezometer readings in complex field environments, improves the level of intelligence in dam safety monitoring, meets the requirements for continuous real-time data acquisition 24/7, and has the ability to generalize to various dam types and instrument types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121999474A_ABST
    Figure CN121999474A_ABST
Patent Text Reader

Abstract

The invention discloses a hydropower station dam osmometer automatic reading method based on machine vision and deep learning, and relates to the technical field of dam safety management, and the method comprises the steps: carrying out the adaptive preprocessing of an osmometer image; positioning a dial plate area and fitting a circle center; preliminarily identifying a pointer line segment; a pre-trained YOLO model is adopted to accurately detect a pointer area, and the fitting circle center is combined to calibrate the actual circle center and the tail end position of the pointer; dial scale characters are identified, the centroid position and the radian and distance relative to the actual circle center of the dial scale characters are calculated, a scale data set is constructed, and abnormal data are filtered out through an isolated forest algorithm; and finally, based on the radian of the pointer and the optimized scale data set, performing calculation through polar coordinate mapping and an intelligent interpolation algorithm to obtain a high-precision osmotic pressure reading. According to the invention, full automation, high precision and high robustness of reading of the osmometer are realized, and the defects of low efficiency, large error and poor anti-interference capability of manual inspection and a traditional image processing method are effectively overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dam safety management technology, and in particular to an automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning. Background Technology

[0002] As a crucial infrastructure for water conservancy projects and energy supply, the long-term, stable, and safe operation of dams is of vital importance to national water resource management and energy security. Seepage is one of the common safety hazards in hydraulic structures. Excessive seepage pressure can lead to erosion of dam materials, decreased structural strength, and in severe cases, even catastrophic accidents such as dam slippage, cracking, and dam failure. Therefore, continuous and accurate monitoring of dam seepage is a vital link in ensuring the structural safety of dams.

[0003] Piezometers are commonly used instruments for monitoring seepage pressure in dams, and their readings directly reflect changes in seepage pressure within the dam body. Currently, tubular piezometers are widely used in engineering projects due to their simple structure, high stability, and low cost. However, the readings of these instruments still mainly rely on manual on-site inspections, which suffers from problems such as large subjective errors in readings, poor data continuity, and low inspection efficiency, making it difficult to meet the development needs of intelligent and digital operation and maintenance in modern water conservancy projects.

[0004] In recent years, with the development of machine vision and image processing technologies, some automated reading methods based on image recognition have emerged. These methods typically rely on traditional image processing algorithms, such as edge detection, binarization, and Hough transform, attempting to achieve automatic recognition of instrument pointers and scales through image analysis. However, in real-world engineering environments, piezometer images are often subject to various interferences, such as uneven lighting, dial reflections, scale adhesion, and complex backgrounds. Traditional methods exhibit significant shortcomings in robustness, recognition accuracy, and generalization ability, especially performing poorly under complex lighting and low-contrast conditions.

[0005] With the rapid development of deep learning technology, especially the successful application of Convolutional Neural Networks (CNNs) in object detection and image segmentation, new technical paths have been provided for automatic instrument identification. Advances in Optical Character Recognition (OCR) technology have also made automatic extraction of scale text possible. However, currently, there is no system that can deeply integrate multiple technologies such as image preprocessing, geometric feature extraction, deep learning object detection, OCR character recognition, and anomaly filtering to achieve end-to-end high-precision and robust automatic piezometer reading.

[0006] Therefore, there is an urgent need to develop a piezometer identification method that can adapt to complex field environments, has strong anti-interference capabilities, and achieves fully automatic high-precision readings, so as to improve the intelligent level of dam safety monitoring and support the digital transformation of water conservancy projects and the construction of intelligent operation and maintenance systems. Summary of the Invention

[0007] To address this, this invention provides an automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning. This method solves the problems of low efficiency due to reliance on manual inspections in existing technologies, as well as poor robustness and low recognition accuracy of traditional automated methods under complex lighting, reflection, and noise interference.

[0008] To address the aforementioned technical problems, this invention provides a method for automatically reading piezometer readings in hydropower station dams based on machine vision and deep learning. The method includes the following steps: Step S1: The acquired piezometer image is subjected to image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization and edge detection in sequence to suppress uneven illumination, reflection and noise interference and enhance the edge features of the instrument. Step S2: Analyze the grayscale image processed by Gaussian filtering in step S1 to generate the fitting disk and center coordinates of the piezometer. Step S3: Calculate the edge data extracted in step S1, identify and locate the line segment where the piezometer pointer is located; Step S4: Use the trained YOLO model to identify the pointer area in the piezometer image, and combine it with the fitted center coordinates obtained in step S2 to perform position calibration, accurately locating the actual center of the dial and the end point of the pointer. Step S5: Identify the scale characters on the piezometer dial, calculate the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, construct a scale dataset, and filter out abnormal scale data in the dataset to obtain an optimized scale dataset. Step S6: Based on the pointer radian obtained in step S5 and the optimized scale dataset, establish the mapping relationship between the pointer radian and the scale value, and calculate the final reading of the piezometer.

[0009] Preferably, in step S1, the method of sequentially performing image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization, and edge detection on the acquired piezometer image specifically includes: The image size normalization sets scaling factors for the horizontal x-axis and vertical y-axis respectively, so that the dial shape in the normalized image is close to a standard circle. The grayscale processing converts the RGB three-channel image into a single-channel grayscale image using a preset formula, with pixel values ​​ranging from [0, 255]. The preset formula is as follows: Gray = 0.299R + 0.587G + 0.114B; Where Gray represents the calculated grayscale value, which is an integer between 0 and 255, where 0 represents pure black and 255 represents pure white; R represents the red channel intensity value of the current pixel in the original color image; G represents the green channel intensity value of the current pixel in the original color image; and B represents the blue channel intensity value of the current pixel in the original color image. The Gaussian filtering employs a linear smoothing filter of a specified size to perform a two-dimensional Gaussian convolution operation. The two-dimensional Gaussian distribution function is: ; in, Represents a two-dimensional coordinate point The function value calculated at that location; Represents the coordinates of any point on a two-dimensional plane; This represents the mean of a two-dimensional Gaussian distribution; This represents the standard deviation of a Gaussian distribution. and It is a mathematical constant; The adaptive binarization sets a dynamic threshold on the Gaussian filtered image and converts it into a mask image containing only 0 and 1; The edge detection uses the Canny operator to calculate the gradient of the mask image, combined with a non-maximum suppression algorithm to locate local maxima of the gradient magnitude. The relevant formula for edge detection is: ; ; in, This represents the first derivative of the image in the horizontal direction. This represents the first derivative of the image in the vertical direction; Indicates at pixel point The gradient magnitude calculated at the pixel is shown below. Indicates at pixel point Gradient magnitude at; This represents the gradient magnitude output by the pixel after non-maximum suppression. This represents the low threshold of the gradient magnitude; This represents the gradient magnitude of another pixel adjacent to the current pixel along the gradient direction. and The offset parameter represents the gradient direction.

[0010] Preferably, in step S2, the method for analyzing the grayscale image processed by Gaussian filtering in step S1 to generate the coordinates of the fitting disk and the center of the fitting disk of the piezometer specifically includes: The gradient of the input grayscale image is calculated by preset parameters, and multiple candidate circles are detected within the set maximum and minimum radius range. The two-dimensional center coordinates and radius of each circle are used as the candidate circle set. The candidate circle set is fitted using the least squares method to obtain the optimal fitted circle center and fitted radius, thereby determining the prototype area of ​​the piezometer dial.

[0011] Preferably, in step S3, the method for calculating, identifying, and locating the line segment where the piezometer pointer is located based on the edge data extracted in step S1 specifically includes: Polar coordinate parameterization: transforming the image space to the polar coordinate parameter space. ,in This represents the perpendicular distance from the line to the origin. The angle between the normal to the line and the x-axis, ranging from 0° to 180°; Discretized accumulator: and Discretize the data into a grid with a fixed step size and construct a two-dimensional accumulator array; Parameter space voting: Traverse the coordinates of each edge point ,calculate The nearest grid cell is found in the accumulator and the count is accumulated. Peak extraction: Detect local maxima in the accumulator, and filter out significant peaks that characterize the potential straight line by setting a threshold and combining it with nonmaxima suppression. Linear restoration: Restore the peak point Convert the equation to a straight line, calculate the coordinates of the endpoints of the line on the image boundary, and determine the line segment corresponding to the pointer.

[0012] Preferably, in step S4, the method of using a trained YOLO model to identify the pointer region in the piezometer image and combining it with the fitted center coordinates obtained in step S2 for position calibration, to accurately locate the actual center of the dial and the pointer tip, specifically includes: Prepare the dataset: preprocess the image samples, use the LabelImg tool to draw rectangular bounding boxes in the pointer area and label the categories, and convert the label files to JSON format; Training the model: Load the pre-trained weights and JSON format label files of the YOLO model, configure hyperparameters, including batch size, total number of training epochs, input sample size, training device type, optimizer, complete model training, and output the YOLO model file; Model Inference and Position Calibration: Load the YOLO model file, detect the pointer region, and identify the confidence score. Based on the fitted circle center coordinates obtained in step S2, calculate the distance from each vertex of the bounding box to the circle center using the Euclidean distance formula. Determine the vertex corresponding to the minimum distance as the actual circle center. Infer the pointer end position based on the spatial relationship between the geometric center of the bounding box and the circle center. Connect the actual circle center and the pointer end position to obtain the pointer direction. The Euclidean distance formula is expressed as: ; in, Let Euclidean distance be the distance from each vertex of the bounding box to the center of the fitted circle. , These are the coordinates of the bounding box vertices. , The coordinates of the fitted circle center obtained in step S2 are given.

[0013] Preferably, in step S5, the method for identifying the scale characters on the piezometer dial, calculating the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, constructing a scale dataset, and filtering out abnormal scale data in the dataset to obtain an optimized scale dataset specifically includes: Scale information extraction: Based on the image after size normalization in step S1, extract each text string on the dial and mark the rectangular bounding box. Calculate the geometric center of each box as the centroid position. Apply the constraints of a preset bounding box size threshold and text length not exceeding a preset length threshold. Filter valid scale values ​​using a floating-point conversion algorithm. Calculate the Euclidean distance between the centroid of the filtered text and the actual center of the circle obtained in step S4. Use the arctangent function to calculate the corresponding radian value and pointer radian. Convert the text string into a floating-point scale value and integrate it with its corresponding Euclidean distance and centroid radian value. From the triplet dataset, a scale dataset is obtained; the arctangent function is expressed as: ; in, The radians corresponding to the centroid of the text string. and Using the centroid coordinates, and The coordinates of the actual center of the circle obtained in step S4; Outlier scale filtering: Extract all Euclidean distances from the scale dataset to form a set. By randomly selecting features and split points, multiple isolated trees are recursively constructed. The path length from the root node to the isolated node of each Euclidean distance sample in each isolated tree is calculated and the standardized outlier score is obtained. A threshold is set to remove the Euclidean distance samples corresponding to the outlier data. The scale dataset is optimized by sorting by radian value to obtain the optimized scale dataset.

[0014] Preferably, in step S6, the method for establishing a mapping relationship between the pointer radians and scale values ​​based on the pointer radians obtained in step S5 and the optimized scale dataset, and calculating the final reading of the piezometer, specifically includes: Adjacent radian interval positioning: based on the current radian value of the pointer. The algorithm iterates through and compares the radian set in the scale dataset to determine the adjacent radian intervals in which it is located. Pointer reading calculation: when When it is greater than the maximum value in the set of radians, it is determined by the formula. Calculate the arc difference ratio; the pointer scale value is... ,in , The radian value corresponding to two adjacent tick marks in the tick dataset; , These are the actual scale values ​​corresponding to the above radian values; It is the arc difference ratio; when When the value lies between two adjacent radian values ​​in the radian set, calculate the radian difference ratio between the two adjacent radian values. The pointer scale value is... ; when When the value is less than the minimum value of the radian set, calculate the ratio of the radian difference between the minimum and the second minimum value, and the pointer scale value is... .

[0015] This invention also provides an automatic reading system for hydropower station dam piezometers based on machine vision and deep learning. This system is used to implement the aforementioned automatic reading method for hydropower station dam piezometers based on machine vision and deep learning, including: The image preprocessing module is used to perform image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization and edge detection on the acquired piezometer images in sequence, so as to suppress uneven illumination, reflection and noise interference and enhance the edge features of the instrument. The dial positioning module is used to analyze the grayscale image processed by the Gaussian filter in the image preprocessing module and generate the coordinates of the piezometer fitting disk and the center of the fitting circle. The pointer preliminary detection module is used to calculate the edge data extracted by the image preprocessing module, identify and locate the line segment where the piezometer pointer is located; The pointer precision positioning and calibration module is used to identify the pointer area in the piezometer image using a trained YOLO model, and to perform position calibration by combining the fitted center coordinates obtained from the dial positioning module, so as to accurately locate the actual center of the dial and the end point of the pointer. The scale recognition and optimization module is used to recognize the scale characters on the piezometer dial, calculate the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, construct a scale dataset, and filter out abnormal scale data in the dataset to obtain an optimized scale dataset. The intelligent reading calculation module is used to establish a mapping relationship between the pointer radian and the scale value based on the pointer radian obtained by the scale recognition and optimization module and the optimized scale dataset, and to calculate the final reading of the piezometer.

[0016] This invention also provides an electronic device, which includes a processor, a memory, and a bus system. The processor and the memory are connected through the bus system. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to realize the above-described automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning.

[0017] This invention also provides a computer storage medium storing a computer software product, the computer software product including several instructions to cause a computer device to execute the above-described automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning.

[0018] As can be seen from the above technical solutions, this invention application has the following beneficial effects: (1) This invention effectively solves the problem of interference to reading recognition caused by complex working conditions at hydropower stations (such as uneven lighting, dial reflection, random noise, and scale adhesion) by constructing an adaptive image preprocessing module (including size normalization, adaptive binarization, Canny edge detection and non-maximum suppression, etc.) and using the isolated forest anomaly detection algorithm to optimize the scale data. This method does not use a fixed threshold processing, but dynamically adjusts it according to the local features of the image, thereby significantly improving the robustness and stability of the entire system in variable environments and overcoming the shortcomings of traditional automated methods that suffer from a sharp drop in recognition rate under harsh conditions.

[0019] (2) This invention creatively integrates traditional geometric algorithms with deep learning models. First, Hough circle detection is used to initially locate the dial; then, a lightweight YOLO object detection model is introduced to accurately identify the pointer, and the detection results are used to calculate and calibrate the Euclidean distance with the initial circle center, thereby achieving sub-pixel-level accurate positioning of the actual circle center and the end of the pointer. At the same time, PaddleOCR (GPU accelerated) is used to accurately identify the scale characters, and a mapping dataset is constructed by combining the spatial geometric relationship (radians, distance) between the scale and the circle center. This multi-stage collaborative strategy of "coarse positioning using traditional methods + fine calibration using deep learning + OCR character recognition" ensures high accuracy throughout the entire process from image to reading, and significantly reduces the misidentification rate of the pointer and scale.

[0020] (3) This invention provides a complete end-to-end automated processing flow, completely replacing the inefficient and subjective manual inspection mode, realizing continuous and real-time data acquisition 24 / 7, and meeting the data timeliness requirements of intelligent operation and maintenance. In addition, the core deep learning model (YOLO) and OCR engine in the solution can be quickly adapted to different types and brands of piezometer dials by changing the training dataset, and the intelligent interpolation algorithm is also independent of the specific scale distribution. Therefore, this method is not only applicable to various dam types such as concrete gravity dams, arch dams, and earth dams, but also has a strong generalization ability for more instrument types in the future, providing a reusable technical framework for the large-scale and intelligent safety monitoring of hydropower station dams. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Referring to the drawings will make the features and advantages of the present invention clearer. The drawings are illustrative and should not be construed as limiting the present invention in any way. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart of an automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning, provided by the present invention. Figure 2 This is a rendering of the automatic reading method for dam piezometers according to the present invention; Figure 3 This is a rendering of the automatic reading method for dam piezometers according to the present invention; Figure 4 This is a rendering of the automatic reading method for dam piezometers according to the present invention; Figure 5 This is a block diagram of an automatic reading system for seepage gauges in hydropower station dams based on machine vision and deep learning, provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example

[0023] To address the inefficiencies of existing technologies that rely on manual inspections, and the poor robustness and low accuracy of traditional automated methods under complex lighting, reflection, and noise interference, such as... Figure 1 As shown, this invention proposes an automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning, comprising the following steps: Step S1: The acquired piezometer image is subjected to image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization and edge detection in sequence to suppress uneven illumination, reflection and noise interference and enhance the edge features of the instrument. Step S2: Analyze the grayscale image processed by Gaussian filtering in step S1 to generate the fitting disk and center coordinates of the piezometer. Step S3: Calculate the edge data extracted in step S1, identify and locate the line segment where the piezometer pointer is located; Step S4: Use the trained YOLO model to identify the pointer area in the piezometer image, and combine it with the fitted center coordinates obtained in step S2 to perform position calibration, accurately locating the actual center of the dial and the end point of the pointer. Step S5: Identify the scale characters on the piezometer dial, calculate the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, construct a scale dataset, and filter out abnormal scale data in the dataset to obtain an optimized scale dataset. Step S6: Based on the pointer radian obtained in step S5 and the optimized scale dataset, establish the mapping relationship between the pointer radian and the scale value, and calculate the final reading of the piezometer.

[0024] As can be seen from the above technical solution, this invention proposes an automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning. It achieves high-precision, robust, and fully automatic recognition through an end-to-end collaborative processing flow. First, the original image undergoes adaptive preprocessing to effectively suppress interference from complex lighting, reflections, and noise, and enhances the key edge features of the instrument. Based on this, Hough transform is used for circle detection and line detection respectively, initially and accurately locating the geometric area of ​​the dial and identifying the pointer direction. Then, a trained YOLO deep learning model is introduced to accurately detect the pointer area and calibrate it with the preliminary geometric results, thereby accurately locating the actual center of the circle and the end of the pointer, solving the positioning deviation caused by image deformation or occlusion in traditional methods. Subsequently, PaddleOCR is used to recognize the dial scale characters, and a scale dataset is constructed by calculating the spatial geometric relationship (Euclidean distance, radians) of the character centroids. Combined with the isolated forest algorithm, abnormal data is intelligently filtered out, ensuring the reliability of the scale information. Finally, based on the pointer radians and the optimized scale dataset, a precise mapping relationship is established through polar coordinate mapping and intelligent interpolation algorithms, ultimately outputting high-precision piezometer readings. This method, through the close collaboration of multiple technical modules, comprehensively improves the recognition accuracy, anti-interference capability, and automation level under complex working conditions.

[0025] In step S1, the acquired piezometer image is sequentially subjected to image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization, and edge detection, specifically including: 1. Image size normalization: To address the issue of inconsistent image sizes, independent scaling factors are set for the horizontal (x-axis) and vertical (y-axis) axes of the image (e.g., 0.8 for x-axis and 0.9 for y-axis) to make the dial shape in the image closer to a standard circle after normalization, which facilitates subsequent circle detection.

[0026] 2. Grayscale Conversion: Converts an RGB three-channel color image to a single-channel grayscale image, with pixel values ​​ranging from [0, 255]. The conversion formula is: Gray = 0.299R + 0.587G + 0.114B; Where Gray represents the calculated grayscale value, which is an integer between 0 and 255, where 0 represents pure black and 255 represents pure white; R represents the red channel intensity value of the current pixel in the original color image; G represents the green channel intensity value of the current pixel in the original color image; and B represents the blue channel intensity value of the current pixel in the original color image.

[0027] 3. Gaussian Filtering: This involves performing a two-dimensional Gaussian convolution operation on a grayscale image using a linear smoothing filter of a specified size (e.g., 5×5) to smooth the image and suppress noise. The two-dimensional Gaussian distribution function is: ; in, Represents a two-dimensional coordinate point The function value calculated at that location; Represents the coordinates of any point on a two-dimensional plane; This represents the mean of a two-dimensional Gaussian distribution; This represents the standard deviation of a Gaussian distribution. and It is a mathematical constant; 4. Adaptive Binarization: For the filtered image, the threshold is dynamically calculated based on the local pixel distribution to generate a binary mask image containing only 0 (black) and 1 (white), simplifying the image structure.

[0028] 5. Edge Detection: The Canny operator is used to calculate the gradient of the mask image, accurately extracting edge information from the original piezometer image and exhibiting good noise robustness. Local maxima of the gradient magnitude are located, and non-extreme responses in the neighborhood are suppressed, thereby improving the accuracy and efficiency of edge detection. The gradient magnitude is calculated as follows: The nonmaximum suppression logic is shown in the following equation: ; in, This represents the first derivative of the image in the horizontal direction. This represents the first derivative of the image in the vertical direction; Indicates at pixel point The gradient magnitude calculated at the pixel is shown below. Indicates at pixel point Gradient magnitude at; This represents the gradient magnitude output by the pixel after non-maximum suppression. This represents the low threshold of the gradient magnitude; This represents the gradient magnitude of another pixel adjacent to the current pixel along the gradient direction. and The offset parameter represents the gradient direction.

[0029] In step S2, based on the Hough circle detection algorithm, the grayscale image processed by Gaussian filtering in step S1 is analyzed to generate the fitting disk and center coordinates of the piezometer. Specifically, this includes: 1. The gradient of the input grayscale image is calculated using preset parameters. Multiple candidate circles are detected within the set maximum and minimum radius range (e.g., 80 to 120 pixels). The two-dimensional center coordinates and radius of each circle are used as the candidate circle set.

[0030] 2. Fit the candidate circle set based on the least squares method to obtain the optimal fitted circle center (e.g., (480, 520)) and fitted radius (e.g., 100 pixels), and determine the prototype area of ​​the piezometer dial.

[0031] In step S3, based on the Hough line detection algorithm, the edge data extracted in step S1 is calculated to identify and locate the line segment where the piezometer pointer is located, specifically including: 1. Polar coordinate parameterization: Transforming the image space into polar coordinate parameter space. ,in This represents the perpendicular distance from the line to the origin. The angle between the normal to the line and the x-axis ranges from 0° to 180°.

[0032] 2. Discretization accumulator: ... and Discretize the data into a grid with a fixed step size and construct a two-dimensional accumulator array.

[0033] 3. Parameter space voting: Traverse the coordinates of each edge point ,calculate The accumulator searches for the nearest grid cell and accumulates the count.

[0034] 4. Peak Extraction: Detect local maxima in the accumulator, and by setting a threshold and combining it with nonmaxima suppression, screen out significant peaks that characterize the potential straight line.

[0035] 5. Linear Restoration: Restore the peak points Convert the equation to a straight line, calculate the coordinates of the endpoints of the line on the image boundary, and determine the line segment corresponding to the pointer.

[0036] In step S4, the trained YOLO model is used to identify the pointer region in the piezometer image, and the position is calibrated by combining the fitted center coordinates obtained in step S2. The method for accurately locating the actual center of the dial and the pointer tip includes: 1. Prepare the dataset: Preprocess the image samples, prepare a labeled piezometer image dataset (e.g., 1000 images), use the LabelImg tool to draw a rectangular bounding box in the pointer area and label the category, and convert the labeled file to JSON format; 2. Train the model: Load the pre-trained weights and JSON format label files of the YOLO model, configure hyperparameters, including batch size, total number of training epochs, input sample size, training device type, and optimizer (e.g., batch size 8, training epochs 100, input size 640×640, SGD optimizer), complete the model training, and output the YOLO model file; 3. Model Inference and Position Calibration: Load the YOLO model file to detect the pointer region and label the confidence score. Based on the fitted circle center coordinates obtained in step S2, calculate the distance from each vertex of the bounding box to the circle center using the Euclidean distance formula. Determine the vertex corresponding to the minimum distance as the actual circle center. Infer the pointer end position based on the spatial relationship between the geometric center of the bounding box and the circle center. Connect the actual circle center and the pointer end position to obtain the pointer direction. This result can be used to calibrate the preliminary detection in step S3. The Euclidean distance formula is expressed as: ; in, Let Euclidean distance be the distance from each vertex of the bounding box to the center of the fitted circle. , These are the coordinates of the bounding box vertices. , The coordinates of the fitted circle center obtained in step S2 are given.

[0037] In step S5, the scale characters on the piezometer dial are identified, the centroid position of each character and its Euclidean distance and radian from the actual center are calculated, a scale dataset is constructed, and abnormal scale data in the dataset are filtered out to obtain an optimized scale dataset, specifically including: 1. Scale Information Extraction: The image after size normalization in step S1 is input into the PaddleOCR module (using GPU-accelerated inference) to extract each text string on the dial and label the rectangular bounding boxes. The geometric center of each box is calculated as the centroid position. A preset bounding box size threshold and a text length not exceeding a preset length threshold (e.g., 4) are applied. Valid scale values ​​(e.g., "0.04", "0.05") are filtered using a floating-point conversion algorithm. The Euclidean distance between the centroid of the filtered text and the actual circle center obtained in step S4 is calculated. The corresponding radian value and pointer radian are calculated using the arctangent function. The text string is converted into a floating-point scale value, and its corresponding Euclidean distance and centroid radian are integrated into the result. From the triplet dataset, we obtain the scale dataset; the arctangent function is expressed as: ; in, The radians corresponding to the centroid of the text string. and Using the centroid coordinates, and These are the coordinates of the actual center of the circle obtained in step S4. 2. Outlier scale filtering: Extract all Euclidean distances from the scale dataset to form a set. By randomly selecting features and split points, multiple isolated trees are recursively constructed. The path length from the root node to the isolated node of each Euclidean distance sample in each isolated tree is calculated and a standardized outlier score is obtained. A threshold (such as 0.85) is set to remove Euclidean distance samples corresponding to outlier data (e.g., removing 3% of outlier data). The scale dataset is optimized by sorting by radian value, resulting in the optimized scale dataset.

[0038] In step S6, based on the pointer radians obtained in step S5 and the optimized scale dataset, a mapping relationship between the pointer radians and scale values ​​is established, and the final reading of the piezometer is calculated, specifically including: Adjacent radian interval positioning: based on the current radian value of the pointer. The algorithm iterates through and compares the radian set in the scale dataset to determine the adjacent radian intervals in which it is located. Pointer reading calculation: when When it is greater than the maximum value in the set of radians, it is determined by the formula. Calculate the arc difference ratio; the pointer scale value is... ,in , The radian value corresponding to two adjacent tick marks in the tick dataset; , These are the actual scale values ​​corresponding to the above radian values; It is the arc difference ratio; when When the value lies between two adjacent radian values ​​in the radian set, calculate the radian difference ratio between the two adjacent radian values. The pointer scale value is... ; when When the value is less than the minimum value of the radian set, calculate the ratio of the radian difference between the minimum and the second minimum value, and the pointer scale value is... .

[0039] Example Results: Taking a precision pressure gauge-type piezometer of a concrete gravity dam as an example, after processing the acquired image using the above procedure, the pointer radian value was 0.52 rad, falling between 0.5 rad (0.04 MPa) and 0.55 rad (0.0 MPa) in the scale dataset. After calculating the radian difference ratio, the final reading was 0.044 MPa, with an error of less than 0.001 MPa compared to the manually verified value, verifying the high precision of the method of this invention.

[0040] This invention is applicable to all types of dams, including concrete gravity dams, concrete arch dams, homogeneous earth dams, and concrete-faced rockfill dams. Figures 2 to 4 The graphs show the reading effects in different scenarios. Figure 2 Reading: 0.043 MPa Figure 3 Reading: 0.0897 MPa Figure 4The readings were all 0.232 MPa, calculated using the method described in this embodiment. The errors between these readings and the actual verification values ​​were all <0.001 MPa, verifying the accuracy and stability of the method. Example

[0041] like Figure 5 As shown, this invention provides an automatic reading system for hydropower station dam piezometers based on machine vision and deep learning. This system is used to implement the automatic reading method for hydropower station dam piezometers based on machine vision and deep learning described in Embodiment 1 above, specifically including: The image preprocessing module 100 is used to perform image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization and edge detection on the acquired piezometer image in sequence, so as to suppress uneven illumination, reflection and noise interference and enhance the edge features of the instrument. The dial positioning module 200 is used to analyze the grayscale image processed by the image preprocessing module through Gaussian filtering, and generate the coordinates of the fitting disk and the center of the fitting circle of the piezometer. The pointer preliminary detection module 300 is used to calculate the edge data extracted by the image preprocessing module, identify and locate the line segment where the piezometer pointer is located; The pointer precision positioning and calibration module 400 is used to identify the pointer area in the piezometer image using a trained YOLO model, and perform position calibration by combining the fitted center coordinates obtained by the dial positioning module to accurately locate the actual center of the dial and the end point of the pointer. The scale recognition and optimization module 500 is used to recognize the scale characters on the piezometer dial, calculate the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, construct a scale dataset, and filter out abnormal scale data in the dataset to obtain an optimized scale dataset. The intelligent reading calculation module 600 is used to establish a mapping relationship between the pointer radian and the scale value based on the pointer radian obtained by the scale recognition and optimization module and the optimized scale dataset, and to calculate the final reading of the piezometer.

[0042] This embodiment provides an automatic reading system for a hydropower station dam piezometer based on machine vision and deep learning. This system implements the aforementioned automatic reading method for a hydropower station dam piezometer based on machine vision and deep learning. Therefore, the specific implementation of this automatic reading system can be found in the previous section on the implementation of the automatic reading method for a hydropower station dam piezometer based on machine vision and deep learning. For example, the image preprocessing module 100, dial positioning module 200, pointer preliminary detection module 300, pointer precise positioning and calibration module 400, scale recognition and optimization module 500, and intelligent reading calculation module 600 are respectively used to implement steps S1, S2, S3, S4, S5, and S6 in the aforementioned automatic reading method for a hydropower station dam piezometer based on machine vision and deep learning. Therefore, the specific implementation can be referred to in the description of the corresponding embodiments. To avoid redundancy, further details are omitted here. Example

[0043] This invention provides an electronic device, which includes a processor, a memory, and a bus system. The processor and the memory are connected through the bus system. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to realize the above-mentioned automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning. Example

[0044] This invention provides a computer storage medium storing a computer software product, which includes several instructions to cause a computer device to execute the above-described automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning.

[0045] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0046] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0047] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0048] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A method for automatically reading piezometers in hydropower station dams based on machine vision and deep learning, characterized in that, Includes the following steps: Step S1: The acquired piezometer image is subjected to image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization and edge detection in sequence to suppress uneven illumination, reflection and noise interference and enhance the edge features of the instrument. Step S2: Analyze the grayscale image processed by Gaussian filtering in step S1 to generate the fitting disk and center coordinates of the piezometer. Step S3: Calculate the edge data extracted in step S1, identify and locate the line segment where the piezometer pointer is located; Step S4: Use the trained YOLO model to identify the pointer area in the piezometer image, and combine it with the fitted center coordinates obtained in step S2 to perform position calibration, accurately locating the actual center of the dial and the end point of the pointer. Step S5: Identify the scale characters on the piezometer dial, calculate the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, construct a scale dataset, and filter out abnormal scale data in the dataset to obtain an optimized scale dataset. Step S6: Based on the pointer radian obtained in step S5 and the optimized scale dataset, establish the mapping relationship between the pointer radian and the scale value, and calculate the final reading of the piezometer.

2. The automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning according to claim 1, characterized in that, In step S1, the method of sequentially performing image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization, and edge detection on the acquired piezometer image specifically includes: The image size normalization sets scaling factors for the horizontal x-axis and vertical y-axis respectively, so that the dial shape in the normalized image is close to a standard circle. The grayscale processing converts the RGB three-channel image into a single-channel grayscale image using a preset formula, with pixel values ​​ranging from [0, 255]. The preset formula is as follows: Gray = 0.299R + 0.587G + 0.114B; Where Gray represents the calculated grayscale value, which is an integer between 0 and 255, where 0 represents pure black and 255 represents pure white; R represents the red channel intensity value of the current pixel in the original color image; G represents the green channel intensity value of the current pixel in the original color image; and B represents the blue channel intensity value of the current pixel in the original color image. The Gaussian filtering employs a linear smoothing filter of a specified size to perform a two-dimensional Gaussian convolution operation. The two-dimensional Gaussian distribution function is: ; in, Represents a two-dimensional coordinate point The function value calculated at that location; Represents the coordinates of any point on a two-dimensional plane; This represents the mean of a two-dimensional Gaussian distribution. This represents the standard deviation of a Gaussian distribution. and It is a mathematical constant; The adaptive binarization sets a dynamic threshold on the Gaussian filtered image and converts it into a mask image containing only 0 and 1; The edge detection uses the Canny operator to calculate the gradient of the mask image, combined with a non-maximum suppression algorithm to locate local maxima of the gradient magnitude. The relevant formula for edge detection is: ; ; in, This represents the first derivative of the image in the horizontal direction; This represents the first derivative of the image in the vertical direction; Indicates at pixel point The gradient magnitude calculated at the pixel is shown below. Indicates at pixel point Gradient magnitude at; This represents the gradient magnitude output by the pixel after non-maximum suppression. This represents the low threshold of the gradient magnitude; This represents the gradient magnitude of another pixel adjacent to the current pixel along the gradient direction. and The offset parameter represents the gradient direction.

3. The automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning according to claim 1, characterized in that, In step S2, the method for analyzing the grayscale image processed by Gaussian filtering in step S1 to generate the coordinates of the fitting disk and the center of the fitting disk of the piezometer specifically includes: The gradient of the input grayscale image is calculated by preset parameters, and multiple candidate circles are detected within the set maximum and minimum radius range. The two-dimensional center coordinates and radius of each circle are used as the candidate circle set. The candidate circle set is fitted using the least squares method to obtain the optimal fitted circle center and fitted radius, thereby determining the prototype area of ​​the piezometer dial.

4. The automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning according to claim 1, characterized in that, In step S3, the method for calculating, identifying, and locating the line segment where the piezometer pointer is located based on the edge data extracted in step S1 specifically includes: Polar coordinate parameterization: transforming the image space to the polar coordinate parameter space. ,in This represents the perpendicular distance from the line to the origin. The angle between the normal to the line and the x-axis, ranging from 0° to 180°; Discretized accumulator: and Discretize the data into a grid with a fixed step size and construct a two-dimensional accumulator array; Parameter space voting: Traverse the coordinates of each edge point ,calculate The nearest grid cell is found in the accumulator and the count is accumulated. Peak extraction: Detect local maxima in the accumulator, and filter out significant peaks that characterize the potential straight line by setting a threshold and combining it with nonmaxima suppression. Linear restoration: Restore the peak point Convert the equation to a straight line, calculate the coordinates of the endpoints of the line on the image boundary, and determine the line segment corresponding to the pointer.

5. The automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning according to claim 1, characterized in that, In step S4, the method of using a trained YOLO model to identify the pointer region in the piezometer image and combining it with the fitted center coordinates obtained in step S2 for position calibration, and accurately locating the actual center of the dial and the pointer tip, specifically includes: Prepare the dataset: preprocess the image samples, use the LabelImg tool to draw rectangular bounding boxes in the pointer area and label the categories, and convert the label files to JSON format; Training the model: Load the pre-trained weights and JSON format label files of the YOLO model, configure hyperparameters, including batch size, total number of training epochs, input sample size, training device type, optimizer, complete model training, and output the YOLO model file; Model Inference and Position Calibration: Load the YOLO model file, detect the pointer region, and identify the confidence score. Based on the fitted circle center coordinates obtained in step S2, calculate the distance from each vertex of the bounding box to the circle center using the Euclidean distance formula. Determine the vertex corresponding to the minimum distance as the actual circle center. Infer the pointer end position based on the spatial relationship between the geometric center of the bounding box and the circle center. Connect the actual circle center and the pointer end position to obtain the pointer direction. The Euclidean distance formula is expressed as: ; in, Let Euclidean distance be the distance from each vertex of the bounding box to the center of the fitted circle. , These are the coordinates of the bounding box vertices. , The coordinates of the fitted circle center obtained in step S2 are given.

6. The automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning according to claim 1, characterized in that, In step S5, the method for identifying the scale characters on the piezometer dial, calculating the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, constructing a scale dataset, and filtering out abnormal scale data in the dataset to obtain an optimized scale dataset specifically includes: Scale information extraction: Based on the image after size normalization in step S1, extract each text string on the dial and mark the rectangular bounding box. Calculate the geometric center of each box as the centroid position. Apply the constraints of a preset bounding box size threshold and text length not exceeding a preset length threshold. Filter valid scale values ​​using a floating-point conversion algorithm. Calculate the Euclidean distance between the centroid of the filtered text and the actual center of the circle obtained in step S4. Use the arctangent function to calculate the corresponding radian value and pointer radian. Convert the text string into a floating-point scale value and integrate it with its corresponding Euclidean distance and centroid radian value. From the triplet dataset, a scale dataset is obtained; the arctangent function is expressed as: ; in, The radians corresponding to the centroid of the text string. and Using the centroid coordinates, and The coordinates of the actual center of the circle obtained in step S4; Outlier scale filtering: Extract all Euclidean distances from the scale dataset to form a set. By randomly selecting features and split points, multiple isolated trees are recursively constructed. The path length from the root node to the isolated node of each Euclidean distance sample in each isolated tree is calculated and the standardized outlier score is obtained. A threshold is set to remove the Euclidean distance samples corresponding to the outlier data. The scale dataset is optimized by sorting by radian value to obtain the optimized scale dataset.

7. The automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning according to claim 1, characterized in that, In step S6, based on the pointer radians obtained in step S5 and the optimized scale dataset, a mapping relationship between the pointer radians and scale values ​​is established, and the final reading of the piezometer is calculated. This method specifically includes: Adjacent radian interval positioning: based on the current radian value of the pointer. The algorithm iterates through and compares the radian set in the scale dataset to determine the adjacent radian intervals in which it is located. Pointer reading calculation: when When it is greater than the maximum value in the set of radians, it is determined by the formula. Calculate the arc difference ratio; the pointer scale value is... ,in , This represents the radian value corresponding to two adjacent tick marks in the tick dataset. , These are the actual scale values ​​corresponding to the above radian values; It is the arc difference ratio; when When the value lies between two adjacent radian values ​​in the radian set, calculate the radian difference ratio between the two adjacent radian values. The pointer scale value is... ; when When the value is less than the minimum value of the radian set, calculate the ratio of the radian difference between the minimum and the second minimum value, and the pointer scale value is... .

8. An automatic reading system for seepage gauges in hydropower station dams based on machine vision and deep learning, characterized in that, The system is used to implement the automatic reading method for seepage gauges in hydropower station dams based on machine vision and deep learning as described in any one of claims 1 to 7, comprising: The image preprocessing module is used to perform image size normalization, grayscale conversion, Gaussian filtering, adaptive binarization and edge detection on the acquired piezometer images in sequence, so as to suppress uneven illumination, reflection and noise interference and enhance the edge features of the instrument. The dial positioning module is used to analyze the grayscale image processed by the Gaussian filter in the image preprocessing module and generate the coordinates of the piezometer fitting disk and the center of the fitting circle. The pointer preliminary detection module is used to calculate the edge data extracted by the image preprocessing module, identify and locate the line segment where the piezometer pointer is located; The pointer precision positioning and calibration module is used to identify the pointer area in the piezometer image using a trained YOLO model, and to perform position calibration by combining the fitted center coordinates obtained from the dial positioning module, so as to accurately locate the actual center of the dial and the end point of the pointer. The scale recognition and optimization module is used to recognize the scale characters on the piezometer dial, calculate the centroid position of each character and its Euclidean distance and radian from the actual center of the circle, construct a scale dataset, and filter out abnormal scale data in the dataset to obtain an optimized scale dataset. The intelligent reading calculation module is used to establish a mapping relationship between the pointer radian and the scale value based on the pointer radian obtained by the scale recognition and optimization module and the optimized scale dataset, and to calculate the final reading of the piezometer.

9. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a bus system. The processor and the memory are connected through the bus system. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the automatic reading method for seepage gauges of hydropower station dams based on machine vision and deep learning as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that, The computer storage medium stores a computer software product, which includes several instructions to cause a computer device to execute the automatic reading method for hydropower station dam piezometers based on machine vision and deep learning as described in any one of claims 1 to 7.