A method for automatic reading of values from a general-purpose single-pointer instrument in a substation
By constructing a preset template image and using a convolutional neural network for feature point matching, the problems of universality and light intensity influence of pointer instruments in substations are solved, and efficient and accurate automatic reading of single pointer instruments is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING SAC RAIL TRAFFIC ENG CO LTD
- Filing Date
- 2023-03-21
- Publication Date
- 2026-05-26
AI Technical Summary
Automatic reading methods for pointer-type instruments in substations suffer from low versatility and inaccurate matching due to light intensity. Furthermore, deep learning-based methods require extensive data support, and the introduction of new instrument categories increases the workload.
A convolutional neural network-based approach is adopted. By constructing a preset template image and using prior knowledge to perform instrument positioning and rotation adjustment, combined with a random sampling consistency algorithm to achieve image alignment and feature point matching, the image size is adaptively adjusted to ensure recognition accuracy.
It achieves stable recognition of different types of single-pointer instruments, reduces the influence of lighting, improves recognition accuracy, and does not rely on a large dataset, thus possessing strong versatility.
Smart Images

Figure CN116310441B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, specifically a method for automatically reading values from a general-purpose single-pointer instrument in a substation. Background Technology
[0002] Substations are the connection points of power lines in a power grid, and are crucial for the stable operation of the power system and the normal production and life of people. Maintaining the normal operation of substations is of paramount importance. Various types of instruments are distributed within the substation environment, such as pointer-type instruments like pressure gauges and wattmeters, and digital display instruments like ammeters and voltmeters located indoors. Due to electromagnetic interference within substations and the harsh outdoor environment, traditional digital instruments cannot function properly outdoors. Pointer-type instruments, with their superior performance and numerous advantages, are widely used in substations, and their readings are used to determine the operating status of equipment.
[0003] Currently, domestic substations mainly rely on manual inspections to record the values of pointer instruments. However, this method has many problems, such as safety hazards, repetitive data recording, low efficiency, and susceptibility to errors and omissions. With the advancement of digital substation construction and the development of machine vision, automating the repetitive recording of pointer instrument values using methods that simulate human visual recognition has become an indispensable part of digital substation construction.
[0004] Currently, there is a lot of research on automatic reading of pointer instruments, mainly in two directions: image processing-based methods and deep learning-based methods. Both of these methods have achieved considerable results.
[0005] Image processing-based methods can achieve high accuracy and stability in specific environments, but they lack universality; different types of pointer instruments require different algorithms. Furthermore, traditional image processing methods demand high image quality, requiring the target object to have strong texture features and stable illumination variations.
[0006] Deep learning-based methods overcome some of the problems encountered by image processing methods and have stronger robustness. However, this method requires a large amount of data support, and the model cannot function when faced with new pointer-type meters. It is necessary to add a large number of new meters to the dataset and retrain the model to obtain new weights, which undoubtedly increases the workload for substations in a non-saturated state of pointer-type meters.
[0007] Therefore, designing a numerical reading method that is not limited by the type of pointer instrument and does not depend on the dataset, and can stably identify any new pointer instrument, has important application significance. Summary of the Invention
[0008] This invention addresses the problems of low versatility in reading numerical values from single-pointer instruments in substations and inaccurate matching due to light intensity, proposing a universal numerical reading method. Compared to deep learning-based methods that require large datasets and cannot be used with the introduction of new pointer instrument categories, this invention requires no large amount of data and is not limited by pointer instrument types. For different types of single-pointer instruments, only prior knowledge of their position in a preset image needs to be labeled to complete the identification of instrument readings.
[0009] A method for automatically reading values from a general-purpose single-pointer instrument in a substation includes the following steps:
[0010] Step 1: Model the pointer image of the single-pointer instrument, construct a preset position template image, and provide prior knowledge;
[0011] Step 2: Input the image to be recognized, perform instrument positioning, align the image to be recognized with the preset position template image, locate the dial, and generate the dial mask image;
[0012] Step 3: Rotate and resize the generated mask image, adaptively adjusting its size while ensuring no pixel loss, so that the pointer is always at the 0 mark for matching;
[0013] Step 4: Locate the pointer. Use coarse matching to find the approximate position of the pointer, and then perform fine matching to obtain the precise position of the pointer.
[0014] Step 5: Read data based on the precise position of the pointer.
[0015] Furthermore, the preset template image in step 1 includes the dial radius R of the pointer instrument, the center point coordinates C(c0,c1), the starting scale point S(s0,s1) and the ending scale point E(e0,e1), the starting angle α and the ending angle β, the starting angle α being the angle between the pointer and the coordinate line SC at the beginning, the ending angle β being the angle between the pointer and the coordinate line SC at the end, and a rectangular box used to select the pointer.
[0016] Preferably, step 1 involves modeling and labeling the single-pointer instrument through human-computer interaction.
[0017] Furthermore, step 2 includes the following steps:
[0018] Step 2.1: Use a convolutional neural network to perform convolution operations on the preset template image and the input image to be recognized to extract high-dimensional feature maps;
[0019] Step 2.2: Select feature points that satisfy the channel maximum and local maximum based on the high-dimensional feature map, and generate descriptors;
[0020] Step 2.3: Extract the best matching feature points using the random sampling consistency algorithm to obtain the homography matrix, thereby achieving image alignment, locating the dial, and generating the dial mask image.
[0021] Furthermore, step 2.1 includes the following steps:
[0022] Step 2.1.1: Perform two convolutions and max pooling downsampling operations on the input image to be recognized to obtain a deep feature map with an input size of 1 / 4 of the input image size, to prevent the image from losing too many spatial features during the convolution feature extraction process;
[0023] Step 2.1.2: The downsampled feature map is convolved, average pooled, and dilated convolutioned again to extract sparse features and obtain a larger receptive field.
[0024] Step 2.1.3: Generate keypoints and descriptors from the output feature map fp. Then, restore the feature points of the obtained feature map to the size of the input image using bilinear interpolation to complete the image feature point detection.
[0025] Step 2.1.4: Obtain the homography matrix by matching the feature points of the preset template image and the image to be identified, and achieve image alignment.
[0026] Furthermore, the rotation adjustment formula in step 3 is as follows:
[0027] w′=2×(c0+Δw) (6)
[0028] h′=2×(c1+Δh) (7)
[0029]
[0030]
[0031] Where w and h are the original width and height of the image, w' and h' are the width and height of the transformed image, and Δh and Δw are the changes in the size of the new dial mask image after transformation;
[0032] The rotation-corrected image size during dynamic rotation is calculated as (w0, h0) using geometric relationships and equations (10) and (11).
[0033] w0=h′×sin(θ)+w′×cos(θ) (10)
[0034] h0=w′×sin(θ)+h′×cos(θ) (11)
[0035] Where θ is the angle of each rotation, and w0 and h0 are the width and height of the image after rotation correction.
[0036] Furthermore, step 4 specifically includes the following steps:
[0037] Step 4.1: Rotate the image with the pointer axis as the center of rotation, with the starting tick direction as the starting angle of rotation and the ending time as the ending angle of rotation. Match once for each rotation angle, and finally find the best matching angle.
[0038] Step 4.2: The dial mask image rotation matching range is within the angle corresponding to the starting value to the ending value of the range. Each rotation step is s. After obtaining the best matching angle, precise matching with a step size of 1 can be performed within ±s range to determine the precise solution of the angle of the current state pointer relative to the starting range.
[0039] Furthermore, in step 5, when the starting point is located in the second or third quadrant, the initial angle α of the dial is calculated by equation (13); when the ending point is located in the second, third, or fourth quadrant, the ending angle β of the dial is calculated by equation (14):
[0040]
[0041]
[0042] Furthermore, by converting the optimal matching angle to the range V according to equation (15), the final value v of the instrument can be obtained:
[0043]
[0044] Compared with existing technologies, the advantages of this invention are as follows: This invention addresses the problems of low versatility in reading numerical values from single-pointer instruments in substations and inaccurate matching due to light intensity. It proposes a universal numerical reading method that is simple and practical. Compared to deep learning-based methods which require large datasets and cannot be used with the introduction of new pointer instrument categories, this invention requires no large amount of data and is not limited by pointer instrument types. For different types of single-pointer instruments, only prior knowledge of their location in a preset position image needs to be labeled to complete the identification of instrument readings.
[0045] 1. This invention utilizes manual annotation to incorporate prior knowledge into the algorithm, thereby improving the algorithm's recognition accuracy to a certain extent;
[0046] 2. The method for generating feature points based on convolutional neural networks proposed in this invention reduces the impact of lighting on images, overcomes the problem of angular shift caused by prolonged camera operation, and improves the accuracy of feature matching.
[0047] 3. The rotating template matching method proposed in this invention achieves universal recognition of single-pointer instruments, broadening the application scenarios. This invention adjusts and scales the image size (w,h) to (w',h') with the center of the dial as the image center, and fills irrelevant content areas with 0 pixels, completely preserving the image content. It dynamically and adaptively adjusts the image size to ensure lossless preservation of feature information. Attached Figure Description
[0048] Figure 1 This is a flowchart of a method for automatically reading the values of a universal single-pointer instrument in a substation, according to the present invention.
[0049] Figure 2 Preset position template image for modeling the single-pointer instrument designed for this invention;
[0050] Figure 3 This is a schematic diagram of dynamic image adjustment provided by the present invention;
[0051] Figure 4 This is a schematic diagram of the instrument coordinate system for the initial angle α, the final angle β, and the total rotation angle of the present invention. Detailed Implementation
[0052] The following detailed description, in conjunction with the accompanying drawings and specific implementation methods, provides a further detailed explanation of the present invention: an automatic reading method for the value of a universal single-pointer instrument in a substation.
[0053] Automatic reading recognition of pointer-type instruments has always been a hot research topic. However, current research results still have several drawbacks: the instruments are affected by changes in lighting, leading to inaccurate image matching and low recognition reliability; there are many types of instruments, resulting in poor universality of recognition methods, which can only be used for one or a few types of instruments; and deep learning methods require large amounts of data. Therefore, this invention aims to design a numerical reading method that is not limited by the type of pointer-type instrument and does not depend on a dataset, and can stably recognize any new pointer-type instrument.
[0054] This invention addresses the problems of low versatility in reading numerical values from single-pointer instruments in substations and inaccurate matching due to light intensity, proposing a universal numerical reading method. Compared to deep learning-based methods that require large datasets and cannot be used with the introduction of new pointer instrument categories, this invention requires no large amount of data and is not limited by pointer instrument types. For different types of single-pointer instruments, only prior knowledge of their position in a preset image needs to be labeled to complete the identification of instrument readings.
[0055] The overall processing flow is as follows Figure 1 As shown.
[0056] Step 1: Modeling the single-pointer instrument. The purpose of modeling is to provide prior knowledge for the algorithm: a preset template image, dial center coordinates, dial radius, pointer template, starting point position and angle of the scale values, and annotation of the single-pointer instrument through human-computer interaction. The inclusion of prior knowledge can reduce recognition errors to a certain extent, thereby improving accuracy. For example... Figure 2 As shown, R is the dial radius of the pointer instrument, the center point coordinates of the dial are C(c0,c1), the starting scale point is S(s0,s1) and the ending scale point is E(e0,e1), the corresponding starting angle is α and the ending angle is β, both angles are the angles with line segment SC, and the length and width of the rectangle used to select the pointer in the model are h0 and w0, respectively.
[0057] Step 2: Instrument Localization. First, a convolutional neural network (CNN) is used to convolve the preset template image and the input image to be recognized to extract a high-dimensional feature map. Then, feature points satisfying the conditions of maximum channel size and local (3*3) maximum are selected based on the feature map, and descriptors are generated. Finally, the best-matching feature points are extracted using a random sampling consensus algorithm to obtain the homography matrix, thereby achieving image alignment, locating the dial, and generating a mask image for the dial. The trained CNN is resistant to scale, rotation, lighting, viewpoint, and non-rigid transformations, and the feature vectors extracted are richer and more comprehensive compared to traditional feature point extraction algorithms. The feature point generation steps based on the CNN can be briefly described as follows:
[0058] First, the input image to be recognized is downsampled by a combination of convolution and max pooling twice, resulting in a deep feature map with an input size of 1 / 4 of the input image size. This prevents the image from losing too many spatial features during convolutional feature extraction. Then, the downsampled feature map is subjected to convolution, average pooling, and dilated convolution again to fuse and extract sparse features while obtaining a larger receptive field. Next, the output feature map fp is used to generate a set of keypoints and descriptors. The feature points of the obtained feature map are restored to the size of the input image through bilinear interpolation, completing the image feature point detection. Finally, the homography matrix is obtained by matching the feature points of a preset template image and the image to be recognized, achieving image alignment.
[0059] In this context, the keypoints set is defined as the set of pixels that simultaneously represent the maximum value in both spatial and channel features. The descriptors are defined as the channel direction vectors at the location of the pixels, as shown in equation (1). `space` represents the set of pixels corresponding to the maximum spatial feature value within the local neighborhood N of pixel (i,j) in the output feature map `fp`, where N is the 3×3 neighborhood centered on pixel (i,j) in the output feature map `fp`, and `channel` represents the pixel corresponding to the maximum channel feature value of pixel (i,j) in channel direction k, where k is the feature channel index. In equations (2) and (3), `i` and `j` represent the row and column of the image, `fp(i,j,:)` represents all pixels in the i-th row and j-th column of the output feature map `fp`, and the `max()` function retrieves the maximum value. `fp(:,:,k)` represents all pixels in the output feature map `fp` along channel direction k.
[0060] keypoints=space∩channel (1)
[0061] space={max(fp(i,j,:) (i,j)∈N (2)
[0062] channel={max(fp(:,:,k))} (3)
[0063] After obtaining a large number of feature points from the preset template image and the image to be identified, the Random Sample Consensus (RANSA) algorithm is used to filter and select the four best-matching pairs of feature points, and the transformation matrix H is solved according to equation (4). Here, (x1, y1) are the matched feature points of the image to be identified, (x2, y2) are the matched feature points of the preset template image, and H is the homography matrix. ij Let be the value at the i-th row and j-th column of matrix H. Based on the modeling information and the transformation matrix, a correction transformation is performed on the image to be detected to align the image to be recognized with the preset template image.
[0064]
[0065]
[0066] Step 3: Image Rotation Correction. The purpose of this step is to enable the image to adaptively resize without pixel loss when rotated at any point. It consists of two steps: scaling adjustment and dynamic rotation correction. This step performs rotation correction on the generated mask image. When performing rotation template matching on the pointer, the dial mask image needs to be rotated around the center point C(c0,c1) of the dial. All instruments rotate counter-clockwise, with this direction as positive. The pointer is always at the 0 mark for matching, ensuring that image features are not cropped during the preset image rotation process, facilitating subsequent inverse transformations and other operations. This is the arbitrary-point lossless dial mask image rotation method proposed in this invention.
[0067] like Figure 3 As shown in (a), using equations (6) and (7), the image size (w,h) is adjusted and scaled to (w',h') with the center of the dial as the image center, and irrelevant content areas are filled with 0 pixels to completely preserve the image content. Here, w and h are the original width and height of the image, w' and h' are the changed width and height of the image, Δh and Δw are the changes in the size of the new dial mask image after transformation, and θ is the angle of each rotation. Figure 3 As shown in (b), the rotation-corrected image size during dynamic rotation can be calculated as (w0, h0) based on geometric relationships and equations (10) and (11), where w0 and h0 are the width and height of the image after rotation correction.
[0068] w'=2×(c0+Δw) (6)
[0069] h'=2×(c1+Δh) (7)
[0070]
[0071]
[0072] w0=h'×sin(θ)+w'×cos(θ) (10)
[0073] h0=w'×sin(θ)+h'×cos(θ) (11)
[0074] Step 4: Positioning the pointer. This step uses the pointer image obtained from modeling as a template to perform rotation matching on the mask image. First, coarse matching is used to find the approximate position of the pointer, and then fine matching is used to obtain the precise position of the pointer. This step uses existing prior knowledge and is not affected by the pointer table type, which well reflects the universality of the algorithm. The image is rotated with the pointer axis as the rotation center point, the starting angle of the rotation is the starting scale direction, and the ending time is the ending angle of the rotation. Each rotation angle is matched once, and finally the best matching angle is found. As shown in Equation (12), T is the pointer template of the model, I is the dial mask image, and R is the matching result. The larger the value, the better the matching result. The rotation matching range of the dial mask image is within the angle corresponding to the starting value to the ending value of the range. The rotation step size is s. After obtaining the best matching angle, a precise matching with a step size of 1 can be performed within ±s to determine the precise solution of the angle of the pointer relative to the starting range in the current state. With the top left corner of the image as the origin of the coordinate axis, x' and y' are the horizontal and vertical coordinates of a certain pixel in the template image, and x and y are the horizontal and vertical coordinates of a certain pixel in the mask image.
[0075]
[0076] Step 5: Numerical Reading. Establish an instrument coordinate system with the instrument center C as the origin, such as... Figure 4 As shown, quadrant division is performed. Due to the influence of the image coordinate system, the boundary line between the second and third quadrants in the instrument coordinate system is used as the 0-degree rotation reference. Clockwise rotation relative to the 0-degree starting position is positive, and counterclockwise rotation is negative. This method only considers the starting position being in the second or third quadrant and the ending position being in the second, first, or fourth quadrant.
[0077] The initial angle α, the final angle β, and the total rotation angle of the dial can be calculated from the range start point S, the end point E, and the dial center coordinates marked during the modeling process. When the start point is located in the second or third quadrant, the initial angle α of the dial can be calculated using equation (13); when the end point is located in the second, third, or fourth quadrant, the final angle β of the dial can be calculated using equation (14). Then, by converting the optimal matching angle to the range V according to equation (15), the final value v of the instrument can be obtained.
[0078]
[0079]
[0080]
[0081] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for automatically reading the values of a universal single-pointer instrument in a substation, characterized in that, Includes the following steps: Step 1: Model the single-pointer instrument and construct the preset position template image of the instrument to provide prior knowledge; Step 2: Input the image to be recognized, perform instrument positioning, align the image to be recognized with the preset position template image, locate the dial, and generate the dial mask image; Step 2.1: Use a convolutional neural network to perform convolution operations on the preset template image and the input image to be recognized to extract high-dimensional feature maps; Step 2.2: Select feature points that satisfy the channel maximum and local maximum based on the high-dimensional feature map, and generate descriptors; Step 2.3: Extract the best matching feature points using the random sampling consistency algorithm to obtain the homography matrix, thereby achieving image alignment, locating the dial, and generating the dial mask image; Step 3: Rotate and resize the generated mask image, adaptively adjusting its size while ensuring no pixel loss, so that the pointer is always at the 0 mark for matching; Step 4: Locate the pointer. Use coarse matching to find the approximate position of the pointer, and then perform fine matching to obtain the precise position of the pointer. Step 5: Read data based on the precise position of the pointer; Step 2.1 specifically includes: Step 2.1.1: Perform two convolutions and max pooling downsampling operations on the input image to be recognized to obtain a deep feature map with an input size of 1 / 4 of the input image size, to prevent the image from losing too many spatial features during the convolution feature extraction process; Step 2.1.2: The downsampled feature map is convolved, average pooled, and dilated convolutioned again to extract sparse features and obtain a larger receptive field. Step 2.1.3: Generate keypoints and descriptors from the output feature map fp. Then, restore the feature points of the obtained feature map to the size of the input image using bilinear interpolation to complete the image feature point detection. Step 2.1.4: Obtain the homography matrix by matching the feature points of the preset template image and the image to be identified, and achieve image alignment.
2. The method for automatically reading the values of a general-purpose single-pointer instrument in a substation according to claim 1, characterized in that: The preset template image in step 1 includes the dial radius R of the pointer instrument, the coordinates of the dial center point C(c0,c1), the starting scale point S(s0,s1) and the ending scale point E(e0,e1), the starting angle α and the ending angle β. The starting angle α is the angle between the pointer and the coordinate line SC at the beginning, and the ending angle β is the angle between the pointer and the coordinate line SC at the end, as well as a rectangle used to select the pointer.
3. The method for automatically reading the values of a universal single-pointer instrument in a substation according to claim 2, characterized in that: Step 1 involves modeling and labeling the single-pointer instrument through human-computer interaction.
4. The method for automatically reading the values of a universal single-pointer instrument in a substation according to claim 1, characterized in that, The rotation adjustment formula in step 3 is: , Where w and h are the original width and height of the image, w' and h' are the width and height of the transformed image, and Δh and Δw are the changes in the size of the new dial mask image after transformation; The rotation-corrected image size during dynamic rotation is calculated as (w0, h0) using geometric relationships and equations (10) and (11). , Where θ is the angle of each rotation, and w0 and h0 are the width and height of the image after rotation correction.
5. The method for automatically reading the values of a general-purpose single-pointer instrument in a substation according to claim 4, characterized in that, Step 4 specifically includes the following steps: Step 4.1: Rotate the image with the pointer axis as the center of rotation, with the starting tick direction as the starting angle of rotation and the ending time as the ending angle of rotation. Match once for each rotation angle, and finally find the best matching angle. Step 4.2: The dial mask image rotation matching range is within the angle corresponding to the starting value to the ending value of the range. Each rotation step is s. After obtaining the optimal matching angle, precise matching with a step size of 1 can be performed within the range of ±s to determine the precise solution of the angle of the current state pointer relative to the starting range.
6. The method for automatically reading the values of a general-purpose single-pointer instrument in a substation according to claim 5, characterized in that: Step 5: When the starting point is located in the second or third quadrant, the initial angle α of the dial is calculated by equation (13); when the ending point is located in the second, third, or fourth quadrant, the ending angle β of the dial is calculated by equation (14): , 。 7. The method for automatically reading the values of a universal single-pointer instrument in a substation according to claim 6, characterized in that, The final instrument value v can be obtained by converting the optimal matching angle to the range V according to equation (15): 。