CN-121999474-A - Automatic reading method for hydraulic power station dam osmometer based on machine vision and deep learning
Abstract
The invention discloses an automatic reading method of a hydraulic power station dam osmometer based on machine vision and deep learning, which relates to the technical field of dam safety management, and comprises the following steps of adaptively preprocessing an osmometer image; positioning a dial plate area and fitting a circle center, primarily identifying a pointer line segment, precisely detecting the pointer area by adopting a pre-trained YOLO model and calibrating the actual circle center and the tail end position of the pointer by combining the fitting circle center, identifying dial plate scale characters, calculating the centroid position and radian and distance relative to the actual circle center, constructing a scale data set, filtering abnormal data by adopting an isolated forest algorithm, and finally, calculating to obtain high-precision osmotic pressure reading by adopting a polar coordinate mapping and intelligent interpolation algorithm based on the pointer radian and the optimized scale data set. The invention realizes full automation, high precision and high robustness of osmometer reading, and effectively overcomes the defects of low efficiency, large error and poor anti-interference capability of manual inspection and traditional image processing methods.
Inventors
- SHAO GUANGJUN
- LI KE
- YANG WEIYE
- CHEN HAIWEI
- CHEN CHEN
- HU WENTAO
- CHEN ZIHAO
- Xiao Zhuojun
Assignees
- 国网浙江省电力有限公司紧水滩水力发电厂
Dates
- Publication Date
- 20260508
- Application Date
- 20251202
Claims (10)
- 1. The automatic reading method of the hydraulic power station dam osmometer based on machine vision and deep learning is characterized by comprising the following steps of: Step S1, sequentially carrying out image size normalization, graying, gaussian filtering, self-adaptive binarization and edge detection on an acquired osmometer image so as to inhibit uneven illumination, reflection and noise interference and enhance the edge characteristics of the instrument; S2, analyzing the gray level diagram processed by Gaussian filtering in the step S1 to generate a fitting disc of the osmometer and a fitting circle center coordinate; s3, calculating the edge data extracted in the step S1, and identifying and positioning a line segment where an osmometer pointer is located; s4, identifying a pointer region in the osmometer image by using a trained YOLO model, and carrying out position calibration by combining the fitting circle center coordinates obtained in the step S2 to accurately position the actual circle center of the dial plate and the end point of the pointer; S5, identifying scale characters on a dial plate of the osmometer, calculating the mass center position of each character and the Euclidean distance and radian between each character and the actual circle center, constructing a scale data set, and filtering abnormal scale data in the data set to obtain an optimized scale data set; And S6, establishing a mapping relation between the pointer radian and the scale value based on the pointer radian obtained in the step S5 and the optimized scale data set, and calculating to obtain the final reading of the osmometer.
- 2. The automatic reading method of the hydraulic power station dam osmometer based on machine vision and deep learning according to claim 1, wherein in the step S1, the method of sequentially performing image size normalization, graying, gaussian filtering, adaptive binarization and edge detection on the collected osmometer image specifically comprises the following steps: The image size normalization sets scaling factors for a transverse x-axis and a longitudinal y-axis respectively, so that the dial morphology in the normalized image is close to a standard circle; The gray processing converts an RGB three-channel image into a single-channel gray image through a preset formula, the pixel value range is [0,255], and the preset formula is as follows: Gray=0.299R+0.587G+0.114B; The Gray represents the Gray value obtained after calculation, is an integer between 0 and 255, 0 represents pure black, 255 represents pure white, R represents the red channel intensity value of the current pixel point in the original color image, G represents the green channel intensity value of the current pixel point in the original color image, B represents the blue channel intensity value of the current pixel point in the original color image; The Gaussian filter carries out two-dimensional Gaussian convolution operation by adopting a linear smoothing filter with a specified size, and the two-dimensional Gaussian distribution function is as follows: ; Wherein, the Expressed in two-dimensional coordinate points Calculating the function value; Representing the coordinates of any point on a two-dimensional plane; representing the mean of the two-dimensional gaussian distribution; Standard deviation of gaussian distribution is shown; And A mathematical constant; the adaptive binarization sets a dynamic threshold value for the Gaussian filtered image, and converts the Gaussian filtered image into a mask image only containing 0 and 1; the edge detection adopts a Canny operator to calculate the gradient of the mask image, and combines a non-maximum suppression algorithm to position the local maximum of the gradient amplitude, and the edge detection related formula is as follows: ; ; Wherein, the Representing the first derivative of the image in the horizontal direction; representing the first derivative of the image in the vertical direction; is shown at the pixel point The gradient amplitude value obtained by calculation is at the pixel point; is shown at the pixel point Gradient magnitude at; representing the gradient amplitude value output by the pixel point after non-maximum value inhibition; a low threshold representing the gradient magnitude; Representing the gradient magnitude of another pixel point adjacent to the current pixel point in the gradient direction; And An offset parameter representing the gradient direction.
- 3. The automatic reading method of the osmometer for the hydropower station dam based on machine vision and deep learning according to claim 1, wherein in the step S2, the gray scale map processed by gaussian filtering in the step S1 is analyzed, and a method for generating a fitting disc and a fitting center coordinate of the osmometer specifically comprises the following steps: gradient calculation is carried out on an input gray image through preset parameters, a plurality of candidate circles are obtained through detection in a set maximum radius range and a set minimum radius range, and two-dimensional circle center coordinates and radiuses of the circles are used as a candidate circle set; and fitting the candidate circle set based on a least square method to obtain the best fitting circle center and the fitting radius, and determining the dial prototype area of the osmometer.
- 4. The automatic reading method of the osmometer of the hydropower station dam based on machine vision and deep learning according to claim 1, wherein in the step S3, the edge data extracted in the step S1 is calculated, and the method for identifying and positioning the line segment where the osmometer pointer is located specifically comprises the following steps: Polar parametrization of converting an image space into a polar parameter space Wherein Representing the vertical distance of the line from the origin, The included angle between the normal line of the straight line and the x axis is 0-180 degrees; discretized accumulator to be And Discretizing into grids according to a fixed step length to construct a two-dimensional accumulator array; parameter space voting, namely traversing each edge point coordinate Calculation of Searching the nearest grid unit in the accumulator to accumulate and count; peak value extraction, namely detecting local maximum value points in an accumulator, and screening out significant peak values representing potential straight lines by setting a threshold value and combining a non-maximum value inhibition method; Straight line reduction, namely, the peak point is reduced And converting the linear equation into a linear equation, calculating the endpoint coordinates of the linear on the image boundary, and determining the linear segment corresponding to the pointer.
- 5. The automatic reading method of the hydraulic power station dam osmometer based on machine vision and deep learning according to claim 1, wherein in the step S4, a pointer area in an osmometer image is identified by using a trained YOLO model, and the position calibration is performed by combining the fitting circle center coordinates obtained in the step S2, so that the actual circle center of the dial plate and the end point of the pointer are accurately positioned, and the method specifically comprises the following steps: Preprocessing an image sample, drawing a rectangular bounding box in a pointer area by using a LabelImg tool, labeling a category label, and converting a labeling file into a Json format; Training a model, namely loading pre-training weight and Json format label files of the YOLO model, configuring super parameters, including batch processing size, training total round, input sample size, training equipment type and an optimizer, finishing model training and outputting the YOLO model files; Loading a YOLO model file to detect a pointer region and identifying a confidence score, calculating the distance between each vertex of the boundary frame and the circle center through a Euclidean distance formula based on the fitted circle center coordinates obtained in the step S2, judging the vertex corresponding to the minimum distance as an actual circle center, deducing the position of the tail end of the pointer according to the spatial relationship between the geometric center of the boundary frame and the circle center, and connecting the actual circle center with the position of the tail end of the pointer to obtain the pointer direction, wherein the Euclidean distance formula is expressed as follows: ; Wherein, the For the Euclidean distance from each vertex of the bounding box to the fitting circle center, 、 For the bounding box vertex coordinates, 、 And (3) fitting circle center coordinates obtained in the step S2.
- 6. The automatic reading method of the hydraulic power station dam osmometer based on machine vision and deep learning according to claim 1, wherein in the step S5, scale characters on a dial plate of the osmometer are identified, the euclidean distance and radian between the centroid position of each character and the actual circle center are calculated, a scale data set is constructed, abnormal scale data in the data set is filtered, and the optimized scale data set is obtained, and the method specifically comprises the following steps: The scale information extraction, namely, based on the image subjected to size normalization processing in the step S1, extracting each text string on a dial and marking a rectangular boundary box, calculating the geometric center of each box as the centroid position, applying constraint conditions that the size threshold value of the preset boundary box and the text length are not more than the preset length threshold value, screening effective scale values through a floating point number conversion algorithm, calculating the Euclidean distance between the screened text centroid and the actual circle center obtained in the step S4, calculating a corresponding radian value and a pointer radian by adopting an arctangent function, converting the text string into a floating point shape scale value, and integrating the Euclidean distance and centroid radian corresponding to the floating point shape scale value into a floating point shape scale value Obtaining a scale data set, the arctangent function being expressed as: ; Wherein, the For radians of text strings corresponding to the centroid, And (3) with Is the centroid coordinate of the image of the object, And (3) with The coordinates of the actual circle center obtained in the step S4; Filtering abnormal scale, namely extracting all Euclidean distances in scale data set to form a set And constructing a plurality of isolated trees by recursively selecting features and segmentation points, calculating the path length of each Euclidean distance sample from a root node to an isolated node in each isolated tree, obtaining a standardized abnormal score, setting a threshold value to reject Euclidean distance samples corresponding to abnormal data, and completing scale data set optimization according to radian value sequencing to obtain an optimized scale data set.
- 7. The automatic reading method of the hydraulic power station dam osmometer based on machine vision and deep learning according to claim 1, wherein in the step S6, a mapping relation between the pointer radian and the scale value is established based on the pointer radian obtained in the step S5 and the optimized scale data set, and the final reading of the osmometer is obtained by calculation, which specifically comprises the following steps: Positioning adjacent radian intervals according to the current radian value of the pointer Traversing and comparing in the radian set of the scale data set, and determining adjacent radian intervals in which the scale data set is positioned; Pointer reading calculation: When (when) Greater than the maximum value in the radian set, by the formula Calculating the arc difference ratio, and the scale value of the pointer is Wherein 、 Radian values corresponding to two adjacent scales in the scale data set; 、 is the actual scale value corresponding to the radian value; Is the arc difference ratio; When (when) When the arc difference is between two adjacent radian values in the radian set, calculating the arc difference ratio between the two adjacent radians, wherein the scale value of the pointer is that ; When (when) When the arc difference ratio is smaller than the minimum value of the radian set, calculating the arc difference ratio between the minimum value and the next minimum value, wherein the scale value of the pointer is 。
- 8. A machine vision and deep learning based automatic reading system for a hydroelectric dam osmometer, wherein the system is used for realizing the machine vision and deep learning based automatic reading method for the hydroelectric dam osmometer according to any one of claims 1 to 7, and the automatic reading system comprises the following steps: The image preprocessing module is used for sequentially carrying out image size normalization, graying, gaussian filtering, self-adaptive binarization and edge detection on the acquired osmometer image so as to inhibit uneven illumination, reflection and noise interference and enhance the edge characteristics of the instrument; the dial positioning module is used for analyzing the gray level diagram processed by the Gaussian filtering processing module to generate a fitting disc of the osmometer and a fitting circle center coordinate; The pointer preliminary detection module is used for calculating the edge data extracted by the image preprocessing module, and identifying and positioning the line segment where the osmometer pointer is located; The pointer accurate positioning and calibrating module is used for identifying a pointer region in the osmometer image by utilizing the trained YOLO model, and carrying out position calibration by combining the fitting circle center coordinates obtained by the dial plate positioning module to accurately position the actual circle center of the dial plate and the end point of the pointer; The scale recognition and optimization module is used for recognizing scale characters on the dial of the osmometer, calculating the centroid position of each character and the Euclidean distance and radian between the centroid position and the actual circle center, constructing a scale data set, and filtering abnormal scale data in the data set to obtain an optimized scale data set; The intelligent reading calculation module is used for establishing a mapping relation between the pointer radian and the scale value based on the pointer radian obtained by the scale identification and optimization module and the optimized scale data set, and calculating to obtain the final reading of the osmometer.
- 9. An electronic device, characterized in that the electronic device comprises a processor, a memory and a bus system, wherein the processor and the memory are connected through the bus system, the memory is used for storing instructions, and the processor is used for executing the instructions stored in the memory so as to realize the automatic reading method of the hydraulic power station dam osmometer based on machine vision and deep learning according to any one of claims 1 to 7.
- 10. A computer storage medium storing a computer software product comprising instructions for causing a computer device to perform the machine vision and deep learning based automatic hydropower station dam osmometer reading method of any one of claims 1 to 7.
Description
Automatic reading method for hydraulic power station dam osmometer based on machine vision and deep learning Technical Field The invention relates to the technical field of dam safety management, in particular to an automatic reading method of a hydropower station dam osmometer based on machine vision and deep learning. Background The dam is used as an important infrastructure for hydraulic engineering and energy supply, and the long-term, stable and safe operation of the dam has key significance for national water resource management and energy guarantee. Seepage is one of the common potential safety hazards in hydraulic buildings, excessive seepage pressure can cause dam material erosion and structural strength reduction, and even cause catastrophic accidents such as dam slippage, cracking and dam break in severe cases. Therefore, continuous and accurate monitoring of the seepage state of the dam is an important link for guaranteeing the safety of the dam structure. The osmometer is used as a common instrument for monitoring the seepage pressure of the dam body, and the reading of the osmometer directly reflects the change of the seepage pressure in the dam body. At present, the water pipe type osmometer is widely applied to engineering due to the advantages of simple structure, high stability, lower cost and the like. However, the reading of the instrument still mainly depends on manual field inspection, and has the problems of large subjective error of the reading, poor data continuity, low inspection efficiency and the like, and is difficult to adapt to the development requirements of intelligent and digital operation and maintenance of modern hydraulic engineering. In recent years, with the development of machine vision and image processing technology, some automatic reading methods based on image recognition are developed. These methods typically rely on conventional image processing algorithms such as edge detection, binarization, hough transform, etc., in an attempt to achieve automatic identification of meter pointers and scales by image analysis. However, in an actual engineering environment, an osmometer image is often subjected to various interferences such as uneven illumination, dial reflection, scale adhesion, complex background and the like, and the traditional method has obvious defects in terms of robustness, identification precision and generalization capability, and particularly has poor performance under the conditions of complex illumination and low contrast. With the rapid development of deep learning technology, particularly the successful application of convolutional neural networks (Convolutional Neural Network, CNN) in the fields of target detection, image segmentation and the like, a new technical path is provided for automatic recognition of instruments. Advances in optical character recognition (Optical Character Recognition, OCR) technology have also made automatic extraction of graduated text possible. However, at present, a plurality of technologies such as deep fusion image preprocessing, geometric feature extraction, deep learning target detection, OCR character recognition and anomaly filtering do not exist, and an automatic osmometer reading system with high precision and high robustness from end to end is realized. Therefore, development of an osmometer identification method which can adapt to complex field environments, has strong anti-interference capability and realizes full-automatic high-precision reading is needed to improve the intelligent level of dam safety monitoring and support construction of digital transformation and intelligent operation and maintenance systems of hydraulic engineering. Disclosure of Invention Therefore, the embodiment of the invention provides an automatic reading method of a hydraulic power station dam osmometer based on machine vision and deep learning, which is used for solving the problems that the efficiency is low due to manual inspection in the prior art, and the robustness is poor and the recognition accuracy is low under complex illumination, reflection and noise interference in the traditional automatic method. In order to solve the technical problems, the embodiment of the invention provides an automatic reading method of a hydropower station dam osmometer based on machine vision and deep learning, which comprises the following steps: Step S1, sequentially carrying out image size normalization, graying, gaussian filtering, self-adaptive binarization and edge detection on an acquired osmometer image so as to inhibit uneven illumination, reflection and noise interference and enhance the edge characteristics of the instrument; S2, analyzing the gray level diagram processed by Gaussian filtering in the step S1 to generate a fitting disc of the osmometer and a fitting circle center coordinate; s3, calculating the edge data extracted in the step S1, and identifying and positioning a line segment where an osmometer pointer is locate