An oil level gauge recognition method based on image correction processing technology

By using image correction processing technology, the oil level gauge skew is corrected in real time, and the scale ratio value is calculated. This solves the environmental impact and deep learning training requirements for oil level gauge identification in substations, and achieves stable and accurate identification of oil level gauge scale.

CN115761245BActive Publication Date: 2026-01-23ANHUI ZHIHUAN SCIENCE & TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211499062.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-28
Publication Date
2026-01-23
Estimated Expiration
2042-11-28

AI Technical Summary

Technical Problem

Existing technologies for oil level gauge identification in substations are easily affected by ambient light, shooting angle, and weather, leading to missed identifications or false detections. Furthermore, deep learning methods require a large number of images for training, making it difficult to adapt to the stable conditions of industrial sites.

Method used

Image correction processing technology is used to preprocess and detect Hough line by real-time acquisition of image data and matching with templates, correct the oil level gauge skew, calculate the scale ratio value, and generate the true scale value.

Benefits of technology

Accurately identify oil level gauge scale in complex backgrounds, reduce errors, avoid the limitations of color classification and the need for large-scale training, and ensure the stability and accuracy of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115761245B_ABST
    Figure CN115761245B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of oil level meter scale recognition in industrial environment, and particularly relates to an oil level meter recognition method based on image correction processing technology, which comprises the following steps: step S1, collecting industrial field picture data in real time, and matching with a preset oil level meter template picture to intercept an oil level meter picture to be processed in the industrial field; step S2, after pretreatment of the oil level meter picture to be processed, selecting a plurality of longest straight lines from the pretreated oil level meter picture, which accurately reflect the profile of the oil level meter in the vertical direction; the method in the present application can recognize and intercept the oil level meter image in a complex background, correct the inclination error of the oil level meter in the vertical direction and the pitch angle, convert the scale ratio in the picture into an effective real scale value, and finally realize accurate recognition of the oil level meter scale.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of oil level gauge scale recognition technology in industrial environments, and specifically relates to an oil level gauge recognition method based on image correction processing technology. Background Technology

[0002] With the rapid development of my country's industry, the continuously increasing demand for industrial production has brought great pressure to our work, making the requirement for industrial automation increasingly urgent. Transformers, as one of the most important pieces of equipment in substations, require accurate data entry of readings from their oil level gauges and other related meters, which is a crucial part of substation inspection. Although the application of digital instruments is quite mature, considering the influence of environmental factors such as electromagnetic interference, oil contamination, and dust, digital instruments are not suitable for use in industrial environments such as substations. Most operating substations, due to historical and cost reasons, do not have remote transmission capabilities for their oil level gauges and other meters. Therefore, substation inspections mainly rely on manual inspections to ensure the safe and stable operation of power equipment. However, manually reading oil level gauges is extremely labor-intensive and prone to subjective errors. Therefore, in today's society where the demand for industrial automation is increasing, it is necessary to utilize machine vision to achieve automated reading of oil level gauges and oil level warning judgments.

[0003] In recent years, with the rapid development of online inspection technologies such as robots and cameras, the workload of manual inspections has been greatly reduced, and inspection efficiency has been improved. Furthermore, combined with image processing technology, it can solve defects that are difficult to detect by manual inspections, showing broad practical application prospects. Domestic and international scholars have conducted extensive research on the calculation of pointer-type instrument readings. For example, Xu Peng et al. judged the image pointer by image brightness and then used the angle method to calculate the corresponding oil level gauge reading for the current pointer-type oil level gauge image. (Xu Peng, A Method for Recognizing Pointer-Type Oil Level Gauge Readings, Patent No.: CN108960237A). Zhou Hao et al. used methods such as clustering segmentation and color space conversion to locate and cut the oil level gauge image, obtaining the upper edge line of the recognition area. When the upper edge line exceeds a preset oil level threshold, an alarm signal is issued. (Zhou Hao, An Inspection Method and Device for Oil Level Gauges, Patent No.: CN107610128A). Sun Lizhen and others used convolutional neural networks to annotate and train actual images of various oil-filled equipment in various scenarios taken at multiple substations. After training the model, they found the location of the float and then calculated the reading of the oil level gauge by the relative position of the float and the oil level gauge window.

[0004] Existing methods all suffer from one or more of the following defects and shortcomings:

[0005] 1. Most transformer oil level gauges and other meters are located outdoors. The detection and identification of oil level gauges are easily affected by ambient light. There is also the need for identification during the day and at night. In the diverse and complex scenarios of substations, there is a high risk of missed identification or false detection.

[0006] 2. Due to the shooting angle, the scale position identified from the oil level gauge photo may not reflect the true scale, which greatly affects the recognition accuracy.

[0007] 3. Image color recognition methods are easily affected by weather, lighting, and time, which limits their effectiveness and makes them prone to significant errors.

[0008] While training models using convolutional neural networks or deep learning can achieve high accuracy in image recognition, it requires preparing a large number of images for labeling and training in advance. In actual industrial settings, most oil level gauges remain stable over long periods, and collecting oil level gauge readings under various weather conditions, times, and climates presents a significant challenge to practical work. Summary of the Invention

[0009] The purpose of this invention is to provide an oil level gauge identification method based on image correction processing technology to solve the problems mentioned in the background art.

[0010] The present invention achieves the above objectives through the following technical solutions:

[0011] A method for oil level gauge identification based on image correction processing technology, the method comprising the following steps:

[0012] Step S1: Collect industrial site image data in real time and match it with preset oil level gauge template images to extract the oil level gauge images to be processed in the industrial site.

[0013] Step S2: After preprocessing the oil level gauge image to be processed, select the longest straight lines that accurately reflect the vertical contour of the oil level gauge from the preprocessed oil level gauge image.

[0014] Step S3: Calculate the total deviation angle values ​​of the several straight lines from the vertical direction, calculate the average deviation angle value, and rotate the oil level gauge image to be processed according to the average deviation angle value until the rotated oil level gauge image has no skew in the vertical direction.

[0015] Step S4: Identify the straight lines of the oil level gauge in the horizontal direction in the rotated oil level gauge image to filter out the straight lines of the upper and lower edges of the oil level gauge and each scale line, and calculate the interval ratio value c of the oil level line scale. Based on the functional relationship between the actual reading and the interval ratio of the scale line, and the interval ratio value c, generate the actual reading of the oil level gauge and output the true scale value of the oil level gauge.

[0016] A further improvement is that the preprocessing operation includes at least grayscale conversion, Gaussian filtering, and Canny-based edge detection of the oil level gauge image.

[0017] A further improvement is that the step S2, which involves selecting the longest straight lines from the preprocessed oil level gauge image that accurately reflect the vertical profile of the oil level gauge, specifically includes:

[0018] S2-1. Obtain the height h1 and width w1 of the preprocessed oil level gauge image;

[0019] S2-2. Set the threshold for the horizontal difference between the two ends of the filtered line to w1 / 4;

[0020] S2-3. Set the threshold for the vertical difference between the two ends of the filtered line to h1 / 2;

[0021] S2-4. Select the set L1 of all straight lines in the processed oil level gauge image that satisfy the condition that the difference in the horizontal direction is less than w1 / 4 and the difference in the vertical direction is greater than h1 / 2, as shown in the following formula:

[0022] L1 = [l 11 ,l 12 ,K,l 1n ].

[0023] A further improvement is that step S3, which involves rotating the oil level gauge image based on the average deviation angle value until the rotated oil level gauge has no vertical deviation, specifically includes:

[0024] S3-1. Calculate the slope k of each line in the set of lines L1, and obtain the mean.

[0025] S3-2, from the mean The angle θ between the image of the oil level gauge to be processed and the vertical direction is obtained by conversion.

[0026] S3-3. Based on the center point (x,y) of the oil level gauge image to be processed, the deviation angle θ, and the following matrix, rotate the image to obtain a rotated oil level gauge image without vertical offset.

[0027]

[0028] A further improvement is that step S4, which involves identifying straight lines in the horizontal direction of the oil level gauge to filter out the straight lines at the upper and lower edges of the oil level gauge and each scale line, and calculating the vertical proportion c of the interval where the oil level gauge scale is located, specifically includes:

[0029] S4-1. Horizontally stretch the oil level gauge image after rotation in step S4-4, and obtain the height h2 and width w2 of the horizontally stretched oil level gauge image.

[0030] S4-2. Set the threshold for the horizontal difference between the two ends of the filtered line to w2 / 2 and the threshold for the vertical difference to h2 / 4.

[0031] S4-3. Filter out the set L2 of all lines in the oil level gauge image that satisfy the condition that the horizontal difference is greater than w² / 2 and the vertical difference is less than h² / 4. Specifically, the set L2 is as follows:

[0032] L2 = [l 21 ,l 22 ,K,l 2n ];

[0033] S4-4. Based on the distribution of lines, select the lines at the top and bottom of the image and record their vertical heights y1 and y2. Then, select the lines at the boundaries of the lines and record their vertical heights y3. Calculate the ratio c of the interval containing the lines at the boundaries of the lines. The specific ratio c is as follows:

[0034] c = (y2-y3) / (y2-y1).

[0035] A further improvement is that the straight line at the dividing line is specifically an oil level scale line.

[0036] A further improvement lies in the following step: the functional relationship between the actual reading and the oil level gauge height in step S4, and the interval ratio value c, are used to generate the actual reading of the oil level gauge and output the true scale value of the oil level gauge.

[0037] S4-5. Take the interval q1 between any two consecutive scale lines in the oil level gauge image and the ratio c1 of the corresponding scale line interval. Take this twice to obtain points (q1, c1) and (q2, c2). Based on these two points, establish a first-order linear function relationship to obtain the function q:

[0038] q = f(c);

[0039] S4-6. Integrate the function q to obtain the functional relationship g between the actual scale value and the ratio of the interval containing the scale line.

[0040]

[0041] S4-7. Substitute the interval ratio value c of the oil level line scale into the function relationship g, and output the final true scale of the oil level gauge.

[0042] The beneficial effects of this invention are as follows:

[0043] 1) The method in this invention can identify and extract oil level gauge images in complex backgrounds, correct the tilt error of the oil level gauge in the vertical direction and elevation angle, and convert the scale ratio in the image into effective real scale values ​​through integral transformation, thus ensuring the stability, accuracy and reliability of the oil level gauge scale recognition results.

[0044] 2) This invention adopts a traditional image correction processing method, which can perform recognition processing through the Hough line detection method, avoiding the limitations of color classification processing, and also avoiding the need for a large amount of image data for training required by deep learning methods.

[0045] 3) This invention can solve the error caused by the shooting of inspection equipment by identifying the edge line of the oil level gauge in the vertical direction and correcting it;

[0046] 4) This invention proposes an oil level gauge recognition method based on image correction processing technology, which can effectively recognize the scale of oil level gauges in various scenarios and effectively avoid the influence of different weather environments and day-night changes on oil level gauge images. Attached Figure Description

[0047] Figure 1 This is a flowchart of the algorithm involved in the present invention;

[0048] Figure 2 This is a screenshot of the oil level gauge and its scale taken from the present invention;

[0049] Figure 3 This is a picture of the oil level gauge and the vertical straight line after being cut out in this invention;

[0050] Figure 4 This is a picture of the stretched oil level gauge and the horizontal straight line in this invention. Detailed Implementation

[0051] The present application will now be described in further detail with reference to the accompanying drawings. It should be noted that the following specific embodiments are only used to further illustrate the present application and should not be construed as limiting the scope of protection of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application based on the above application content.

[0052] Example 1

[0053] like Figure 1 As shown, this invention discloses a method for oil level gauge recognition based on image correction processing technology, the method comprising the following steps:

[0054] Step S1: Collect industrial site photos containing oil level gauges taken by automatic inspection equipment, set different oil level gauge matching templates, and extract oil level gauge photos from the background of industrial site photos by matching site photos with templates.

[0055] Step S2: Preprocess the captured oil level gauge image. The preprocessing operation specifically includes grayscale conversion, Gaussian filtering, and edge detection based on Canny to eliminate the influence of color changes, local noise, etc. on line detection, to obtain the processed edge line image, and identify the set of the longest lines that can reflect the oil level gauge in the vertical direction.

[0056] Step S3: Vertical skew correction is performed on the preprocessed oil level gauge image. Specifically, the skew correction adopts the Hough line detection method to identify the longest straight lines in the image. The horizontally distributed line segments are filtered out by the horizontal distance threshold between the coordinate points at the beginning and end of the straight lines to ensure that the identified straight lines can accurately reflect the contour of the oil level gauge in the vertical direction.

[0057] The angle of deviation between the selected straight line and the vertical direction is calculated, and the average deviation angle is obtained by taking the mean value. Based on this angle, the original image is rotated until the oil level gauge after rotation has no deviation in the vertical direction.

[0058] Step S4: Identify the straight lines of the oil level gauge in the horizontal direction in the rotated oil level gauge image to filter out the straight lines of the upper and lower edges of the oil level gauge and each scale line, and calculate the interval ratio value c of the oil level line scale. Based on the functional relationship between the actual reading and the height of the oil level gauge, and the interval ratio value c, generate the actual reading of the oil level gauge and output the true scale value of the oil level gauge.

[0059] This invention identifies and corrects errors caused by the imaging of inspection equipment by recognizing the vertical edge line of the oil level gauge.

[0060] This invention adopts a traditional image correction processing method, which can perform recognition processing through the Hough line detection method, avoiding the limitations of color classification processing, and also avoiding the need for a large amount of image data for training deep learning methods.

[0061] The specific implementation method and algorithm process of this method are explained in detail below with reference to actual processing routines:

[0062] (I) Combination Figure 2As shown, oil level gauge photos taken by industrial site inspection equipment are selected. Since oil level gauges in industrial sites may have various styles and shapes, different matching templates need to be set in advance for different oil level gauges to adapt to the identification of different oil level gauges in complex backgrounds. Matching and cropping are performed according to the preset oil level gauge templates, and accurate cropping is performed to obtain the cropped oil level gauge image.

[0063] (ii) The captured oil level gauge image is preprocessed. The preprocessing operation includes grayscale conversion, Gaussian filtering and Canny-based edge detection to eliminate the influence of color changes and local noise on line detection, so as to obtain the processed edge line image and identify the set of the longest lines that can reflect the oil level gauge in the vertical direction. See Figure 3 for details. Then, the preprocessed oil level gauge image is skewed in the vertical direction. The skew correction adopts the Hough line detection method to identify the longest lines in the image. The horizontal distance threshold between the coordinate points at the beginning and end of the line is used to filter out horizontally distributed line segments to ensure that the identified lines can accurately reflect the contour of the oil level gauge in the vertical direction.

[0064] The specific screening process is as follows:

[0065] (1) Obtain the height h1 and width w1 of the preprocessed image;

[0066] (2) Set the threshold for the horizontal difference between the two ends of the filtered line to w1 / 4;

[0067] (3) Set the threshold for the vertical difference between the two ends of the filtered line to h1 / 2;

[0068] (4) Filter out the set L1 of all lines in the image that satisfy the condition that the horizontal difference is less than w1 / 4 and the vertical difference is greater than h1 / 2, and the specific set L1 is as follows:

[0069] L1 = [l 11 ,l 12 ,K,l 1n ];

[0070] (III) Calculate the angle of deviation between the straight line selected in step (3) above and the vertical direction, take the average value to obtain the average deviation angle, and based on this angle, rotate the original figure until the oil level gauge after rotation has no deviation in the vertical direction; wherein, the rotation process specifically includes:

[0071] (1) Calculate the slope k of each line in set L1 and obtain the mean.

[0072] (2) From the mean The conversion yields the angle θ that the image deviates from the vertical direction.

[0073] (3) Determine the center point (x, y) of the image and the deviation angle θ, and perform lossless image conversion based on the following matrix;

[0074]

[0075] (4) Obtain an image of the oil level gauge after rotation without vertical offset.

[0076] (iv) Identify the straight line of the oil level gauge in the horizontal direction, determine the straight lines of the upper and lower edges of the oil level gauge and each scale line, and calculate the proportion value c of the interval where the oil level line scale is located. The specific steps include:

[0077] (1) Horizontally stretch the oil level gauge image after rotation in step S4-4, and obtain the height h2 and width w2 of the processed oil level gauge image;

[0078] (2) Set the threshold for the horizontal difference between the two ends of the filtered line to w2 / 2 and the threshold for the vertical difference to h2 / 4;

[0079] (3) Select the set L2 of all lines in the oil level gauge that satisfy the condition that the horizontal difference is greater than w2 / 2 and the vertical difference is less than h2 / 4. The specific set L2 is as follows:

[0080] L2 = [l 21 ,l 22 ,K,l 2n ];

[0081] (4) Combination Figure 4 As shown, based on the linear distribution, select the straight lines at the top and bottom of the oil level gauge image and record their vertical heights y1 and y2. Then, find the straight line at the boundary of the line segment, specifically the oil level scale line, and record its vertical height y3. Calculate the interval ratio c of the line segment, where the interval ratio c is located.

[0082] c = (y2 - y3) / (y2 - y1);

[0083] In the above steps, the rotated oil level gauge image is stretched horizontally, and corresponding straight line filtering thresholds are set, such as straight line length and straight line slope. Straight lines that can reflect the upper and lower edges and the oil level gauge scale are identified and filtered out. The proportion of the interval where the scale line is located is calculated, c = 0.343.

[0084] For photos taken by the inspection equipment that contain pitch angles, scale correction is performed to obtain a functional relationship between the actual reading and the oil level gauge height. The scale interval ratio value 'c' obtained in the previous steps is substituted into this functional relationship to obtain the actual reading of the oil level gauge, thus yielding the final true scale value of the oil level gauge. Specific steps include:

[0085] (1) Take the interval q1 between any two consecutive scale lines in the oil level gauge image and the corresponding scale line interval ratio c1. Take this twice to obtain points (q1, c1) and (q2, c2). Based on these two points, establish a first-order linear function relationship to obtain the function q:

[0086] q = f(c);

[0087] (2) Integrate the obtained function q to obtain the functional relationship g between the true scale value and the interval containing the scale line.

[0088]

[0089] (3) Substitute the calculated interval ratio c of the oil level line scale into the function relationship g calculated in step (2) to output the final true scale value of the oil level gauge.

[0090] In the above steps, the elevation angle is adjusted according to the interval between the scale lines of the oil level gauge to establish a function between the scale line interval and the change in the height of the oil level gauge. Then, the function is integrated to obtain the functional relationship between the actual reading and the height of the oil level gauge. After substituting c = 0.343, the final scale reading of 24.66 is obtained, that is, the true scale value of the oil level gauge is 24.66 based on the taken industrial photos of the scene.

[0091] In summary, this method can identify and extract oil level gauge images in complex backgrounds, correct the tilt errors of the oil level gauge in the vertical direction and elevation angle, and ultimately ensure the stability, accuracy and reliability of the oil level gauge scale recognition results.

[0092] Regarding the algorithm, the algorithm mentioned in this invention can be implemented in the host computer software in the form of image processing, or it can be implemented in other ways, such as digital chips, hardware circuits, etc.

[0093] It should be noted that the type of image processed in the method of the present invention is not limited. It can be an oil level gauge, or a similar measuring device with scale lines, such as a water level gauge or a thermometer.

[0094] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. A method for oil level gauge recognition based on image correction processing technology, characterized in that: The method includes the following steps: Step S1: Collect industrial site image data in real time and match it with preset oil level gauge template images to extract the oil level gauge images to be processed in the industrial site. Step S2: After preprocessing the oil level gauge image to be processed, select the longest straight lines that accurately reflect the vertical contour of the oil level gauge from the preprocessed oil level gauge image. Step S3: Calculate the total deviation angle values ​​of the several straight lines from the vertical direction, calculate the average deviation angle value, and rotate the oil level gauge image to be processed according to the average deviation angle value until the rotated oil level gauge image has no skew in the vertical direction. Step S4: Identify the straight lines of the oil level gauge in the horizontal direction in the rotated oil level gauge image to filter out the straight lines of the upper and lower edges of the oil level gauge and each scale line, and calculate the proportion of the interval where the oil level line scale is located. c, Based on the functional relationship between the actual reading and the proportion of the interval where the scale line is located, and the value of the interval proportion... c Generates the actual reading of the oil level gauge and outputs the true scale value of the oil level gauge. Step S4 involves identifying straight lines in the horizontal direction of the oil level gauge to filter out straight lines along the upper and lower edges of the gauge and each scale line, and calculating the vertical proportion of the interval where the oil level gauge scale is located. c The specific steps include: S4-1. Horizontally stretch the rotated oil level gauge image and obtain the height of the stretched image. h 2. Width w 2; S4-2. Set the threshold for the horizontal difference between the two ends of the filtered line as follows: w 2 / 2, the threshold for the vertical difference is h 2 / 4; S4-3. Filter out all images of the oil level gauge that satisfy the condition that the horizontal difference is greater than 1. w 2 / 2 and the vertical difference is less than h The set of lines L2 is 2 / 4, and the specific details of the set of lines L2 are as follows: ; S4-4. Based on the distribution of straight lines, select the straight lines at the top and bottom of the image and record their vertical heights. y 1, y 2. Select the straight lines located at the boundary of the straight lines and record their vertical height. y 3. Calculate the proportion of the interval containing the line at the boundary of the line. c, And the interval ratio value c Specifically: ; The straight line at the dividing line is specifically the oil level scale line; The functional relationship between the actual reading and the oil level gauge height mentioned in step S4, and the interval ratio value. c The steps to generate the actual reading of the oil level gauge and output the true scale value of the oil level gauge are as follows: S4-5, The interval between any two consecutive scale lines in the oil level gauge image. q 1 and the ratio of the interval containing the corresponding tick mark c 1. Taking the test twice yields the point ( q 1, c 1) Point ( q 2, c 2) Based on these two points, establish a first-order linear function relationship and derive the function. q: ; S4-6, Regarding the function q By integrating, we obtain the functional relationship between the actual scale value and the ratio of the interval containing the scale line. g, ; S4-7, The proportional value of the interval where the oil level mark is located. c Substitute into the aforementioned functional relationship g In the process, the final true scale value of the oil level gauge is output.

2. The oil level gauge recognition method based on image correction processing technology according to claim 1, characterized in that: The preprocessing operations include at least grayscale conversion, Gaussian filtering, and Canny-based edge detection of the oil level gauge image.

3. The oil level gauge identification method based on image correction processing technology according to claim 1, characterized in that: Step S2, which involves selecting the longest straight lines from the preprocessed oil level gauge image that accurately reflect the vertical profile of the oil level gauge, specifically includes: S2-1. Obtain the height of the preprocessed oil level gauge image. h 1. Width w 1; S2-2, Set the threshold for the horizontal difference between the two ends of the filtered line as follows: w 1 / 4; S2-3. Set the threshold for the vertical difference between the two ends of the filtered line as follows: h 1 / 2; S2-4. Filter out all images of the oil level gauge that satisfy the condition that the horizontal difference is less than [value missing] in the processed oil level gauge image. w 1 / 4 and the vertical difference is greater than h The set of lines L1, which is half of the total line length, is represented by the following formula: 。 4. The oil level gauge identification method based on image correction processing technology according to claim 3, characterized in that: Step S3, which involves rotating the oil level gauge image based on the average deviation angle value until the rotated oil level gauge has no vertical deviation, specifically includes: S3-1. Calculate the slope of each line in the set of lines L1. k And calculate the mean. k ; S3-2, from the aforementioned mean` k The angle of deviation of the oil level gauge image from the vertical direction obtained by conversion θ; S3-3, Based on the center point of the oil level gauge image to be processed ( x,y ), deviation angle θ The following matrix is ​​rotated to obtain an image of the oil level gauge without vertical offset after rotation; 。

Citation Information

Patent Citations

  • Routing inspection method and device for oil level indicator

    CN107610128A

  • Reading recognition method for pointer oil level gauges

    CN108960237A

  • Water level recognition method based on water gauge images

    CN108921165A

  • Meter reading identification method based on image processing

    CN110580480A