A Dial Pointer Recognition Method Based on Color Segmentation and Probability Model
Through the step-by-step pointer recognition method based on color segmentation and probability model, the automatic pointer recognition problem under complex background and light interference of the power dial is solved, and automatic recognition and simple deployment with high accuracy are achieved.
Patent Information
- Application Number
- CN202110345179.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-03-31
AI Technical Summary
The prior art is difficult to achieve high-accuracy pointer automatic recognition on a power dial with complex backgrounds, many light interference, many dial arc circles, short pointers, numerous internal characters, and irregular holes in the center, and the deployment process requires manual calibration.
The step by step pointer recognition method based on color segmentation and probability models is adopted, including dial positioning, color iterative segmentation, scale area coarse positioning, circular fitting precision positioning, adaptive binarization and radius mapping calculation. By removing interference step by step, the pointer position is finally determined.
It realizes high resistance to complex backgrounds and light interference, can automatically recognize pointers, is easy to deploy, and does not require manual calibration. It is suitable for embedded systems and general PCs, and has high recognition accuracy.
Smart Images

Figure CN112990064B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the image capturing and processing technology in the technical field of data recognition, automatically recognizes the pointer of an electric power meter and converts it into a meter reading, and specifically relates to a meter pointer recognition method based on color segmentation and probability model. Background Art
[0002] Pointer dials have the advantages of being waterproof, antifreeze and dustproof, so they are widely used in power systems. At present, many substations still use manual reading of pointer dials, which is very time-consuming and has certain safety hazards. In terms of the trend of technological development, automatic reading of pointer dials will become a norm.
[0003] The current automatic dial pointer recognition technologies mainly include template calibration, edge detection, line and circle detection, corner detection, contour fitting, radial segmentation, and deep learning methods. In fact, the template calibration method still requires a lot of manual participation. Once the installation position of the dial changes, it needs to be recalibrated, so it is not very practical. Edge, line, circle, and corner detection methods can only have a high accuracy rate when the image is relatively clear, there is not much light interference, there are not many dial characters, and the pointer is relatively long. In the case of poor image quality and interference from light and noise, the recognition accuracy is difficult to meet practical requirements. The deep learning method requires the collection of a large number of images of different scenes, has high requirements on the performance of the processor, and is generally used for dial positioning, and is not suitable for accurately identifying pointer readings.
[0004] Therefore, it is objectively necessary to solve the problem of how to remove a large amount of tedious manual calibration to speed up deployment, and how to overcome the problems in the existing technology of low accuracy and difficulty in pointer recognition of electric meter dials with complex backgrounds, much light interference, many dial arcs, very short pointers, many characters inside the dial, irregular holes in the center, extremely irregular shapes in the holes, and oil filling inside the dial resulting in image breakage. Summary of the invention
[0005] The technical problem to be solved by the present invention is to propose a step-by-step pointer recognition method based on color segmentation and probability model for the above-mentioned electric meter dial with complex background, much light interference, many dial arcs, very short pointers, many characters inside the dial, irregular holes in the center, extremely irregular shapes inside the holes, and oil-filled dial.
[0006] To achieve the above object, the technical solution proposed by the present invention is a dial pointer recognition method based on color segmentation and probability model, which specifically comprises the following steps:
[0007] 1) Use circle detection method to locate the dial and remove complex background;
[0008] 2) Coarse positioning of the scale area according to color iterative segmentation;
[0009] 3) Calculate the fitting points through the coarse positioning of the scale area, and use circular fitting to accurately locate the scale area and the pointer area;
[0010] 4) Perform adaptive binarization on the pointer area;
[0011] 5) Draw a radius mapping diagram, calculate the gradient, and determine the candidate pointer positions;
[0012] 6) Calculate the probabilities of each candidate pointer and determine the position of the pointer.
[0013] In order to remove all the cluttered backgrounds outside the dial and avoid interference from the background color in subsequent color segmentation, the dial is positioned by detecting the dial housing through the Hough transform. Considering that the Hough circle detection may detect multiple circles, to avoid confusion, the range of the circle radius can be limited when multiple circles are detected.
[0014] The above-mentioned coarse positioning of the scale area according to color iterative segmentation utilizes the red, yellow, and green color information of the scale area, adopts the iterative method to obtain the adaptive threshold, and then performs color segmentation according to this threshold to obtain the coarse positioning of the scale area.
[0015] Calculating the fitting points through the coarse positioning of the scale area is based on the scale area generated in step 2. Draw multiple horizontal lines within the outer frame of the scale area, and use the midpoints of the intersection lines between these horizontal lines and the scale area as the fitting points.
[0016] The above-mentioned drawing of the radius mapping diagram divides the circle of the binarized image generated in step 4 into 360 degrees, calculates the radius of each angle, and draws it with the angle as the abscissa and the radius as the ordinate.
[0017] The candidate pointer positions are calculated according to the gradient of the falling edge of the radius mapping diagram.
[0018] Calculating the probabilities of each candidate pointer means that by drawing the radius mapping diagram, calculating the radial gradient to obtain the position of the falling edge as the candidate pointer, and then calculating the probability of the falling edge as the pointer according to the length of the falling edge and the positional relationship between the falling edges.
[0019] Compared with the existing methods for automatic dial reading, the beneficial effects of the present invention are as follows:
[0020] First, it has strong anti-interference ability. The method of the present invention adopts a step-by-step positioning method, and each step removes certain external interferences to achieve the purpose of finally positioning the pointer. The actual effect proves that this method has a high ability to resist interferences such as light, oil surface, and noise.
[0021] Second, it can recognize the pointers of power meter dials with complex backgrounds, many arc circles on the dial, very short pointers, numerous characters inside the dial, irregular cutouts in the center, and extremely irregular shapes inside the holes, and has very good practical effects.
[0022] Third, it is easy to deploy. The present invention does not require manual calibration of the dial, saving manpower and improving the deployment efficiency. Moreover, the operation of the present invention does not rely on a processor with powerful computing performance and can also run on an embedded system and a general PC. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a schematic diagram of a typical dial image.
[0024] Figure 2 is the flow chart of the dial pointer recognition of the present invention.
[0025] Figure 3 is a schematic diagram of the fitting points in the scale area.
[0026] Figure 4 is a binary image.
[0027] Figure 5 is a radius mapping diagram. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] The specific embodiments of the present invention will be further described below in conjunction with the accompanying drawings.
[0029] The present invention proposes a step-by-step pointer recognition method based on color segmentation and probability model for power meter dials with complex dial backgrounds, many light interferences, many arc circles on the dial, very short pointers, numerous characters inside the dial, irregular cutouts in the center, extremely irregular shapes inside the holes, and oil filling inside the dial.
[0030] Figure 1 As shown in the schematic diagram of the dial image, it can be divided into a cluttered background area, the inner and outer shells of the dial, the inner structure circle, the scale area, the pointer area, the irregular cutout area, and the cluttered text area.
[0031] The present invention first locates the dial, removes the complex background, then performs rough positioning according to color features, calculates the fitting points, and then uses circular fitting to accurately locate the scale area and the pointer area. Then, through adaptive binarization, a radius mapping diagram is drawn, the position of the falling edge is calculated, and finally the angle of the pointer is determined according to the probability. A specific embodiment of the recognition process of this method is as Figure 2 shown and includes the following steps:
[0032] S1: Dial positioning: Use the Hough transform to detect the dial housing. The Hough circle detection may detect multiple circles, and the circle radius can be limited within a certain range. The position of the outer circle of the dial detected by the Hough circle detection method is not fixed. Some are close to the outer circle of the dial housing, and some are inside the inner circle of the dial housing. The center of the circle is not necessarily at the center of the dial, but it is sufficient to distinguish the background from the dial. After detecting the dial area, the cluttered background outside the dial can be removed to avoid interference from the background color in subsequent color segmentation.
[0033] S2: Coarse positioning of the scale area: Due to factors such as light, oil surface breakage, and numerous characters, it is difficult to determine the scale area through circle detection or edge detection methods. The most obvious feature of the dial is the color information of the scale area. Using this information, the coarse positioning of the scale area can be obtained, and then circle fitting is used for precise positioning after coarse positioning. Before color segmentation, the image is first subjected to color histogram equalization to ensure that the hues are basically the same. The scale area contains three colors, namely red, yellow, and green, which need to be extracted separately. Taking the extraction of red as an example, assume that the pixel color value is represented as Color(r, g, b), where r, g, and b are the red, green, and blue components respectively, and T is the adaptive threshold. If (r - g)>T and r ∈ [80, 220], the original pixel value is retained, otherwise the color value is cleared. To improve the generality of the method, the appropriate threshold T is found through the iterative method. Assume that T0 is the initial threshold and ΔT is the iterative step size. The threshold used for the i-th segmentation is T i = T0 - ΔT, and the number of non-zero pixels remaining in the image after the i-th segmentation is C i , then when C i is greater than a certain value, the iteration ends, T = T i , and the segmentation result of the i-th time is used as the final color extraction result. After color segmentation, three images of red, yellow, and green are obtained. Merging the three images can obtain the complete scale area.
[0034] S3: Calculate the fitting points: After obtaining the scale area, draw multiple horizontal lines inside the outer frame of the scale area, and use the midpoints of the intersection lines between these horizontal lines and the scale area as the fitting points, as Figure 3 shown. Due to the interference of light, the scale area may be incomplete, but there are always several of the multiple line segments that can intersect with the scale area, so sufficient fitting points can be obtained.
[0035] S4: Precise positioning of the pointer area: Using the above fitting points, fit a circle that can exactly enclose the scale area. After finding the scale area, the pointer area can be obtained according to the radius ratio relationship, and the cluttered hole area in the center of the dial is removed to obtain a clean pointer area.
[0036] S5: Binarization of the pointer area: Using the adaptive threshold method, take the red component of the pointer area as the grayscale image, and calculate the grayscale image histogram Hist(i), where i ∈ [0, 255]. Assume that the total number of non-zero pixels in the image is Count, and w is a ratio set according to the actual situation. Then the calculation method of the adaptive threshold Th is as follows:
[0037]
[0038] After binarization using Th as the threshold, through morphological erosion, hole filling, and filling the middle dug hole, finally a relatively clean scale and pointer binarized image is obtained, as Figure 4 shown.
[0039] S6: Obtain the candidate pointer: Divide the circle of the binarized image shown in Figure 4 into 360 degrees, calculate the radius of each angle, use the angle as the abscissa and the radius as the ordinate to draw a radius mapping graph, as Figure 5 shown. The radius mapping graph excludes the bottom character area according to experience. Calculate the position of the candidate pointer according to the gradient of the falling edge of the radius mapping graph.
[0040] S7: Calculate the probability of the candidate pointer: In fact, due to light interference, oil filling, and noise interference, there may be damage to the scale and pointer, and there are many falling edges outside the scale and pointer. But there are two features that can be used to distinguish the scale and the pointer. The first is the gradient value of the falling edge. The larger the gradient value of the falling edge, the greater the probability that the falling edge is the pointer. Let the gradient of the falling edge i be g i , and the maximum gradient of all falling edges is g max . Define the gradient probability of the falling edge i as g i / g max .
[0041] The second is the distance relationship with other falling edges. It is known that the average angular difference between two scales is A, and the total number of scales is K. Define m ∈ [1, K]. Assume that there are N falling edges in the mapping graph, and the distance between the i-th falling edge and the j-th falling edge is D ij . D ij is the angular difference between the i-th falling edge and the j-th falling edge. Define the boolean value B ij ,
[0042]
[0043] The distance relationship between the falling edge i and other falling edges is defined as:
[0044]
[0045] The S of the falling edge i iThe larger it is, the greater the probability that the falling edge is the pointer. Define the distance probability of the falling edge i as S i / (N - 1). The total probability that the falling edge i is the pointer is calculated using the following expression:
[0046]
[0047] S8: Determine the pointer position: Take the candidate pointer with the highest probability as the recognized pointer, and convert the angle of the candidate pointer into a pointer reading.
[0048] It should be noted that the above embodiments provided by the present invention are only illustrative and do not serve to limit the specific implementation scope of the present invention. The protection scope of the present invention should include those transformations or alternative solutions that are obvious to those of ordinary skill in the art.
Claims
1. A dial pointer recognition method based on color segmentation and probability model, characterized in that It includes the following steps: 1) Locate the dial through the circle detection method to remove the complex background; 2) Coarsely locate the scale area according to color iterative segmentation; 3) Calculate the fitting points through the coarse location of the scale area, and accurately locate the scale area and the pointer area by using circular fitting; 4) Perform adaptive binarization on the pointer area; 5) Draw a radius mapping diagram, calculate the radial gradient, and determine the candidate pointer positions; 6) Calculate the probabilities of each candidate pointer to determine the position of the pointer; Calculating the probabilities of each candidate pointer means drawing a radius mapping diagram, calculating the radial gradient to obtain the position of the falling edge as a candidate pointer, and then calculating the probability of the falling edge as the pointer according to the gradient value of the falling edge and the distance relationship between the falling edges; Calculating the probability of candidate pointers: There are two features used to distinguish the scale from the pointer. The first is the gradient value of the falling edge. The larger the gradient value of the falling edge, the greater the probability that the falling edge is a pointer. Let the gradient of the falling edge i be g i , and the maximum gradient of all falling edges is g max . Define the gradient probability of the falling edge i as g i / g max ; The second is the distance relationship with other falling edges. Given that the average angular difference between two scales is A and the total number of scales is K, define m ∈ [1, K]. Assume that there are N falling edges in the radius mapping graph, and the distance between the i-th falling edge and the j-th falling edge is D ij , D ij is the angular difference between the i-th falling edge and the j-th falling edge. Define the boolean value B ij , The distance relationship between the falling edge i and other falling edges is defined as: S of the falling edge i i The larger it is, the greater the probability that the falling edge is a pointer. Define the distance probability of the falling edge i as S i / (N - 1). The total probability that the falling edge i is a pointer is calculated using the following expression: Determine the pointer position: Take the candidate pointer with the maximum total probability as the recognized pointer, and convert the angle of the candidate pointer into the pointer reading.
2. The dial pointer recognition method based on color segmentation and probability model according to claim 1, characterized in that, The coarse location of the scale area according to color iterative segmentation uses the red, yellow, and green color information of the scale area, adopts the iterative method to obtain the adaptive threshold, and then performs color segmentation according to the threshold to obtain the coarse location of the scale area.
3. The dial pointer recognition method based on color segmentation and probability model according to claim 1, wherein Calculating the fitting points through the coarse location of the scale area is based on the scale area generated in step 2. Draw multiple horizontal lines within the outer frame of the scale area, and use the midpoints of the intersection lines between these horizontal lines and the scale area as the fitting points.
Citation Information
Patent Citations
Method and system for automatically identifying readings of pointer type meters
CN101620682A
Automatic number identification method and system of power pointer type instrument
CN106529519A