Electric energy meter character recognition method and system
The maximum stable extreme value area algorithm and Transformer model recognize the character image of the electricity meter, which solves the problem of accuracy and low efficiency of the traditional electricity meter bottom entry, and realizes automatic data entry, which significantly improves accuracy and efficiency.
Patent Information
- Application Number
- CN202411176744.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-31
AI Technical Summary
The basic input of traditional electricity meters relies on manual operations, resulting in low accuracy and efficiency of data entry, especially in large-scale electricity meter replacement operations and easy to produce errors.
The maximum stable extreme value area algorithm and Transformer model are used to preprocess the character image of the power meter, extract and segment the target character area, and identify it based on the pre-trained Transformer model to realize the automated data entry process, reduce the workload of manual entry and improve the Accuracy and efficiency.
Through the automated data entry process, the accuracy and efficiency of power meter data entry are improved, error correction and time costs are reduced, accuracy is improved by 14%, and processing time is reduced by 3.5 times, which is significantly higher than traditional OCR methods and manual entry. promote.
Smart Images

Figure CN119229426A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power metering, and in particular to an electric energy meter character recognition method and system. Background Art
[0002] In the field of electricity metering, the basic data entry of the energy meter is a key step to ensure accurate calculation of the user's electricity consumption. Traditional energy meter basic data entry mainly relies on manual operation. The staff needs to read the dismantled energy meter on site and manually enter the reading into the marketing system. However, in large-scale energy meter replacement operations, manual data entry is very time-consuming and prone to errors, resulting in low accuracy and efficiency of data entry. Summary of the invention
[0003] The embodiment of the present invention provides an electric energy meter character recognition method to solve the problems of low accuracy and efficiency of data entry in the prior art.
[0004] In a first aspect, an embodiment of the present invention provides an electric energy meter character recognition method, comprising:
[0005] Preprocessing the image to be recorded containing electric energy meter characters;
[0006] Extracting the target character region from the preprocessed image to be recorded using a maximum stable extremum region algorithm;
[0007] Segmenting the target character region to obtain a plurality of single-character image regions;
[0008] All the single-character image regions are identified based on a pre-trained Transformer model to obtain a character recognition result of the image to be input.
[0009] Furthermore, the preprocessing of the image to be recorded containing the electric energy meter characters includes:
[0010] Obtaining an image to be recorded containing electric energy meter characters;
[0011] The image to be recorded is subjected to noise reduction processing to obtain a noise-reduced image.
[0012] Furthermore, the extracting the target character region from the preprocessed image to be recorded by using the maximum stable extremum region algorithm includes:
[0013] Converting the preprocessed image to be recorded into a grayscale image;
[0014] Using a maximum stable extremum region algorithm to perform threshold processing on the grayscale image to obtain a number of binary images;
[0015] Calculating the change rate of each connected region in all the binary images, and determining the initial character region according to the change rate;
[0016] The Merge-NMS method is used to remove duplicates from the initial character region to obtain a target character region.
[0017] Furthermore, the target character region is segmented to obtain a plurality of single-character image regions, including:
[0018] A pixel density histogram of the target character area along the horizontal direction is calculated using a vertical projection method;
[0019] Dividing the target character area into a plurality of character sub-areas according to the pixel density histogram;
[0020] Calculating a difference histogram of each character sub-region along the vertical direction by using a difference projection method;
[0021] All single-character image regions of each character sub-region are obtained according to the difference histogram.
[0022] Furthermore, the pre-trained Transformer model is used to identify all the single-character image regions to obtain the character recognition result of the image to be input, including:
[0023] Convert each of the single-character image regions into a feature vector, and input all of the feature vectors into a pre-trained Transformer model;
[0024] Outputting the probability distribution of each single character image region, and selecting the category with the highest probability as the character prediction result;
[0025] According to the character prediction results of all the single-character image areas, the character recognition result of the image to be input is obtained.
[0026] Furthermore, the method further comprises:
[0027] Obtaining historical data; wherein the historical data includes the number of the electric energy meter, the electric energy meter reading and date;
[0028] Based on the electric energy meter number, calculating the difference between the character recognition result of each electric energy meter and the electric energy meter bottom value in the historical bottom value data;
[0029] When the difference is greater than a preset difference threshold, the verification result of the character recognition result is determined to be a recognition error; when the difference is less than or equal to the difference threshold, the verification result of the character recognition result is determined to be a recognition correct.
[0030] Furthermore, each of the character recognition results has a corresponding confidence level. Then, after determining that the verification result of the character recognition result is a recognition error, the method further includes:
[0031] The confidence level of the character recognition result that is a verification result indicating a recognition error is changed, and the image to be input is re-recognized until the verification result of the character recognition result indicates that the recognition is correct.
[0032] In a second aspect, an embodiment of the present invention provides an electric energy meter character recognition system, comprising:
[0033] A preprocessing module, used for preprocessing the image to be recorded containing the electric energy meter characters;
[0034] A character region extraction module, used for extracting a target character region from the pre-processed image to be recorded by using a maximum stable extremum region algorithm;
[0035] A character region division module, used for segmenting the target character region to obtain a plurality of single-character image regions;
[0036] The character recognition module is used to recognize all the single-character image areas based on a pre-trained Transformer model to obtain the character recognition result of the image to be input.
[0037] Furthermore, the preprocessing module is also used for:
[0038] Obtaining an image to be recorded containing electric energy meter characters;
[0039] The image to be recorded is subjected to noise reduction processing to obtain a noise-reduced image.
[0040] Furthermore, the character region extraction module is also used for:
[0041] Converting the preprocessed image to be recorded into a grayscale image;
[0042] Using a maximum stable extremum region algorithm to perform threshold processing on the grayscale image to obtain a number of binary images;
[0043] Calculating the change rate of each connected region in all the binary images, and determining the initial character region according to the change rate;
[0044] The Merge-NMS method is used to remove duplicates from the initial character region to obtain a target character region.
[0045] Compared with the prior art, an electric energy meter character recognition method provided by an embodiment of the present invention has the following beneficial effects: by preprocessing an image to be recorded containing electric energy meter characters; extracting a target character area from the preprocessed image to be recorded using a maximum stable extremum region algorithm; segmenting the target character area to obtain a plurality of single-character image areas; identifying all the single-character image areas based on a pre-trained Transformer model to obtain a character recognition result of the image to be recorded; the automated data entry process facilitates data management and query, reduces the workload of manual entry, reduces error correction and time costs, and thus improves the accuracy and efficiency of data entry. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical features of the embodiments of the present invention, the drawings required for use in the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0047] Figure 1 It is a flow chart of an embodiment of a method for character recognition of an electric energy meter provided by the present invention;
[0048] Figure 2 The present invention is a schematic structural diagram of an embodiment of an electric energy meter character recognition system provided by the present invention. DETAILED DESCRIPTION
[0049] 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.
[0050] In a first aspect, an embodiment of the present invention provides a method for recognizing characters in an electric energy meter, see Figure 1 , which is a flow chart of an embodiment of an electric energy meter character recognition method provided by the present invention.
[0051] like Figure 1 As shown, the method comprises the following steps:
[0052] S1: pre-processing the image to be recorded containing the electric energy meter characters;
[0053] S2: extracting a target character region from the preprocessed image to be recorded using a maximum stable extremum region algorithm;
[0054] S3: Segmenting the target character region to obtain a plurality of single-character image regions;
[0055] S4: Recognize all the single-character image regions based on the pre-trained Transformer model to obtain the character recognition result of the image to be input.
[0056] In the specific implementation, first, an image to be recorded containing electric energy meter characters is obtained, and the image to be recorded is preprocessed. The preprocessing operation is aimed at improving the image quality. Then, the maximum stable extreme region algorithm is used to extract the target character area of the electric energy meter from the preprocessed image to be recorded, and the target character area is segmented to obtain multiple single-character image areas. All the single-character image areas are identified based on the pre-trained Transformer model to obtain the table number and bottom information of the electric energy meter, and finally the character recognition result of the image to be recorded is obtained.
[0057] In summary, the present invention preprocesses the image to be recorded containing the electric energy meter characters; uses the maximum stable extreme region algorithm to extract the target character area from the preprocessed image to be recorded; divides the target character area to obtain a plurality of single-character image areas; recognizes all the single-character image areas based on a pre-trained Transformer model to obtain the character recognition result of the image to be recorded; the automated data entry process facilitates data management and query, reduces the workload of manual entry, reduces error correction and time costs, and thus improves the accuracy and efficiency of data entry.
[0058] In an optional implementation manner, the preprocessing of the image to be recorded containing the electric energy meter characters includes:
[0059] Obtaining an image to be recorded containing electric energy meter characters;
[0060] The image to be recorded is subjected to noise reduction processing to obtain a noise-reduced image.
[0061] Specifically, first, the image to be recorded containing the electricity meter characters is obtained. The image can be obtained from a variety of sources, such as shooting with a high-definition camera, scanning with professional scanning equipment, or image files in an existing database. These images then enter the image preprocessing stage and perform noise reduction on the image to be recorded. The noise reduction process aims to improve the image quality and effectively remove noise points in the image while keeping the edges clear. The noise reduction technology can use algorithms such as average filtering, Gaussian blur, median blur or bilateral filtering. After processing, the denoised image is obtained, which provides a better foundation for subsequent tasks such as character recognition.
[0062] In an optional implementation, the extracting the target character region from the preprocessed image to be recorded by using the maximum stable extremum region algorithm includes:
[0063] Converting the preprocessed image to be recorded into a grayscale image;
[0064] Using a maximum stable extremum region algorithm to perform threshold processing on the grayscale image to obtain a number of binary images;
[0065] Calculating the change rate of each connected region in all the binary images, and determining the initial character region according to the change rate;
[0066] The Merge-NMS method is used to remove duplicates from the initial character region to obtain a target character region.
[0067] Specifically, the maximum stable extreme region algorithm is a region detection algorithm based on grayscale threshold change. It binarizes the image at different grayscale thresholds and finds the region with the smallest change in these binary images. First, the preprocessed image to be input is converted into a grayscale image. The algorithm performs threshold processing on the grayscale image. The threshold increases from 0 to 255 in sequence to obtain a series of binary images. Each image corresponds to a different grayscale threshold. For each connected region, that is, each possible character region, its change rate in all binary images is calculated. The calculation formula is as follows:
[0068]
[0069] Among them, q i is the rate of change, Q i represents a connected area when the threshold is i, Q i+Δ Represents a connected area when the threshold is i+Δ.
[0070] It can be understood that the change rate represents the relative proportion of the change in the area of the connected region under adjacent thresholds. The connected region that does not show obvious changes under different thresholds is defined as the maximum stable extreme value region. When the change rate q i When it is a local minimum, the corresponding Q iThe maximum stable extreme value region is taken as the initial character region, and the Merge-NMS (Merge-Non-Maximum Suppression) method is used to deduplicate the initial character region. The Merge-NMS method is used to merge overlapping or close initial character regions and remove redundant regions. First, a set of non-overlapping bounding boxes are selected as candidate boxes using the traditional NMS. For each candidate box, if it has a large overlap with other unselected bounding boxes, the information of these overlapping bounding boxes is merged into the candidate box instead of simply deleting these overlapping bounding boxes. Through the above merging strategy, the problem of inaccurate target positioning caused by the traditional NMS can be alleviated to a certain extent, especially in scenes with dense targets or severe occlusion. Merge-NMS can provide more stable and accurate detection results. After the merging operation of Merge-NMS, the target character region of the image to be recorded is obtained.
[0071] In an optional implementation, segmenting the target character region to obtain a plurality of single-character image regions includes:
[0072] A pixel density histogram of the target character area along the horizontal direction is calculated using a vertical projection method;
[0073] Dividing the target character area into a plurality of character sub-areas according to the pixel density histogram;
[0074] Calculating a difference histogram of each character sub-region along the vertical direction by using a difference projection method;
[0075] All single-character image regions of each character sub-region are obtained according to the difference histogram.
[0076] Specifically, after obtaining the target character area of the image to be entered, the extracted target character area is preliminarily segmented by the vertical projection method, and further accurately segmented into multiple single-character image areas in combination with the difference projection method, in preparation for subsequent character recognition.
[0077] First, traverse each column of the target character area, calculate the distance from the top pixel in each column to the bottom of the image or the coordinates of the top pixel, which represents the pixel density of the column in the vertical direction, and obtain the pixel density histogram of the target character area along the horizontal direction. According to the pixel density histogram, the blank area between characters is automatically identified in the area where the pixel density drops sharply, so as to obtain a number of character sub-areas. The vertical projection method is based on a statistical method and can adapt to different character spacing and arrangements. It can effectively segment even when the character spacing is uneven or slightly tilted. Compared with the segmentation method with a fixed threshold, it is more flexible and accurate. Furthermore, the pixel points of each column in the image are processed to obtain the coordinates of the top pixel point and the bottom pixel point of each column, and the difference between the two is used as the pixel difference of each column. According to these differences, the difference histogram of all columns is obtained. Through all the difference histograms, the boundaries of characters or elements can be accurately determined, and the character sub-areas can be further subdivided into single-character image areas.
[0078] For example, the vertical projection method is first used to project the vector Q 1 (y) Calculate the initial segmentation range and further use the difference projection method to obtain the reverse projection vector Q 2 (y) to accurately determine the boundary of a character or element. The difference calculation formula is as follows:
[0079]
[0080] Among them, D Q (y) is the difference between the two projection vectors, that is, the difference vector between the upper and lower projections, I 1 (x, y) is the vertical coordinate detected by the vertical projection method, I 2 (x, y) is the vertical coordinate detected by the difference projection method, and W is the width of the image.
[0081] Compared with the traditional vertical projection method, the above steps improve the accuracy of segmentation, and greatly improve the processing speed compared with the method of identifying and judging character boundaries one by one. At the same time, the stability of the algorithm is more obvious in large-scale data processing, reducing the chain reaction of subsequent processing caused by recognition errors. For situations where the bottom display of the electricity meter is complex, the ambient light is uneven or blocked, it can still handle the distinction between characters well, ensuring that single character information can still be accurately extracted in complex scenes, thereby enhancing the robustness of the system.
[0082] In an optional implementation, the identifying of all the single-character image regions based on the pre-trained Transformer model to obtain the character recognition result of the image to be input includes:
[0083] Convert each of the single-character image regions into a feature vector, and input all of the feature vectors into a pre-trained Transformer model;
[0084] Outputting the probability distribution of each single character image region, and selecting the category with the highest probability as the character prediction result;
[0085] According to the character prediction results of all the single-character image areas, the character recognition result of the image to be input is obtained.
[0086] Specifically, the image to be recorded of the bottom of the electric energy meter is divided into multiple patches of fixed size, which includes the single character image area divided as above. The image to be recorded can also be directly divided into blocks of fixed size. For each patch, a linear layer is used to map it from the original pixel space to a high-dimensional feature space through linear embedding, that is, it is converted into a high-dimensional feature vector, and the image data is converted into a format suitable for Transformer processing. The feature vector is used as the input of the Transformer. Since the Transformer model itself does not directly understand the order of elements in the sequence, it is necessary to add encoding to retain the position information of the patch in the image. The encoding is usually fixed and pre-calculated. The model extracts the features of the encoded vector through multiple layers of self-attention and feedforward networks to capture dependencies and learn high-level feature representations of characters. In the input sequence of the Transformer, a special classification token can be added to receive summary information of the entire sequence. The output of the Transformer is converted into a probability distribution through a softmax layer, indicating the character category that each patch is most likely to represent. For each patch, the category with the highest probability is selected as the prediction result. According to the prediction result of the patch, the character recognition result of the entire image to be recorded can be reconstructed.
[0087] The above steps take advantage of Transformer's advantages in parallel processing and long-distance dependency analysis, which can more efficiently understand and recognize complex contextual relationships between characters, especially for connected characters or electricity meter bottom images with unique arrangements. By training this model on a large-scale annotated character dataset, it can obtain stronger generalization ability and higher recognition accuracy than the original model, especially when dealing with diverse font styles and complex backgrounds. In addition, the Transformer structure is also convenient for parallel computing, which further improves the recognition speed and improves the efficiency of the overall system while ensuring accuracy.
[0088] In an optional embodiment, the method further includes:
[0089] Obtaining historical data; wherein the historical data includes the number of the electric energy meter, the electric energy meter reading and date;
[0090] Based on the electric energy meter number, calculating the difference between the character recognition result of each electric energy meter and the electric energy meter bottom value in the historical bottom value data;
[0091] When the difference is greater than a preset difference threshold, the verification result of the character recognition result is determined to be a recognition error; when the difference is less than or equal to the difference threshold, the verification result of the character recognition result is determined to be a recognition correct.
[0092] Specifically, the character recognition results are verified using a historical base matching verification model based on cloud data acquisition, which plays a role in strengthening the learning effect and improving the input accuracy. The verification model obtains the historical base data of the electric energy meter of the data center or real-time measurement center, including the electric energy meter number, electric energy meter base and date. The electric energy meter number is used as the association, and the associated character recognition result is compared with the historical base data. The recognition result is verified using the time distribution law that the base is positively correlated with the time advancement and the increased electric energy in each re-disassembly cycle does not exceed the preset allowable range. The difference between the character recognition result of each electric energy meter and the electric energy meter base in the historical base data is calculated. When the difference is greater than the preset difference threshold, the verification result of the character recognition result is determined to be a recognition error. When the difference is less than or equal to the difference threshold, the verification result of the character recognition result is determined to be a correct recognition. The constraint conditions for determining correct verification are as follows:
[0093]
[0094] Among them, Ph id is the historical base of table number id, Pr id is the character recognition result of table number id, P max It is the preset difference threshold, that is, the maximum value that the meter reading can increase in a removal cycle.
[0095] It can be understood that in the electricity meter number, its numbers and letters only appear in a specific order and position. This rule is used to establish a meter number filling template, in which possible matching characters correspond to unmatched characters. When a field in the meter number does not match, the field in the template can be used to replace it. When the historical base data and character recognition results are associated with the electricity meter number, the meter number matching may fail. When the matching fails, the result of "meter number recognition error" is returned, and the meter number is filled according to the meter number filling template. When the meter number matches successfully, if the base verification fails, the result of "meter number recognition correct, base verification error" is returned. If the base verification succeeds, the result of "meter number recognition correct, base verification correct" is returned.
[0096] In an optional implementation, each of the character recognition results has a corresponding confidence level, and after determining that the verification result of the character recognition result is a recognition error, the method further includes:
[0097] The confidence level of the character recognition result that is a verification result indicating a recognition error is changed, and the image to be input is re-recognized until the verification result of the character recognition result indicates that the recognition is correct.
[0098] Specifically, each of the character recognition results has a corresponding confidence level. When the verification result of the character recognition result is a recognition error, the confidence level of the character recognition result and some parameters of the model are changed, and the image to be input with the recognition error is returned to the model for re-recognition and re-verification. After the historical background matching verification model intervenes in the character recognition results, the character recognition accuracy of the present application is improved by 14% compared with the traditional OCR method.
[0099] In a second aspect, an embodiment of the present invention provides an electric energy meter character recognition system, see Figure 2 , which is a structural schematic diagram of an embodiment of an electric energy meter character recognition system provided by the present invention.
[0100] like Figure 2 As shown, the system comprises:
[0101] A preprocessing module 21 is used to preprocess the image to be recorded containing the electric energy meter characters;
[0102] A character region extraction module 22, used for extracting a target character region from the pre-processed image to be recorded by using a maximum stable extremum region algorithm;
[0103] A character region division module 23 is used to divide the target character region into multiple single character image regions;
[0104] The character recognition module 24 is used to recognize all the single-character image regions based on a pre-trained Transformer model to obtain a character recognition result of the image to be input.
[0105] In an optional implementation, the preprocessing module 21 is further used for:
[0106] Obtaining an image to be recorded containing electric energy meter characters;
[0107] The image to be recorded is subjected to noise reduction processing to obtain a noise-reduced image.
[0108] In an optional implementation, the character region extraction module 22 is further used for:
[0109] Converting the preprocessed image to be recorded into a grayscale image;
[0110] Using a maximum stable extremum region algorithm to perform threshold processing on the grayscale image to obtain a number of binary images;
[0111] Calculating the change rate of each connected region in all the binary images, and determining the initial character region according to the change rate;
[0112] The Merge-NMS method is used to remove duplicates from the initial character region to obtain a target character region.
[0113] In an optional implementation, the character area division module 23 is further used for:
[0114] A pixel density histogram of the target character area along the horizontal direction is calculated using a vertical projection method;
[0115] Dividing the target character area into a plurality of character sub-areas according to the pixel density histogram;
[0116] Calculating a difference histogram of each character sub-region along the vertical direction by using a difference projection method;
[0117] All single-character image regions of each character sub-region are obtained according to the difference histogram.
[0118] In an optional implementation, the character recognition module 24 is further used for:
[0119] Convert each of the single-character image regions into a feature vector, and input all of the feature vectors into a pre-trained Transformer model;
[0120] Outputting the probability distribution of each single character image region, and selecting the category with the highest probability as the character prediction result;
[0121] According to the character prediction results of all the single-character image areas, the character recognition result of the image to be input is obtained.
[0122] In an optional implementation, the system further includes a verification module, wherein the verification module is used to:
[0123] Obtaining historical data; wherein the historical data includes the number of the electric energy meter, the electric energy meter reading and date;
[0124] Based on the electric energy meter number, calculating the difference between the character recognition result of each electric energy meter and the electric energy meter bottom value in the historical bottom value data;
[0125] When the difference is greater than a preset difference threshold, the verification result of the character recognition result is determined to be a recognition error; when the difference is less than or equal to the difference threshold, the verification result of the character recognition result is determined to be a recognition correct.
[0126] In an optional implementation, each of the character recognition results has a corresponding confidence level, and the verification module is further configured to:
[0127] The confidence level of the character recognition result that is a verification result indicating a recognition error is changed, and the image to be input is re-recognized until the verification result of the character recognition result indicates that the recognition is correct.
[0128] It can be understood that the electric energy meter character recognition system of the present invention can be integrated into the existing marketing system and connected to the system backend through an API interface. When a new image to be entered is uploaded, the system automatically triggers the preprocessing, character area extraction, character area division and character recognition processes. The final character recognition result is directly filled in the electric energy meter bottom input interface. At the same time, an auxiliary interface is developed to provide a manual review function. For uncertain or erroneous recognition situations, the operator can make corrections and provide feedback for model iteration optimization.
[0129] Exemplarily, in order to compare and evaluate the performance differences in accuracy and processing time between the electric energy meter character recognition method of the present invention and the traditional OCR method and the traditional character entry method, several typical areas are selected as pilot areas for technical application, and abnormal data of the bottom measurement of dismantled electric energy meters are collected. The electric energy meter character recognition method of the present invention is used for automatic processing, and compared with the manual entry results, and key performance indicators such as entry speed and accuracy are recorded. 10,000 photos of electric energy meters are randomly selected to ensure that the photo samples cover various models and usage conditions, including challenging conditions such as wear, dirt, and insufficient light. The experimental results show that the electric energy meter character recognition of the present invention shows significant advantages in both accuracy and processing time. Compared with the traditional OCR method, the accuracy is improved by nearly 14%, and the processing time is 3.5 times faster. Compared with the traditional manual entry, the accuracy is improved by nearly 27%, and the efficiency is improved by dozens of times. This not only greatly improves the accuracy and efficiency of the bottom measurement entry of electric energy meters, but also reduces the labor intensity of on-site staff, optimizes data management, and reflects the potential for wide application in smart grid management.
[0130] The above description is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. It should be pointed out that for those skilled in the art, several equivalent obvious variations and / or equivalent substitutions can be made without departing from the technical principles of the present invention. These obvious variations and / or equivalent substitutions should also be regarded as the protection scope of the present invention.
Claims
1. A method for recognizing characters in an electric energy meter, characterized in that: include: Preprocessing the image to be recorded containing electric energy meter characters; Extracting the target character region from the preprocessed image to be recorded using a maximum stable extremum region algorithm; Segmenting the target character region to obtain a plurality of single-character image regions; All the single-character image regions are identified based on a pre-trained Transformer model to obtain a character recognition result of the image to be input.
2. The method for recognizing electric energy meter characters according to claim 1, characterized in that: The preprocessing of the image to be recorded containing the electric energy meter characters comprises: Obtaining an image to be recorded containing electric energy meter characters; The image to be recorded is subjected to noise reduction processing to obtain a noise-reduced image.
3. The method for recognizing characters in an electric energy meter according to claim 1, characterized in that: The method of extracting the target character region from the preprocessed image to be recorded by using the maximum stable extremum region algorithm includes: Converting the preprocessed image to be recorded into a grayscale image; Using a maximum stable extremum region algorithm to perform threshold processing on the grayscale image to obtain a number of binary images; Calculating the change rate of each connected region in all the binary images, and determining the initial character region according to the change rate; The Merge-NMS method is used to remove duplicates from the initial character region to obtain a target character region.
4. The method for recognizing characters in an electric energy meter according to claim 1, characterized in that: The target character region is segmented to obtain a plurality of single character image regions, including: A pixel density histogram of the target character area along the horizontal direction is calculated using a vertical projection method; Dividing the target character area into a plurality of character sub-areas according to the pixel density histogram; Calculating a difference histogram of each character sub-region along the vertical direction by using a difference projection method; All single-character image regions of each character sub-region are obtained according to the difference histogram.
5. The method for recognizing characters in an electric energy meter according to claim 1, characterized in that: The method of recognizing all the single-character image regions based on the pre-trained Transformer model to obtain the character recognition result of the image to be input includes: Convert each of the single-character image regions into a feature vector, and input all of the feature vectors into a pre-trained Transformer model; Outputting the probability distribution of each single character image region, and selecting the category with the highest probability as the character prediction result; According to the character prediction results of all the single-character image areas, the character recognition result of the image to be input is obtained.
6. The method for recognizing characters in an electric energy meter according to claim 1, characterized in that: The method further comprises: Obtaining historical data; wherein the historical data includes the number of the electric energy meter, the electric energy meter reading and date; Based on the electric energy meter number, calculating the difference between the character recognition result of each electric energy meter and the electric energy meter bottom value in the historical bottom value data; When the difference is greater than a preset difference threshold, the verification result of the character recognition result is determined to be a recognition error; when the difference is less than or equal to the difference threshold, the verification result of the character recognition result is determined to be a recognition correct.
7. The method for recognizing characters in an electric energy meter according to claim 6, characterized in that: Each of the character recognition results has a corresponding confidence level, and after determining that the verification result of the character recognition result is a recognition error, the method further includes: The confidence level of the character recognition result that is a verification result indicating a recognition error is changed, and the image to be input is re-recognized until the verification result of the character recognition result indicates that the recognition is correct.
8. An electric energy meter character recognition system, characterized in that: include: A preprocessing module, used for preprocessing the image to be recorded containing the electric energy meter characters; A character region extraction module, used for extracting a target character region from the pre-processed image to be recorded by using a maximum stable extremum region algorithm; A character region division module, used for segmenting the target character region to obtain a plurality of single-character image regions; The character recognition module is used to recognize all the single-character image areas based on a pre-trained Transformer model to obtain the character recognition result of the image to be input.
9. The electric energy meter character recognition system according to claim 8, characterized in that: The preprocessing module is also used for: Obtaining an image to be recorded containing electric energy meter characters; The image to be recorded is subjected to noise reduction processing to obtain a noise-reduced image.
10. The electric energy meter character recognition system according to claim 8, characterized in that: The character region extraction module is also used for: Converting the preprocessed image to be recorded into a grayscale image; Using a maximum stable extremum region algorithm to perform threshold processing on the grayscale image to obtain a number of binary images; Calculating the change rate of each connected region in all the binary images, and determining the initial character region according to the change rate; The Merge-NMS method is used to remove duplicates from the initial character region to obtain a target character region.
Citation Information
Cited By
Electric energy meter asset information identification method and system based on machine vision
CN122200695A
