A method for identifying instrument pointer readings

By collecting and processing instrument images, identifying bar areas and character values, calculating intersection points and pointer angles, the automated reading of pointer instruments is realized, solving the problems of low efficiency and high cost of manual readings, and improving recognition accuracy and efficiency.

CN116092088BActive Publication Date: 2025-07-08SHANXI KEDA AUTOMATION CONTROL +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211549996.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2025-07-08
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

In the prior art, pointer instruments require manual reading, resulting in low efficiency and error-proneness, high replacement cost, and difficult to achieve automated identification.

Method used

By collecting the instrument image, preprocessing and polar coordinate transformation, identifying the bar area and character values, calculating the set of intersection points to determine the instrument axis point, selecting the scale lines and pointer areas in the polar coordinate image, and using median filtering and Theil-sen estimation method to calculate the pointer angle and number to achieve automatic reading.

Benefits of technology

Improve the accuracy and efficiency of automated recognition of pointer instrument readings, reduce manual intervention, and reduce operational complexity and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116092088B_ABST
    Figure CN116092088B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for identifying the reading of an instrument pointer, belonging to the technical field of instrument identification. Specifically, it includes: collecting an instrument image, preprocessing the instrument image, identifying the existing bar regions, obtaining a straight-line equation through median filtering, calculating the intersection points of the straight-line equation, and setting the density center point of the intersection point set as the axis center point; obtaining a polar coordinate image with the axis center point as the origin, preprocessing the polar coordinate image, and identifying parallel bar regions to obtain scale lines; identifying the numerical values of the characters in the instrument image, the center points of the characters after polar coordinate transformation, assigning the character numerical values to the scale lines with the closest distance, and setting the angle of the pixel point closest to the axis center point as the scale line angle; selecting the pointer region, calculating the pointer angle according to the order of the pointer region in the parallel bar regions, traversing the scale lines, and determining the median value of the set of undetermined indication values as the pointer indication; the present invention realizes accurate identification of pointer readings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pointers, and particularly to a method for identifying the reading of an instrument pointer. Background Art

[0002] Although the detection and data transmission technologies of digital display instruments have been quite mature, in some traditional industrial productions and some complex environments, pointer-type instruments are still the main tools for measurement at present. With the informatization and digitalization of industrial production and life, the readings of pointer-type instruments still need to be manually input, which not only consumes a large amount of manpower, but also is prone to errors due to heavy workload, seriously affecting the efficiency of industrial production. Moreover, replacing pointer-type instruments without data transmission has problems such as high cost, complex operation, and excessive waste of resources. Therefore, how to automatically identify the readings of pointer-type instruments is particularly important in industrial production and life. Summary of the Invention

[0003] The purpose of the present invention is to provide a method for identifying the reading of an instrument pointer to solve the following technical problems:

[0004] How to automatically identify the readings of pointer-type instruments.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A method for identifying the reading of an instrument pointer includes the following steps:

[0007] Collect an instrument image, preprocess the instrument image, identify the strip regions existing in the preprocessed instrument image, obtain a straight-line equation for the strip regions through median filtering, calculate the intersection points of any two of the straight-line equations to obtain an intersection point set, and determine the density center point of the intersection point set as the instrument axis center point;

[0008] Perform polar coordinate transformation on the instrument image with the axis center point as the origin to obtain a polar coordinate image, preprocess the polar coordinate image, identify the parallel strip regions existing in the preprocessed polar coordinate image, select the conforming parallel strip regions through a preset rectangular frame and mark them as scale lines; identify the numerical values of the characters existing in the instrument image, and obtain the coordinates of the character center points after polar coordinate transformation, assign the character numerical values to the scale line closest to the character center point, and calibrate the angle of the pixel point closest to the axis center point of the scale line as the scale line angle;

[0009] Select the parallel bar region with the smallest pixel value in the polar coordinate image and mark it as the pointer region. Calculate the pointer angle according to the order of the pointer region among all parallel bar regions. Select any pair of scale lines with known numerical values and angles to calculate the undetermined value of the pointer indication. Select all scale lines in turn to obtain a set of undetermined values of the indication. Determine the median of the set of undetermined values of the indication as the pointer indication.

[0010] As a further solution of the present invention: The specific process of the preprocessing is as follows:

[0011] Perform gray processing on the image to obtain a gray image. Binarize the gray image based on an adaptive threshold to obtain a binary image. Divide the connected regions with pixel value 0 in the binary image into independent regions.

[0012] As a further solution of the present invention:

[0013] The process of identifying the bar region is as follows:

[0014] Identify the independent pixel regions in the binary image after dividing the connected regions. Obtain the minimum bounding rectangles of all independent pixel regions. If there is a minimum bounding rectangle with a length lower than the preset threshold l and a width lower than the preset threshold w, the independent pixel region corresponding to the minimum bounding rectangle is the bar region.

[0015] As a further solution of the present invention:

[0016] The specific process of obtaining the straight line equation by median filtering is as follows;

[0017] Obtain the mean value of the coordinate distribution of the pixel points inside any bar region. Select the pixel point with the largest deviation from the mean value and mark it as the end point. Sort all the pixel points in the bar region in ascending order according to the distance from the end point to obtain a pixel point queue with a length of n. Divide the pixel point queue into two sub-pixel point queues with a length of n / 2 from the middle position. If n is odd, discard one pixel in the bar region. Sequentially collect two pixel points with the same order in the two sub-pixel point queues and mark them as a pixel point pair. Sequentially establish undetermined straight line equations based on the pixel point pairs to obtain a set of undetermined straight line equations, and extract the slope set ki and the parameter set bi of the set of undetermined straight line equations, i = 1,..., n / 2. Obtain the median k0 of the slope ki and the median b0 of the parameter set bi. Set the straight line equation of the bar region as y = k0x + b0.

[0018] As a further solution of the present invention: The specific process of determining the instrument axis center point is as follows;

[0019] Taking any intersection point in the intersection point set as the center, count the number of adjacent intersection points within the radius R, where R is a preset value. Select the intersection point with the largest number of adjacent intersection points and determine it as the instrument axis center point.

[0020] As a further solution of the present invention: The method for segmenting the black connected regions in the binary image is implemented based on the connectedComponentsWithStats function in the OpenCV image library.

[0021] As a further solution of the present invention: The specific calculation process of the pointer angle is as follows;

[0022] Count the number c of all parallel bar regions, obtain the order d of the pointer region from top to bottom among all parallel bar regions. If 2πd / c is greater than or equal to π / 2, the pointer angle is 360d / c degrees; if 2πd / c is less than π / 2, the pointer angle is (360d / c + 720) degrees.

[0023] As a further solution of the present invention: The specific calculation process of the pointer reading is as follows:

[0024] Select any pair of scale lines with known scale values and angles, marked as (di a , de a ) and (di b , de b ). Mark the known pointer angle as de x . Then, through the formula , obtain the undetermined value Vx of the reading. Sequentially select all scale lines and the pointer angle for calculation to obtain a set of undetermined values of the reading, and determine the median of the set of undetermined values of the reading as the pointer reading.

[0025] Advantages of the present invention:

[0026] In the present invention, in order to improve the recognition accuracy and avoid the uncertainties caused by factors such as imaging quality and image processing threshold accuracy, a large number of Theil-sen parameter estimation based on median filtering and improved Theil-sen estimation are used. As a statistical method, Theil-sen estimation based on median filtering is insensitive to outliers, noise data, and error data, and can obtain reliable results under abnormal conditions of a large number of data samples. For the scale lines drawn on the instrument, which are represented as a set of pixels obtained through processing, they are abstracted as linear parameter representations. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The present invention will be further described below with reference to the accompanying drawings.

[0028] Figure 1 is a flow diagram of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0030] Please refer to Figure 1 as shown, the present invention is a method for identifying the reading of an instrument pointer, including the following steps:

[0031] Collect an instrument image, preprocess the instrument image, identify the bar regions existing in the preprocessed instrument image, obtain a straight-line equation for the bar regions through median filtering, calculate the intersection points of any two of the straight-line equations to obtain an intersection point set, and determine the density center point of the intersection point set as the instrument axis center point;

[0032] Perform polar coordinate transformation on the instrument image with the axis center point as the origin to obtain a polar coordinate image, preprocess the polar coordinate image, identify the parallel bar regions existing in the preprocessed polar coordinate image, select the conforming parallel bar regions through a preset rectangular frame and mark them as scale lines; identify the numerical values of the characters existing in the instrument image, and obtain the character center point coordinates after polar coordinate transformation, assign the character numerical values to the scale line closest to the character center point, and calibrate the angle of the pixel point closest to the axis center point of the scale line as the scale line angle;

[0033] Select the parallel bar region with the smallest pixel value in the polar coordinate image and mark it as the pointer region, calculate the pointer angle according to the order of the pointer region among all the parallel bar regions, select any pair of scale lines with known numerical values and angles to calculate the undetermined value of the pointer reading, sequentially select all the scale lines to obtain a set of undetermined values of the reading, and determine the median of the set of undetermined values of the reading as the pointer reading;

[0034] The present invention uses the Ocr algorithm to detect, locate, and identify and mark numbers, analyzes the text content to filter out irrelevant text, filters and compares again according to prior information to prevent incorrect recognition of decimal points, and converts the center of each character region located by OCR into polar coordinate representation according to the rules of polar coordinate transformation centered on the pointer axis center; the present invention makes all scale lines appear as parallel bars and the two pointers appear as straight lines concentrated near a certain row by transforming the polar coordinate transformation diagram according to the axis center point;

[0035] In a preferred embodiment of the present invention, the specific process of the preprocessing is:

[0036] The image is grayscaled to obtain a grayscale image, and the grayscale image is binarized based on an adaptive threshold to obtain a binary image. The connected regions with pixel value 0 in the binary image are segmented into independent regions;

[0037] Using morphological erosion processing in image processing, the adhesion between the possible pointer and the trademarks and scale texts in the background is broken. Using the connected component analysis provided by the image processing library, such as the connectedComponentsWithStats function in the opencv library, the independent local objects in the binary image are segmented, which are represented as sets of multiple pixels.

[0038] In a preferred case of this embodiment, the process of identifying the bar region is as follows:

[0039] Identify the independent pixel regions in the binary image after segmenting the connected regions, obtain the minimum bounding rectangles of all independent pixel regions. If the length of the minimum bounding rectangle is lower than the preset threshold l and the width is lower than the preset threshold w, then the independent pixel region corresponding to the minimum bounding rectangle is the bar region;

[0040] Using the ratio parameters of length and width, and the threshold limits of length and width, exclude the irrelevant contents such as characters and trademarks in the table header image, and leave the bar region.

[0041] In another preferred embodiment of the present invention, the specific process of obtaining the straight line equation by median filtering is as follows;

[0042] Obtain the mean value of the coordinate distribution of the pixel points inside any bar region, select the pixel point with the largest deviation from the mean value and mark it as the end point. Sort all the pixel points in the bar region in ascending order according to the distance from the end point, obtain a pixel point queue with length n, divide the pixel point queue into two sub-pixel point queues with length n / 2 from the middle position. If n is odd, then discard one pixel in the bar region. Sequentially collect two pixel points with the same order in the two sub-pixel point queues and mark them as a pixel point pair. Sequentially establish a pending straight line equation based on the pixel point pair, obtain a set of pending straight line equations, and extract the slope set ki and the parameter set bi of the set of pending straight line equations, i = 1, …, n / 2. Obtain the median k0 of the slope ki and the median b0 of the parameter set bi, and set the straight line equation of the bar region as y = k0x + b0;

[0043] Using the median method for straight line parameter estimation of bar objects has strong robustness to possible deviations and exceptional cases in the pixel position distribution of bar objects.

[0044] In another preferred embodiment of the present invention, the specific process of determining the instrument axis center point is as follows;

[0045] Taking any intersection point in the set of intersection points as the center, count the number of adjacent intersection points within a radius R, where R is a preset value, and select the intersection point with the largest number of adjacent intersection points as the instrument axis center point.

[0046] It should be noted that the method for segmenting the black connected regions in the binary image is implemented based on the connectedComponentsWithStats function in the OpenCV image library.

[0047] In another preferred embodiment of the present invention, the specific calculation process of the pointer angle is as follows:

[0048] Count the number c of all parallel bar regions, obtain the order d of the pointer region from top to bottom among all parallel bar regions. If 2πd / c is greater than or equal to π / 2, the pointer angle is 360d / c degrees; if 2πd / c is less than π / 2, the pointer angle is (360d / c + 720) degrees.

[0049] When the axis position is correct, the axis will be exactly within the range where the pointer is located. After performing polar coordinate transformation, the pixels corresponding to the pointer will have similar angles. In particular, the central axis of the pointer will have the same angle. In the two-dimensional image after polar coordinate transformation, the pixels with the same angle will correspond to the same row. Using the obvious contrast color design between the meter pointer and the background dial pixels, in the image after polar coordinate transformation, there will be a row with very low pixel values. Cumulate this two-dimensional image by row, select the row with the smallest value, and this order divided by the total number of rows of the image corresponds to the relative proportion of the pointer angle in the range of 0 to 2π.

[0050] In the recognition of circular meters, there is such a situation: when performing polar coordinate transformation using an image processing library, the generated angle values start from the x-axis of the rectangular coordinate system and rotate counterclockwise. The side effect of this is that for circular meters, if the identified label numbers are distributed in the fourth quadrant, although the recognized number values are large, the corresponding angle positions in the polar coordinate space are very small, which does not conform to the linear distribution law. Similarly, when the recognized pointer points to the fourth quadrant, its angle attribute will be too small, destroying the linear relationship between the angle and the indication value on the dial.

[0051] Therefore, the present invention only needs to filter and check whether there is an angle within the range. If there is, add 2π to the corresponding radian. In sector meters, such a situation does not exist. The pointer axis is often located in the middle or on the right side of the lower part, and there will be no scale in the lower right of the pointer axis.

[0052] In another preferred embodiment of the present invention, the specific calculation process of the pointer indication is as follows:

[0053] Select any pair of scale lines with known scale values and angles, marked as (di a , de a ) and (di b , de b ). Mark the known pointer angle as de x . Then, obtain the value to be determined Vx of the indication through the formula . Sequentially select all scale lines and pointer angles for calculation to obtain a set of values to be determined of the indication. Determine the median of the set of values to be determined of the indication as the pointer indication;

[0054] The position in the polar coordinate system of OCR. Compare the positions of the endpoints of the scale lines in the polar coordinate system, and assign the nearest scale line endpoint to the OCR result. Take these OCR scales with numerical attributes and coordinates as a set, and further simplify the polar coordinate positions of each OCR result to be represented only by angles;

[0055] In the transformed image, the pointer will be represented as a row and column with a value of black. By cumulatively summing the values of the image matrix by column, determine the column corresponding to the pointer, and compare the column number with the image size to obtain the angle of the pointer;

[0056] Use the extended Theil - sen estimation to obtain the numerical value of the indication corresponding to the pointer: Compare the angle of the pointer with any two of the scale data with angle attributes, perform linear interpolation or extrapolation calculations to obtain an estimated value; Traverse all combinations of the two scale data to obtain a set of estimated values of the pointer indication; Take the median of this set as the final pointer indication value.

[0057] The above has described a specific embodiment of the present invention in detail, but the content described is only a preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. All equivalent changes and improvements made in accordance with the scope of the application of the present invention shall still fall within the scope covered by the patent of the present invention.

Claims

1. A method for identifying the reading of an instrument pointer, characterized in that, Including the following steps: Collect instrument images, preprocess the instrument images, identify the strip regions existing in the preprocessed instrument images, obtain the straight-line equations for the strip regions through median filtering, calculate the intersection points of any two of the straight-line equations to obtain an intersection point set, and determine the density center point of the intersection point set as the instrument axis center point; Perform polar coordinate transformation on the instrument image with the axis center point as the origin to obtain a polar coordinate image, preprocess the polar coordinate image, identify the parallel strip regions in the preprocessed polar coordinate image, and screen the parallel strip regions through a preset rectangular frame to obtain scale lines; Identify the numerical values of the characters in the instrument image, obtain the character center point coordinates after polar coordinate transformation, assign the character numerical values to the scale lines closest to the character center points, and calibrate the angle of the pixel point closest to the axis center point among the scale lines as the scale line angle; Select the parallel strip region with the smallest pixel value in the polar coordinate image and mark it as the pointer region, calculate the pointer angle according to the order of the pointer region among all the parallel strip regions, select any pair of scale lines with known numerical values and angles to calculate the undetermined value of the pointer reading, sequentially select all the scale lines to obtain a set of undetermined values of the pointer reading, and determine the median of the set of undetermined values of the pointer reading as the pointer reading; The specific process of obtaining the straight-line equation through median filtering is as follows; Obtain the mean value of the coordinate distribution of the pixel points inside any strip region, select the pixel point with the largest deviation from the mean value and mark it as the endpoint, sort all the pixel points in the strip region in ascending order according to the distance from the endpoint to obtain a pixel point queue with a length of n, divide the pixel point queue into two sub-pixel point queues with a length of n / 2 from the middle position. If n is odd, discard one pixel in the strip region; sequentially collect two pixel points with the same order in the two sub-pixel point queues and mark them as pixel point pairs, sequentially establish undetermined straight-line equations based on the pixel point pairs to obtain a set of undetermined straight-line equations, and extract the slope set ki and parameter set bi of the set of undetermined straight-line equations, where i = 1,..., n / 2, obtain the median k0 of the slope ki and the median b0 of the parameter set bi, and set the straight-line equation of the strip region as y = k0x + b0; The specific calculation process of the pointer angle is as follows; Count the number c of all parallel strip regions, obtain the order d of the pointer region from top to bottom among all the parallel strip regions. If 2πd / c is greater than or equal to π / 2, the pointer angle is 360d / c degrees; if 2πd / c is less than π / 2, the pointer angle is (360d / c + 720) degrees; The specific calculation process of the pointer reading is as follows: Select any pair of scale lines with known scale values and angles, marked as (di a , de a ) and (di b , de b ), mark the known pointer angle as de x , then the undetermined value Vx of the reading is obtained through the formula . Calculate by successively selecting all scale lines and pointer angles to obtain a set of undetermined values of the reading, and determine the median value of the set of undetermined values of the reading as the pointer reading.

2. The method for identifying the reading of an instrument pointer according to claim 1, characterized in that, The specific process of the preprocessing is as follows: Perform gray processing on the image to obtain a gray image, binarize the gray image based on an adaptive threshold to obtain a binary image, and divide the connected regions with pixel value 0 in the binary image into independent regions.

3. According to the method for identifying the reading of an instrument pointer as described in claim 2, characterized in that The process of identifying the strip region is as follows: Identify the independent pixel regions in the binary image after segmenting the connected regions, obtain the minimum bounding rectangles of all independent pixel regions. If there exists a minimum bounding rectangle with a length lower than the preset threshold l and a width lower than the preset threshold w, then the independent pixel region corresponding to this minimum bounding rectangle is a strip region.

4. A method for identifying the reading of an instrument pointer according to claim 1, characterized in that, The specific process for determining the center point of the instrument is as follows: Taking any intersection point in the intersection point set as the center, count the number of adjacent intersection points within a radius R, where R is a preset value. Select the intersection point with the largest number of adjacent intersection points and determine it as the center point of the instrument.

5. A method for identifying the reading of an instrument pointer according to claim 2, characterized in that, The method for segmenting the black connected regions in the binary image is implemented based on the connectedComponentsWithStats function in the OpenCV image library.

Citation Information

Patent Citations

  • Marker-based non-cooperative target pose measuring method

    CN108562274A

  • Pointer instrument identification method based on text area reading

    CN114399677A

  • Machine vision identification method for pointer type instrument

    CN114898347A