A meter image recognition method for incomplete power pointers
By training target detection and semantic segmentation models, combined with the incomplete scale completion method, we solve the problems of low recognition efficiency and low accuracy of meter recognition methods in the existing technology when facing old dials and incomplete scales, achieving a more efficient and accurate meter picture recognition.
Patent Information
- Application Number
- CN202210088721.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-01-25
AI Technical Summary
When faced with factors such as old dial, incomplete scale, foreign object pasting and light changes, the existing meter recognition method has low recognition efficiency and low accuracy, making it difficult to effectively identify the meter picture of the meter with broken power pointers.
By training the target detection model, meter recognition classification model and semantic segmentation model, meter information is extracted, and the incomplete scale completion method is used to correct the pointer scale readings under different incomplete conditions and improve the recognition accuracy and processing efficiency.
It improves the accuracy and efficiency of meter picture recognition, and can effectively deal with incomplete scales caused by old dials, foreign matter adhesion and light changes, ensuring the accuracy of readings.
Smart Images

Figure CN114445611B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power pointer meter status recognition based on machine vision, and in particular to a meter image recognition method for a defective power pointer. Background Art
[0002] Power equipment usually has a dial indicating the current operating status of the equipment. Most of the dials use pointers to indicate the scale, and a few use a display screen to directly display the value. An important inspection task of the power system is to observe the meter values of each device, determine whether the equipment is operating normally at the time, and record the meter values. Manual inspection methods usually require power workers to go deep into the substation to observe and record next to the equipment, which requires a lot of manpower and material resources. In recent years, with the promotion of unmanned substations, the daily operation and maintenance inspection of substations has gradually developed towards unmanned, digital and intelligent directions. At present, substation intelligent inspection robots and fixed cameras can automatically read the meter pointer indications through image recognition, gradually replacing manual identification and recording, greatly improving the inspection efficiency. However, the existing meter recognition methods are usually affected by external factors in actual applications, such as old dials, incomplete scales, foreign objects attached to the dials, and light changes, resulting in low recognition efficiency and low recognition accuracy. Therefore, how to implement a meter image recognition method for incomplete power pointers has become a technical problem that needs to be solved in this field. Summary of the invention
[0003] In view of the technical problems of low efficiency and low accuracy of existing intelligent meter recognition methods, the present invention proposes a meter image recognition method for incomplete power pointers, which extracts meter information through a training model and corrects the pointer scale readings in different incomplete situations through an incomplete scale completion method, thereby improving the recognition accuracy and processing efficiency, and solving the problem that the existing technology cannot recognize meter images in the case of incomplete scales caused by factors such as old dials in substations, foreign objects attached to the dials, and light changes.
[0004] In order to achieve the above object, the technical solution of the present invention is implemented as follows: a meter image recognition method for a defective power pointer, the steps of which are as follows:
[0005] Step 1: Use the target detection model to process the meter image to be processed and extract the dial area of the electricity meter;
[0006] Step 2: Identify the dial area through the meter recognition and classification model to obtain the basic parameter information of the meter;
[0007] Step 3: Extract the main scale, sub-scale and pointer in the dial area through the semantic segmentation model;
[0008] Step 4: Expand the image containing the scale area processed in step 3 into a rectangular image;
[0009] Step 5: Convert the rectangular graph into a one-dimensional array by weighted linear compression, and obtain the compressed mean to determine the position of the scale and pointer in the meter;
[0010] Step 6: Compare the number of scales extracted in step 5 with the actual number of scales on the meter to determine whether the main and sub-scales are incomplete. If the sub-scale is incomplete but the main scale is not, read the number using the main scale. If the sub-scale is completely incomplete but the main scale is partially incomplete, complete the incomplete main scale and read the number. If the sub-scale is partially incomplete, complete the sub-scale and read the number using the pointer. If the initial scale is incomplete, manually make compensation marks and re-determine whether the main and sub-scales are incomplete.
[0011] The target detection model in step 1 is the PPYOLOTiny model of the MobileNetV3 backbone network, and the prediction box with the highest confidence of the dial is selected; the method for preparing the training data set of the target detection model is: collecting meter sample images, and using labelme annotation software to annotate the dial area; the meter recognition and classification model in step 2 is the YOLOV3 image classification deep learning model of the darknet53 backbone network, and the meter recognition and classification model recognizes the type of meter in the picture of the dial area, and obtains the basic parameter information of the meter according to the meter type query data structure; train the meter recognition The data set of the semantic segmentation model is obtained by classifying the images in the prediction box obtained by the target detection model; the semantic segmentation model is a Fast-SCNN model based on a fast segmentation convolutional neural network, and the method for making a training data set for the semantic segmentation model is as follows: the classified meter image is adjusted to a fixed size of 1024*1024, and the main scale and the secondary scale in the dial area are respectively marked with the labelme marking software, the scale is marked in line format, and the pointer is marked in polygon format. After the marking is completed, a corresponding json file is generated, and then the json file is converted into a corresponding SEG image.
[0012] The data structure represents the range, graduation value, unit and center position of the meter; the label of the main scale is set to maxScale, the label of the secondary scale is set to scale, the value of the array element of the area marked as the main scale is set to 1, the value of the array element of the area marked as the secondary scale is set to 2, the value of the array element of the pointer area is set to 3, and other areas are background array elements with values set to 0.
[0013] The rectangular diagram in step four is a two-dimensional matrix, and the radius of the dial is the number of rows of the two-dimensional matrix, and the circumference of the dial is the number of columns of the two-dimensional matrix; the first center positioning result is stored in the data structure, and subsequent dials of the same type obtain the parameter information of the dial by looking up the table to find the center of the dial to obtain the center position.
[0014] The dial radius is calculated as follows: extract key points from a picture containing the dial scale area obtained by the semantic segmentation model, find three key points, establish a coordinate system with the lower left corner of the picture as the origin, take the minimum x-coordinate point, the maximum x-coordinate point and the minimum y-axis coordinate point as three key points, connect adjacent key points, and the intersection of the perpendicular bisectors of the connecting lines is the center of the dial; calculate the distance from the center of the circle by traversing the information table storing the position of each element point, and take the average as the dial radius; the circumference of the dial is 2*π*dial radius;
[0015] The method for looking up the table to find the center of the dial is as follows: two arrays are established: Key is a one-dimensional array of strings to store the meter name, and value is a one-dimensional array of a custom class to store the meter information, wherein the custom class includes the meter range, the number of sub-scales, the number of main scales, the sub-scale division values, the main scale division values and the coordinates of the center of the circle; the meter name is converted into a keyword Key through an ASCII code, the keyword Key is calculated by the division and remainder method in a hash table to obtain the address name corresponding to the meter, and the center of the circle is stored in the address unit using the address name; after the meter classification model identifies the type of the power meter in the current image, a number is returned, and the meter name corresponding to the current meter is obtained through the string in the custom class corresponding to the number, and then the information of the center of the circle of the current dial is obtained according to the meter name, and then the real center of the circle is calculated through the stored center of the circle position and the deviation value of the collected meter image relative to the stored information.
[0016] The rectangularization method is as follows: the dial is determined according to the dial center and the dial radius, and the dial is traversed from the outermost periphery of the dial, and an arc scan is performed from the outer periphery. When the outer arc scan is completed, the inner ring is progressively scanned layer by layer until the inner circle without a pointer is scanned. During the arc scanning process, the coordinates of the pixel points inside the arc are converted into rectangles according to the polar coordinates. The conversion formula is:
[0017]
[0018] Among them, x and y are the horizontal and vertical coordinates in the rectangular diagram respectively, the traversal starts from the negative direction of the y-axis, r is the distance between each scale element point and the center of the circle obtained in the processed circular dial image containing the scale area, and theta is the angle between the position of each pixel point in the circular dial image and the center of the circle and the negative direction of the y-axis;
[0019] The weighted linear compression is a top-down linear compression, and the implementation method is as follows: by traversing the two-dimensional matrix of the rectangular graph, setting weights according to the position of each row element in the two-dimensional matrix, setting different weights from the top layer downwards, and setting weights that decrease from top to bottom according to the height of each row; in the process of traversing from the upper layer to the lower layer, increasing the weight of each layer from low to high according to different layers, multiplying the elements of each layer with the weight of the layer, and adding the sum to the list to form a one-dimensional list set; traversing the list set, filtering the data in the list set to find the peak point, calculating the mean value within the interval range of the scale operation of each peak, that is, the scale point and pointer point to be found, storing the sum of the weights of the scale position and the pointer position in the one-dimensional list, and the pixel point represented by the maximum value of the scale compression and pointer compression in the list is the final position.
[0020] The position information of the minor scale in the dial is stored in the one-dimensional array minor_scale, and the position information of the major scale is stored in the one-dimensional array major_scale. The array element set Q in the one-dimensional array minor_scale is 1 ,Q 2 …Q n1} represents the horizontal position of the minor scale in the two-dimensional matrix, n1 represents the number of minor scales identified, and the one-dimensional array major_scale array element set P = {P 1 ,P 2 …P n2} represents the horizontal position of the main scale of the dial in the two-dimensional matrix, n2 represents the number of main scales of the identified scale; the pointer position M is stored separately;
[0021] Determine the relationship between the array length of the one-dimensional array minor_scale and the number of scales on the dial in the actual situation. If the array length of the one-dimensional array minor_scale is less than 1 / 3 of the number of scales on the normal dial, it is considered that the minor scales on the dial are seriously incomplete. Determine the relationship between the length of the one-dimensional array major_scale and the number of major scales in the main dial. If the length of the one-dimensional array major_scale is equal to the number of major scales in the main dial, it is considered that the major scales in the dial are not incomplete. If the length of the one-dimensional array major_scale is not equal to the number of major scales in the main dial, it is considered that the major scales in the dial are incomplete. If the array length of the one-dimensional array minor_scale is less than the number of scales on the dial in the actual situation and greater than 1 / 3 of the number of scales on the normal dial, it is considered that the minor scales on the dial are partially incomplete.
[0022] When reading in the main scale mode, the position relationship between the pointer and the main scale is determined, and the pointer reading is realized according to the average value of the interval between the main scales and the pointer position; the realization method is:
[0023] Traverse the linear array major_scale. If the pointer does not fall into the current adjacent scale interval, the number of major scales before the pointer increases by 1, and the cumulative sum is used to obtain the number of major scale roots W before the pointer. 1 , determine the main scale position set P = {P 1 ,P 2 …P n1}, through the position difference L of adjacent main scales i =P i -P i-1 Get the distance set between main scales L = {L 1 ,L 2 …L n1-1}, use the main scale root number minus 1 and then multiply it by the division value b represented by the adjacent scale interval 1 , calculate the complete scale indication m before the pointer 1 =(W 1 -1)×b 1 ; Among them, P i is the next main scale position, P i-1 is the current main scale position;
[0024] If the pointer position coincides with the main scale, then m 1 This is the final marked reading;
[0025] If the pointer falls into the position where it falls into the P i-1 The scale and P i The precision reading can be calculated based on the distance between the pointer position and the main scale before the pointer and the average of the intervals between the main scales:
[0026]
[0027] Among them, M is the pointer position, b 1 The division value represented by the main scale, m 2 This is the final pointer reading.
[0028] When the incomplete main scale is completed for reading, the pointer position is compensated by the number of scale roots missing in the incomplete area of the main scale, and the average distance between the main scales is recalculated to realize the pointer reading; the implementation method is:
[0029] Determine the length of the incomplete interval of the main scale. If the pointer does not fall into the current adjacent scale interval, increase the number of main scales before the pointer by 1, and add the accumulated sum to get the number of main scale roots W before the pointer. 1 , determine the position set P of each main scale in the two-dimensional matrix = {P 1 ,P 2 …P n1}, and obtain the distance set between main scales L = {L1 ,L 2 …L n1-1}, calculate the average distance between the initial main scale and the main scale of the pointer interval variance and standard deviation Eliminate the number of main scale roots k outside the main scale interval standard deviation value and the number of main scale roots n1-k within the main scale interval standard deviation value, and obtain the incomplete interval scale distance set Y = {Y 1 ,Y 2 …Y k-1}, the normal main scale distance set Z = {Z 1 ,Z 2 …Z n1-k-1}Recalculate the final main scale mean
[0030] According to the final mean value between main scales, the incomplete spacing of each main scale is checked, and the distance set between main scales of each incomplete interval is Y = {Y 1 ,Y 2 …Y k-1} and the mean, respectively calculate the number of main scale distances missing in the main scale incomplete area N = {N 1 ,N 2 …N k-1}, plus the number of major scale roots W traversed in the previous period 1 , and multiply it by the graduation value b represented by each main scale 1 , you can calculate the complete scale reading m before the pointer 1 =(W 1 -1+N)×b 1 ,in,
[0031] If the pointer position coincides with the main scale, then the scale reading is m. 1 This is the final marked reading;
[0032] If the pointer falls into position P i-1 The scale and P i When the pointer falls into the incomplete area, the more accurate dial reading is further determined, and the accurate reading is calculated based on the distance between the pointer and the main scale before the pointer and the average value of the main scale. Among them, m 1 The full scale reading is before the pointer position.
[0033] The method of completing the secondary scale for pointer reading is to compensate the pointer position by the number of scale roots missing in the incomplete area of the secondary scale, and recalculate the average distance between the main scales to realize the pointer reading. The implementation method is:
[0034] Determine the length of the incomplete interval of the minor scale, and obtain the current minor scale root number W by traversing the linear array minor_scale and accumulating and summing it. 2 , determine the set of scale positions Q = {Q 1 ,Q 2 …Q n2}, through the position difference L of adjacent sub-scales i =Q i -Q i-1 Get the distance set between subscales L = {L 1 ,L 2 …L n2-1}, calculate the mean distance μ between the starting sub-scale and the sub-scale of the pointer interval 1 , variance S 2 And standard deviation σ, then remove the sub-scale roots k outside the sub-scale interval standard deviation value, the sub-scale roots n2-k within the sub-scale interval standard deviation value, and obtain the incomplete interval scale distance set Y = {Y 1 ,Y 2 …Y k-1}, the normal subscale distance set Z = {Z 1 ,Z 2 …Z n2-k-1}Recalculate the final subscale mean μ 2 ;
[0035] According to the final mean value between sub-scales, the incomplete intervals of each sub-scale are checked, and the distance set between sub-scales of each incomplete interval is Y = {Y 1 ,Y 2 …Y k-1} and the mean, and calculate the number of mean subscale distances missing in the subscale defective area. N = {N 1 ,N 2 …N k-1}, plus the number of sub-scale roots W traversed in the previous step 2 , and multiply it by the graduation value b represented by each sub-scale 2 , you can calculate the complete scale reading m before the pointer 1 =(W 2 -1+N)×b 2 ,in,
[0036] If the pointer position coincides with the sub-scale, then m 1 This is the final marked reading;
[0037] If the pointer falls into position Q i-1 The scale and Q iWhen the pointer falls into the incomplete area, the more accurate dial reading is further determined, and the accurate reading is calculated based on the distance between the pointer and the previous sub-scale and the average value of the sub-scale:
[0038]
[0039] Among them, m 1 The full scale reading before the pointer position;
[0040] When manually performing compensation marking, the position of the initial scale of the meter is solved and stored in the database, and the position of the initial scale is obtained by querying the data through the device number. The implementation method is:
[0041] Design a meter recognition program to screen meter images with incomplete initial scales. If the initial scale is incomplete, package the screening results and their corresponding basic information and device number and push them to the backend management personnel interaction interface. The management personnel will mark the incomplete images in the interaction interface to obtain the marked position information. After the marking is completed, confirm to resubmit the image, synchronize the meter basic information structure to the data structure, associate the marked position information with the device number corresponding to the meter image and store it in the database, and the read basic information and scale information of the meter are also stored in the database; at the same time, re-transmit the meter image into the meter recognition program, and finally query the database according to the meter type and device number to obtain its corresponding initial scale position information, and complete the initial scale completion operation;
[0042] The compensation mark is as follows: after the manager receives the abnormal image in the background and believes that the initial scale is incomplete, the manager predicts the initial scale position, and then uses the marking tool to mark the meter image. At the same time, the program records the positions of the two vertices of the marked line segment and saves them to the array line; a two-dimensional integer array background_array of all zeros is created, and the length of the one dimension of the array is equal to the height of the meter image, and the length of the two dimensions is equal to the width of the meter image; in the background_array array, the array element through which the line from line[0] to line[1] passes is assigned a value of 2, and then the linear array subscript value corresponding to the marked scale is obtained according to the rectangularization and weighted linear compression processing, and it is used as the position of the initial main scale; the position of the initial main scale and the device number are written into the database. After the initial scale position information and the device number of the meter are successfully written into the database, the incomplete meter image is returned to the meter recognition program, and the database is searched according to the meter type and device number to obtain the corresponding initial scale position information, and the initial main scale completion operation is completed.
[0043] Compared with the existing electric meter recognition methods on the market, the present invention has the following significant advantages: (1) The present invention has good anti-interference and accuracy, and can effectively solve the problem of meter image recognition in substations where the scale is incomplete due to factors such as old dials, foreign objects stuck to the dials, and light changes. The reading of the incomplete meter can be corrected, and the accuracy of the reading can be effectively guaranteed. (2) The present invention has good versatility. After the training model converges, it has a good applicability to pictures of different types of meters collected by the equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 It is a schematic diagram of the process of the present invention.
[0046] Figure 2 It is a schematic diagram annotated with the meter picture of the present invention.
[0047] Figure 3 Schematic diagram of the semantic segmentation model processing of the present invention, wherein (a) is the original image and (b) is the SEG image.
[0048] Figure 4 This is a schematic diagram of the key points of the dial of the present invention.
[0049] Figure 5 for Figure 4 Schematic diagram of the center selection of the middle dial.
[0050] Figure 6 The present invention is a flow chart of the center mapping of the meter picture.
[0051] Figure 7 This is a flow chart of rectangularization and weighted linear compression of the present invention.
[0052] Figure 8 Schematic diagram of the structure of the scale array of the present invention, wherein (a) is the secondary scale array and (b) is the primary scale array.
[0053] Fig. 9 This is a picture of a meter with incomplete initial scale.
[0054] Fig.10 The figure is a flowchart of the method for handling incomplete initial scale.
[0055] Fig.11 This is a flowchart for abnormal image processing. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] like Figure 1 As shown, a method for recognizing a meter image with a defective power pointer is provided, and the steps are as follows:
[0058] Step 1: Build and train the target detection model, use the target detection model to process the meter image to be processed, and extract the dial area of the electricity meter.
[0059] Collect meter sample images, first use labelme annotation software to annotate the dial area and create a training data set, then use the PPYOLOTiny model of the MobileNetV3 backbone network as the target detection model, and use the created training data set to train the target detection model, which is used to select the prediction box with the highest confidence of the dial for the captured meter image, which can effectively obtain the dial information and improve the accuracy of semantic segmentation.
[0060] Step 2: Build and train a meter recognition and classification model, use the meter recognition and classification model to identify the dial area and obtain the basic parameter information of the meter.
[0061] The images in the prediction box obtained by the target detection model in step 1 are classified to create a classification training data set. Then, the YOLOV3 image classification deep learning model with the darknet53 backbone network is used as the meter recognition classification model, and the classification training data set is used to train the meter recognition classification model to identify the type of meter based on the image of the dial area detected in step 1, and query the range, graduation value, unit, center position and other information of the corresponding type of meter according to the type of meter. The data structure of different types of meters is shown in Table 1.
[0062] Table 1 Parameter information of different types of meters
[0063]
[0064] In order to ensure the accuracy of the center positioning of the dial, the present invention provides a method for finding the center of the dial by looking up a table, that is, taking the first center positioning result as the standard of this type, and the subsequent dials of the same type can obtain the center position by only obtaining the parameter information of the dial. First, two arrays need to be established, Key is a one-dimensional array of strings to store the meter name, and value is a one-dimensional array of a custom class to store the meter information. The custom class includes the meter's range, number of sub-scales, number of main scales, sub-scale division values, main scale division values, and center coordinates.
[0065] The center mapping process is as follows Figure 6 As shown, first, the meter name is converted into a keyword Key through ASCII code, and the keyword Key is calculated through the remainder method in the hash table (f(Key)=Key / N, N is the total number of different types of meters) to obtain the address name corresponding to the meter. The address name is used to store the center position in the address unit as a standard. The subsequent center search process can efficiently locate the center through the center mapping process.
[0066] Before identifying the scale, first create a custom class to correspond the meter name to a constant value. After the meter classification model identifies the type of electricity meter in the current image, it returns a number, which is used to correspond to the string in the custom class to obtain the meter name corresponding to the current meter. Then, according to the meter name, the center position of the current dial and other information are obtained. Then, the actual center position is calculated through the stored center position and the deviation value of the collected meter image relative to the stored information.
[0067] Step 3: Build and train a semantic segmentation model to extract the main scale, sub-scale, and pointer in the dial area through the semantic segmentation model.
[0068] On the basis of step 2, the classified meter image is adjusted to a fixed size of 1024*1024, and the image is further annotated using labelme annotation software to produce a semantic segmentation model dataset. Before training the semantic segmentation model, the present invention uses labelme annotation software to separately annotate the main scale and the secondary scale in the dial area, wherein the label of the main scale is set to maxScale, the label of the secondary scale is set to scale, the value of the array element of the area marked as the main scale is set to 1, the value of the array element of the area marked as the secondary scale is set to 2, the value of the array element of the pointer area is set to 3, and other areas are background array elements, and the value is set to 0. The semantic segmentation model dataset labeling process is as follows: Figure 2 shown.
[0069] During the labeling process of the labelme labeling software, the scale is marked in line format and the pointer is marked in polygon format. This format is a polygon format, which can mark the pointer outline more accurately. After the marking is completed, the corresponding json file is generated, and then the json file is converted into the corresponding SEG image. During the conversion process, the line width is set to 7, which can be well recognized without being too wide to overlap with other scales. The semantic segmentation model is based on the Fast-SCNN model of the fast segmentation convolutional neural network, and the semantic segmentation model is trained using the produced semantic segmentation model dataset. The pixel points of the semantic segmentation image generated by the semantic segmentation model will be set to different colors according to the array elements at the corresponding position, so that the main scale, sub-scale and pointer of the dial area can be clearly displayed. For example Figure 3 The result of semantic segmentation model segmentation of the original image in (a) is as follows Figure 3 As shown in (b), Figure 3 In (b), it can be seen that the effective scale and pointer position information of the dial are extracted, preparing for the next step of rectangularizing the dial scale area.
[0070] Step 4: Expand the image containing the scale area processed in step 3 by rectangularization to obtain a two-dimensional matrix, and the dial radius is the number of rows of the two-dimensional matrix, and the dial circumference is the number of columns of the two-dimensional matrix.
[0071] In order to ensure a more accurate rectangularization result, the center, radius and circumference of the dial need to be obtained first. The present invention returns an image containing the dial scale area through a semantic segmentation model, extracts key points from the image, finds three key points, establishes a coordinate system with the lower left corner of the image as the origin, and takes the minimum x-coordinate point, the maximum x-coordinate point and the minimum y-axis coordinate point (this point refers to the smallest point on the coordinate axis) as the three key points, such as Figure 4 shown.
[0072] Furthermore, connect the adjacent key points, and the intersection of the perpendicular bisectors of the connecting lines is the center of the circle, such as Figure 5 As shown. By traversing the information table storing the position of each element point, the distance from the center of the circle is calculated, and the average is taken as the radius of the disk.
[0073] During the rectangularization process, the dial is determined based on the returned center and radius, and the traversal starts from the outermost part of the dial. First, the outer arc is scanned. When the outer arc scanning is completed, the inner ring is progressively scanned layer by layer until the inner circle without pointer is scanned. During the scanning process, the coordinates of the pixel points inside the arc are converted into rectangles according to the polar coordinates. The conversion formula is shown in formula (1).
[0074]
[0075] According to the conversion formula (1), in specific use, the traversal starts from the negative direction of the y-axis, where x and y are the horizontal and vertical coordinates in the rectangular diagram, respectively, r is the distance between each scale element point and the center of the circle obtained in the processed circular dial image containing the scale area, and theta is the angle between the position of each pixel point in the circular dial image and the center of the circle and the negative direction of the y-axis, and the result is an integer.
[0076] Step 5: Perform weighted linear compression on the rectangular two-dimensional matrix, that is, convert it into a one-dimensional array by weighted compression downward through the pixels, and further calculate the compressed mean to determine the position of the scale and pointer in the meter.
[0077] The rectangularized two-dimensional array is weighted linearly compressed into a one-dimensional linear array. By trying various traversal methods, it is found that the top-down traversal will result in non-vertical scales or pointers, that is, the pointer is tilted. Therefore, when two scales that are relatively close to each other are tilted, the scales will overlap when compressed from top to bottom. Two tilted pointers with a relatively small interval will be compressed into one pointer, resulting in inaccurate scales; when the bottom-up traversal method is used to traverse and find the most accurate point, due to the interference of individual pixels in the image, the error of the search result will be too large.
[0078] In view of the above problems, the present invention provides an optimization scheme for top-down weighted linear compression: first, by traversing a two-dimensional matrix, setting weights according to the position of each row of elements in the two-dimensional matrix, setting different weights from the top layer downward, and setting weights that decrease from top to bottom according to the height of each row; in the traditional downward compression process, only a one-dimensional list is used, and the weights of the element points are added to the one-dimensional list by traversing the elements of each layer of the rectangularized image. However, in the process of traversing from the upper layer to the lower layer of the present invention, according to different layers, the weight of each layer is generally increased by 5 times from low to high, and the elements of each layer are multiplied and summed with the weight of the layer where they are located and added to the list, which can effectively reduce the interference points in the data, and finally form a one-dimensional list set; traverse the list set, filter the data in the list set, and then find the peak point position, calculate the mean value within the interval range of the scale operation where each peak is located, that is, to find the scale point and the pointer point, the sum of the weights of the scale position and the pointer position can be stored in the one-dimensional list, and the pixel point represented by the maximum value of the scale compression and pointer compression in the list is the final position. This optimization scheme effectively avoids the problem of large deviation in the average result after the tilted pointer is compressed downward, greatly improving the error tolerance and accuracy of the data. Figure 7 shown.
[0079] Step 6: According to the result of weighted linear compression in step 5, the positions of the main scale and the secondary scale in the two-dimensional matrix have been stored in two one-dimensional arrays. The length of the array storing the secondary scale position array represents the number of scales in the identified dial. By comparing the number of scales extracted in step 5 with the number of actual scales of the meter, it is determined whether the main scale and the secondary scale are incomplete. If the secondary scale is incomplete and the main scale is not incomplete, go to step A1; if the secondary scale is completely incomplete and the main scale is partially incomplete, go to step B1; if the secondary scale is partially incomplete, go to step C1; if the initial scale is incomplete, go to step D1.
[0080] The position information of the minor scale in the dial is stored in the one-dimensional array minor_scale, and the position information of the major scale is stored in the one-dimensional array major_scale. The schematic diagram of the array minor_scale and the array major_scale is as follows: Figure 8 As shown, the length of the array represents the number of scales on the dial, and the array element set Q = {Q 1 ,Q 2 …Q n1} represents the horizontal position of the sub-scale in the dial in the two-dimensional matrix, where n1 represents the number of sub-scales of the identified scale, and the array element set P = {P 1 ,P 2 …P n2} represents the horizontal position of the main scale of the dial in the two-dimensional matrix, where n2 represents the number of main scales of the identified scale. In addition, the position information of the pointer needs to be stored separately, and the pointer position is recorded as M.
[0081] The incomplete scale of the present invention refers to the fact that the sub-scales in the result of semantic segmentation are missing or glued together due to the influence of factors such as poor semantic segmentation model effect, foreign body occlusion, and light.
[0082] Determine the relationship between the length of the one-dimensional array minor_scale and the number of scales on the dial in real situations. If the length of the one-dimensional array minor_scale is less than 1 / 3 of the number of scales on a normal dial, it can be considered that the minor scales on the dial are seriously incomplete and the main scale reading method should be considered for reading. Determine the relationship between the length of the one-dimensional array major_scale and the number of major scales on the main dial. If the length of the one-dimensional array major_scale is equal to the number of major scales on the main dial, it can be considered that the major scales on the dial are not incomplete and the dial can be read only by the major scales.
[0083] Determine the relationship between the length of the one-dimensional array minor_scale and the number of minor scales on the dial in real situations. If the length of the one-dimensional array minor_scale is less than 1 / 3 of the number of scales on the normal dial, it can be considered that the minor scales on the dial are seriously incomplete, and the main scale reading method should be considered for reading. Further determine the relationship between the length of the one-dimensional array major_scale and the number of major scales in the main dial. If the length of the one-dimensional array major_scale is not equal to the number of major scales in the main dial, it can be considered that the major scales on the dial are incomplete, and the pointer logarithm is performed by completing the main scale.
[0084] Determine the relationship between the array length of the one-dimensional array minor_scale and the number of scales on the dial in real conditions. If the array length of the one-dimensional array minor_scale is less than the number of scales on the dial in real conditions and greater than 1 / 3 of the number of scales on the normal dial, it can be considered that the minor scale of the dial is partially incomplete and the minor scale can be used directly for reading.
[0085] If the initial scale is incomplete, it is necessary to complete the initial scale.
[0086] Step A1: Reading in the main scale mode: Determine the position relationship between the pointer and the main scale, and calculate the average value μ of the interval between the main scales. 1 and pointer position to achieve pointer reading.
[0087] The average value between scales is calculated through the initial scale position, pointer position, and the number of scales, and the pointer reading is calculated and completed when the secondary scale is incomplete but the main scale is not incomplete.
[0088] For the problem that the main scale is complete but the secondary scale is incomplete, the pointer reading is mainly achieved by judging the position relationship between the pointer and the main scale.
[0089] When reading in major scale mode, first traverse the linear array major_scale. If the pointer does not fall into the current adjacent scale interval, increase the number of major scales before the pointer by 1, and add the accumulated sum to get the number of major scale roots W before the pointer. 1 , and determine the main scale position set P = {P 1 ,P 2 …P n1}, the distance set between main scales can be further obtained by the position difference between adjacent main scales L = {L 1 ,L 2 …L n1-1}, (e.g. L i =P i -P i-1 , where P i is the next main scale position, P i-1is the current main scale position), where the main scale root number minus 1 is multiplied by the division value b represented by the adjacent scale interval 1 , you can calculate the complete scale reading m before the pointer 1 The calculation process is shown in formula (2).
[0090] m 1 =(W 1 -1)×b 1 Formula (2)
[0091] If the pointer position coincides with the main scale, then m 1 This is the final mark reading; if the pointer falls into the position where it falls, i-1 The scale and P i The scale interval can be calculated based on the distance between the pointer position and the previous main scale of the pointer, and the mean value of the interval between the main scales μ 1 The accurate reading is obtained by calculation, and the calculation process is shown in formula (3).
[0092]
[0093] Among them, m 1 is the full scale reading before the pointer, M is the pointer position, b 1 The graduation value represented by the main scale is b 1 , m 2 This is the final pointer reading.
[0094] Step B1: Complete the incomplete main scale for reading: Compensate the pointer position by the number of missing scale roots in the incomplete area of the main scale, recalculate the average distance between the main scales, and realize pointer reading.
[0095] The average value between scales is calculated through the initial scale position, pointer position, and the number of scales, and the readings of the completely incomplete secondary scale and partially incomplete main scale are further calculated and completed.
[0096] The complete incompleteness of the secondary scale in the present invention refers to the fact that the secondary scale is missing or glued together in the result of semantic segmentation due to the influence of factors such as poor semantic segmentation model effect, foreign body occlusion, and light. In the case where the secondary scale is completely incomplete and the main scale is partially incomplete, the pointer reading is mainly achieved by completing the incomplete main scale.
[0097] When completing the reading of the incomplete main scale, you first need to determine the length of the incomplete interval of the main scale. If the pointer does not fall into the current adjacent scale interval, increase the number of main scales before the pointer by 1, and add the accumulated sum to get the number of main scale roots before the pointer W. 1 , and determine the position set P of each main scale in the two-dimensional matrix = {P 1 ,P 2 …Pn1}, pointer position M, the distance set between main scales can be obtained by the position difference of adjacent main scales L = {L 1 ,L 2 …L n1-1}, (e.g. L i =P i -P i-1 , where P i is the next main scale position, P i-1 is the current main scale position), so the average distance between the initial main scale and the pointer interval can be calculated. 1 , variance S 2 And standard deviation σ, then remove the main scale roots k outside the main scale interval standard deviation value, the main scale roots n1-k within the main scale interval standard deviation value, and obtain the incomplete interval scale distance set Y = {Y 1 ,Y 2 …Y k-1}, the normal main scale distance set Z = {Z 1 ,Z 2 …Z n1-k-1}Recalculate the mean μ 2 The calculation process is shown in formula (4).
[0098]
[0099] The reason for calculating the mean is that the mean is different under different shooting distances and angles, and the mean is calculated for the first time under the current shooting distance and angle.
[0100] Furthermore, the final main scale mean value in formula (4) can be used to check the incomplete spacing of each main scale, and the main scale distance set Y = {Y 1 ,Y 2 …Y k-1} and the mean, respectively calculate the number of main scale distances missing in the main scale incomplete area N = {N 1 ,N 2 …N k-1}, plus the number of major scale roots W traversed in the previous period 1 , and multiply it by the graduation value b represented by each main scale 1 , you can calculate the complete scale reading m before the pointer 1 The calculation process is shown in formula (5).
[0101]
[0102] If the pointer position coincides with the main scale, then the scale reading is m. 1 This is the final mark reading; if the pointer falls into position P i-1The scale and P i When the pointer falls into a scale interval or the pointer falls into a defective area, it is necessary to further determine a more accurate dial reading. The accurate reading can be calculated based on the distance between the pointer and the main scale before the pointer and the average value of the main scale. The calculation process is shown in formula (6).
[0103]
[0104] Among them, m 1 The final pointer reading is the reading of the complete scale before the pointer position, plus the reading represented by the distance between the pointer and the previous main scale.
[0105] Step C1: Completing the secondary scale for pointer reading: Compensating the pointer position by the number of missing scale roots in the incomplete area of the secondary scale, recalculating the average distance between the main scales, and realizing pointer reading.
[0106] If the secondary scale is partially incomplete, there is no need to consider whether the main scale is incomplete. The pointer reading can be achieved by simply completing the secondary scale.
[0107] When completing the incomplete minor scale reading, the calculation method is the same as the above calculation method when the main scale is partially incomplete. First, it is necessary to determine the length of the incomplete interval of the minor scale, and then traverse the linear array minor_scale and accumulate and sum to get the current minor scale root number W. 2 , and determine the set of each scale position Q = {Q 1 ,Q 2 …Q n2}, pointer position M, the distance set between sub-scales can be further obtained by the position difference of adjacent sub-scales L = {L 1 ,L 2 …L n2-1}, (e.g. L i =Q i -Q i-1 , where Q i is the next scale position, Q i-1 is the current sub-scale position), so the average distance between the starting sub-scale and the sub-scale of the pointer interval can be calculated 1 , variance S 2 And standard deviation σ, then remove the sub-scale roots k outside the sub-scale interval standard deviation value, the sub-scale roots n2-k within the sub-scale interval standard deviation value, and obtain the incomplete interval scale distance set Y = {Y 1 ,Y 2 …Y k-1}, the normal subscale distance set Z = {Z 1 ,Z 2 …Z n2-k-1}Recalculate the mean μ 2The calculation process is consistent with formula (4).
[0108] Furthermore, the incomplete spacing of each subscale can be checked according to the final mean value between subscales in formula (4), and the distance set between subscales in each incomplete interval Y = {Y 1 ,Y 2 …Y k-1} and the mean, and calculate the number of mean subscale distances missing in the subscale defective area. N = {N 1 ,N 2 …N k-1}, plus the number of sub-scale roots W traversed in the previous step 2 , and multiply it by the graduation value b represented by each sub-scale 2 , you can calculate the complete scale reading m before the pointer 1 The calculation process is shown in formula (7).
[0109]
[0110] If the pointer position coincides with the sub-scale, then m 1 This is the final mark reading; if the pointer falls into position Q i-1 The scale and Q i When the pointer falls into a defective area, it is necessary to further determine a more accurate dial reading. The accurate reading can be calculated based on the distance between the pointer and the previous sub-scale and the average value of the sub-scale. The calculation process is consistent with formula (8).
[0111]
[0112] Where m 1 The final pointer reading is the reading of the complete scale before the pointer position, plus the reading represented by the distance between the pointer and the previous main scale.
[0113] Step D1: Manually perform compensation marking, solve the initial scale position of the meter and store it in the database, query the data through the device number to obtain the initial scale position, and return to step six.
[0114] The pointer reading when the initial scale is incomplete is calculated and completed through the scale position and pointer position.
[0115] The picture of the meter with incomplete initial scale is as follows Fig. 9As shown, firstly, the image is processed through step three to read the basic information and scale information of the meter, and then a meter recognition program is designed to screen the meter images with incomplete initial scales. If the initial scale is incomplete, the screening results and the corresponding basic information and device number are packaged and pushed to the background manager interaction interface. The manager will compensate and mark the incomplete image in the interaction interface to obtain the marked position information. After the marking is completed, confirm to resubmit the image, use this method to process the resubmitted image, and synchronize the basic information structure of the meter to Table 1 in step two. Furthermore, the marked position information will be associated with the device number corresponding to the meter image and stored in the database, and the basic information and scale information of the read meter will also be stored in the database. At the same time, the meter image is re-transmitted into the meter recognition program, and finally the corresponding initial scale position information is obtained by searching the database according to the meter type and device number to complete the initial scale completion operation. If the initial scale is not incomplete, return to step six. The overall process is as follows Fig.10 shown.
[0116] The screening process mainly involves saving the total number of main scales of the meter into the variable temp_scale during scale extraction in step three. If it is less than the total number of main scales num_scale that the meter should have (the basic information of the meter obtained from the database), the identification result of the meter will be judged as "risky". The incomplete types of such meter images are divided into two categories. The first category is that other scales except the initial scale are incomplete. This type of incomplete image can be completed and the reading can be calculated by A1, B1 and C1 in step six; the other type is that the initial scale is incomplete. The above steps cannot complete the calculated reading, resulting in abnormal dial reading, so manual marking of the initial scale is required.
[0117] The marking process is mainly done by the manager receiving the abnormal picture in the background and believing that the initial scale is incomplete. The manager predicts the initial scale position and then uses the marking tool written in the background interface to mark the meter picture. At the same time, the program records the positions of the two vertices of the marked line segment and saves them to the array line. The processing flow is as follows Fig.11 shown.
[0118] During the recognition process, a two-dimensional integer array background_array with all zeros is further created. The length of the one-dimensional array is equal to the height of the meter image, and the length of the two-dimensional array is equal to the width of the meter image. In the background_array array, the array element through which the line from line[0] to line[1] (the default line width is 10 pixels) passes is assigned a value of 2. Then, according to the rectangularization and weighted linear compression in step 5, the linear array subscript value corresponding to the marked scale is obtained in the same way, and it is used as the position of the initial main scale.
[0119] Next, the scale position information and the device number (input after the screening step) are written into the database. The initial scale table in its structure includes the meter model and initial scale of the device number. The basic information table of the meter includes the range, number of main scales, number of sub-scales, sub-scale division values, main scale division values and center coordinates of the meter model. After the initial scale position information and the device number of the meter are successfully written into the database, the incomplete meter image is sent back to the meter recognition program, and the database is searched according to the meter type and device number to obtain the corresponding initial scale position information, and the initial main scale completion operation is completed.
[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for recognizing meter images with incomplete power pointers, characterized in that: The steps are as follows: Step 1: Use the target detection model to process the meter image to be processed and extract the dial area of the electricity meter; The target detection model in step 1 is the PPYOLOTiny model of the MobileNetV3 backbone network, and the prediction box with the highest confidence level of the dial is selected; Step 2: Identify the dial area through the meter recognition and classification model to obtain the basic parameter information of the meter; The meter recognition and classification model in step 2 is a YOLOV3 image classification deep learning model of the darknet53 backbone network. The meter recognition and classification model identifies the type of meter in the picture of the dial area, and obtains the basic parameter information of the meter according to the meter type query data structure; The data set for training the meter recognition classification model is obtained by classifying the images in the prediction box obtained by the target detection model; Step 3: Extract the main scale, sub-scale and pointer in the dial area through the semantic segmentation model; The semantic segmentation model is a Fast-SCNN model based on a fast segmentation convolutional neural network; Step 4: Expand the image containing the scale area processed in step 3 into a rectangular image; Step 5: Convert the rectangular graph into a one-dimensional array by weighted linear compression, and obtain the compressed mean to determine the position of the scale and pointer in the meter; Step 6: Compare the number of scales extracted in step 5 with the actual number of scales of the meter to determine whether the main scale and the sub-scale are incomplete. If the sub-scale is incomplete but the main scale is not, read the number using the main scale; if the sub-scale is completely incomplete but the main scale is partially incomplete, complete the incomplete main scale and read the number; if the sub-scale is partially incomplete, complete the sub-scale and read the number using the pointer; If the initial scale is incomplete, manually make compensation marks and re-determine whether the main scale and sub-scale are incomplete.
2. The meter image recognition method for incomplete power pointer according to claim 1 is characterized in that: The method for preparing the training data set of the target detection model is: collecting meter sample images, and using labelme annotation software to annotate the dial area; the method for preparing the training data set of the semantic segmentation model is: adjusting the classified meter image to a fixed size of 1024*1024, and using labelme annotation software to annotate the main scale and the secondary scale in the dial area respectively, with the scale annotated in line format and the pointer annotated in polygon format. After the annotation is completed, a corresponding json file is generated, and then the json file is converted into a corresponding SEG image.
3. The meter image recognition method for incomplete power pointer according to claim 2 is characterized in that: The data structure represents the range, graduation value, unit and center position of the meter; the label of the main scale is set to maxScale, the label of the secondary scale is set to scale, the value of the array element of the area marked as the main scale is set to 1, the value of the array element of the area marked as the secondary scale is set to 2, the value of the array element of the pointer area is set to 3, and other areas are background array elements with values set to 0.
4. The meter image recognition method for incomplete power pointer according to claim 1 or 3, characterized in that: The rectangular diagram in step four is a two-dimensional matrix, and the radius of the dial is the number of rows of the two-dimensional matrix, and the circumference of the dial is the number of columns of the two-dimensional matrix; the first center positioning result is stored in the data structure, and subsequent dials of the same type obtain the parameter information of the dial by looking up the table to find the center of the dial to obtain the center position.
5. The meter image recognition method for incomplete power pointer according to claim 4 is characterized in that: The dial radius is calculated as follows: extract key points from a picture containing the dial scale area obtained by the semantic segmentation model, find three key points, establish a coordinate system with the lower left corner of the picture as the origin, take the minimum x-coordinate point, the maximum x-coordinate point and the minimum y-axis coordinate point as three key points, connect adjacent key points, and the intersection of the perpendicular bisectors of the connecting lines is the center of the dial; calculate the distance from the center of the circle by traversing the information table storing the position of each element point, and take the average as the dial radius; the circumference of the dial is 2*π*dial radius; The method for looking up the table to find the center of the dial is as follows: two arrays are established: Key is a one-dimensional array of strings to store the meter name, and value is a one-dimensional array of a custom class to store the meter information, wherein the custom class includes the meter range, the number of sub-scales, the number of main scales, the sub-scale division values, the main scale division values and the coordinates of the center of the circle; the meter name is converted into a keyword Key through an ASCII code, the keyword Key is calculated by the division and remainder method in a hash table to obtain the address name corresponding to the meter, and the center position is stored in the address unit using the address name; After the meter classification model identifies the type of electricity meter in the current image, it returns a number. The meter name corresponding to the current meter is obtained through the string in the custom class corresponding to the number. Then, the information of the center position of the current dial is obtained according to the meter name. The actual center position is calculated through the stored center position and the deviation value of the collected meter image relative to the stored information.
6. The meter image recognition method for incomplete power pointer according to claim 5 is characterized in that: The rectangularization method is as follows: the dial is determined according to the dial center and the dial radius, and the dial is traversed from the outermost periphery of the dial, and an arc scan is performed from the outer periphery. When the outer arc scan is completed, the inner ring is progressively scanned layer by layer until the inner circle without a pointer is scanned. During the arc scanning process, the coordinates of the pixel points inside the arc are converted into rectangles according to the polar coordinates. The conversion formula is: Among them, x and y are the horizontal and vertical coordinates in the rectangular diagram respectively, the traversal starts from the negative direction of the y-axis, r is the distance between each scale element point and the center of the circle obtained in the processed circular dial image containing the scale area, and theta is the angle between the position of each pixel point in the circular dial image and the center of the circle and the negative direction of the y-axis; The weighted linear compression is a top-down linear compression, and the implementation method is as follows: by traversing the two-dimensional matrix of the rectangular graph, setting weights according to the position of each row element in the two-dimensional matrix, setting different weights from the top layer downwards, and setting weights that decrease from top to bottom according to the height of each row; in the process of traversing from the upper layer to the lower layer, increasing the weight of each layer from low to high according to different layers, multiplying the elements of each layer with the weight of the layer, and adding the sum to the list to form a one-dimensional list set; traversing the list set, filtering the data in the list set to find the peak point, calculating the mean value within the interval range of the scale operation of each peak, that is, the scale point and pointer point to be found, storing the sum of the weights of the scale position and the pointer position in the one-dimensional list, and the pixel point represented by the maximum value of the scale compression and pointer compression in the list is the final position.
7. The method for recognizing a meter image with a defective power pointer according to claim 1, 2 or 6, characterized in that: The position information of the minor scale in the dial is stored in the one-dimensional array minor_scale, and the position information of the major scale is stored in the one-dimensional array major_scale. The array element set Q in the one-dimensional array minor_scale is {Q1, Q2…Q n1 } represents the horizontal position of the minor scale in the two-dimensional matrix, n1 represents the number of minor scales identified, and the one-dimensional array major_scale array element set P = {P1, P2…P n2 } represents the horizontal position of the main scale of the dial in the two-dimensional matrix, and n2 represents the number of main scales of the identified scale; The pointer position M is stored separately; Determine the relationship between the array length of the one-dimensional array minor_scale and the number of scales on the dial in the actual situation. If the array length of the one-dimensional array minor_scale is less than 1 / 3 of the number of scales on the normal dial, it is considered that the minor scales on the dial are seriously incomplete. Determine the relationship between the length of the one-dimensional array major_scale and the number of major scales in the main dial. If the length of the one-dimensional array major_scale is equal to the number of major scales in the main dial, it is considered that the major scales in the dial are not incomplete. If the length of the one-dimensional array major_scale is not equal to the number of major scales in the main dial, it is considered that the major scales in the dial are incomplete. If the array length of the one-dimensional array minor_scale is less than the number of scales on the dial in the actual situation and greater than 1 / 3 of the number of scales on the normal dial, it is considered that the minor scales on the dial are partially incomplete.
8. The meter image recognition method for incomplete power pointer according to claim 7 is characterized in that: When reading in the main scale mode, the position relationship between the pointer and the main scale is determined, and the pointer reading is realized according to the average value of the interval between the main scales and the pointer position; the realization method is: Traverse the linear array major_scale. If the pointer does not fall into the current adjacent scale interval, the number of major scales before the pointer increases by 1. The cumulative sum is used to obtain the number of major scale roots W1 before the pointer. The major scale position set P = {P1, P2…P n1 }, through the position difference L of adjacent main scales i =P i -P i-1 Get the main scale distance set L = {L1, L2...L n1-1 }, use the main scale root number minus 1 and then multiply it by the division value b1 represented by the adjacent scale interval to calculate the complete scale indication before the pointer m1 = (W1-1) × b1; Among them, P i is the next main scale position, P i-1 is the current main scale position; If the pointer position coincides with the main scale, then m1 is the final mark reading; If the pointer falls into the position where it falls into P i-1 The scale and P i The precision reading can be calculated based on the distance between the pointer position and the main scale before the pointer and the average of the intervals between the main scales: Among them, M is the pointer position, b1 is the division value represented by the main scale, and m2 is the final pointer reading.
9. The meter image recognition method for incomplete power pointer according to claim 7 is characterized in that: When the incomplete main scale is completed for reading, the pointer position is compensated by the number of scale roots missing in the incomplete area of the main scale, and the average distance between the main scales is recalculated to realize the pointer reading; the implementation method is: Determine the length of the incomplete interval of the main scale. If the pointer does not fall into the current adjacent scale interval, increase the number of main scales before the pointer by 1, and add the accumulated sum to get the number of main scale roots W1 before the pointer. Determine the position set P of each main scale in the two-dimensional matrix = {P1, P2…P n1 }, and obtain the distance set between main scales L = {L1, L2…L n1-1 }, calculate the average distance between the initial main scale and the main scale of the pointer interval variance and standard deviation Eliminate the number of main scale roots k outside the main scale interval standard deviation value, the number of main scale roots n1-k within the main scale interval standard deviation value, and obtain the incomplete interval scale distance set Y = {Y1, Y2…Y k-1 }, the normal main scale distance set Z = {Z1, Z2…Z n1-k-1 }Recalculate the final main scale mean According to the final mean value between main scales, the incomplete spacing of each main scale is checked, and the distance set between main scales in each incomplete interval is Y = {Y1, Y2…Y k-1 } and the mean, and calculate the number of main scale distances missing in the main scale incomplete area. N={N1,N2…N k-1 }, plus the previous traversal of the main scale root number W1, and multiply by the division value b1 represented by each main scale, the complete scale indication before the pointer can be calculated m1 = (W1-1+N) × b1, where, If the pointer position coincides with the main scale, then the scale indication m1 is the final mark reading; If the pointer falls into position P i-1 The scale and P i When the pointer falls into the incomplete area, the more accurate dial reading is further determined, and the accurate reading is calculated based on the distance between the pointer and the main scale before the pointer and the average value of the main scale. Among them, m1 is the complete scale reading before the pointer position.
10. The meter image recognition method for incomplete power pointer according to claim 9 is characterized in that: The method of completing the secondary scale for pointer reading is to compensate the pointer position by the number of scale roots missing in the incomplete area of the secondary scale, and recalculate the average distance between the main scales to realize the pointer reading. The implementation method is: Determine the length of the incomplete interval of the minor scale, traverse the linear array minor_scale, accumulate and sum to get the current minor scale root number W2, and determine the position set of each minor scale Q = {Q1, Q2…Q n2 }, through the position difference L of adjacent sub-scales i =Q i -Q i-1 Get the distance set between subscales L = {L1, L2…L n2-1 }, calculate the mean μ1 and variance S of the distance between the starting subscale and the pointer interval 2 Then remove the subscale roots k that are beyond the subscale interval standard deviation value and the subscale roots n2-k that are within the subscale interval standard deviation value, and obtain the incomplete interval scale distance set Y = {Y1,Y2…Y k-1 }, the normal sub-scale distance set Z = {Z1, Z2…Z n2-k-1 }Recalculate the final subscale mean μ2; According to the final mean value between sub-scales, the incomplete spacing of each sub-scale is checked, and the distance set between sub-scales of each incomplete interval is Y = {Y1, Y2…Y k-1 } and the mean, and calculate the number of mean subscale distances missing in the subscale defective area. Set N = {N1, N2…N k-1 }, plus the previous traversal of the sub-scale root number W2, and multiply by the division value b2 represented by each sub-scale, the complete scale indication before the pointer can be calculated m1 = (W2-1+N) × b2, where, If the pointer position coincides with the sub-scale, then m1 is the final mark reading; If the pointer falls into position Q i-1 The scale and Q i When the pointer falls into the incomplete area, the more accurate dial reading is further determined, and the accurate reading is calculated based on the distance between the pointer and the previous sub-scale and the average value of the sub-scale: Among them, m1 is the complete scale reading before the pointer position; When manually performing compensation marking, the position of the initial scale of the meter is solved and stored in the database, and the position of the initial scale is obtained by querying the data through the device number. The implementation method is: Design a meter recognition program to screen meter images with incomplete initial scales. If the initial scale is incomplete, package the screening results and their corresponding basic information and device number and push them to the backend management personnel interaction interface. The management personnel will mark the incomplete images in the interaction interface to obtain the marked position information. After the marking is completed, confirm to resubmit the image, synchronize the meter basic information structure to the data structure, associate the marked position information with the device number corresponding to the meter image and store it in the database, and the read basic information and scale information of the meter are also stored in the database; at the same time, re-transmit the meter image into the meter recognition program, and finally query the database according to the meter type and device number to obtain its corresponding initial scale position information, and complete the initial scale completion operation; The compensation mark is as follows: after the manager receives the abnormal image in the background and believes that the initial scale is incomplete, the manager predicts the initial scale position, and then uses the marking tool to mark the meter image. At the same time, the program records the positions of the two vertices of the marked line segment and saves them to the array line; a two-dimensional integer array background_array of all zeros is created, and the length of the one dimension of the array is equal to the height of the meter image, and the length of the two dimensions is equal to the width of the meter image; in the background_array array, the array element through which the line from line[0] to line[1] passes is assigned a value of 2, and then the linear array subscript value corresponding to the marked scale is obtained according to the rectangularization and weighted linear compression processing, and it is used as the position of the initial main scale; the position of the initial main scale and the device number are written into the database. After the initial scale position information and the device number of the meter are successfully written into the database, the incomplete meter image is returned to the meter recognition program, and the database is searched according to the meter type and device number to obtain the corresponding initial scale position information, and the initial main scale completion operation is completed.
Citation Information
Patent Citations
Training method and device of automatic identification device of pointer instrument with numbers in natural scene
AU2020103716A4
Electric meter value identification method based on residual network
CN109635806A