An image recognition-based electric energy meter liquid crystal detection method and system
The image recognition-based method for detecting the liquid crystal of an energy meter utilizes a CCD camera and a deep neural network to segment and identify the liquid crystal, solving the problem of low efficiency in manual detection and achieving efficient and accurate liquid crystal detection and data recording.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NINGXIA LGG INSTR CO LTD
- Filing Date
- 2025-03-19
- Publication Date
- 2026-06-19
AI Technical Summary
The testing and verification of the LCD display function of existing electricity meters relies on manual methods, which results in high manpower consumption, long verification cycle, large error, high possibility of verification omissions and errors, and cannot provide effective process records, thus affecting R&D and production efficiency.
An image recognition-based method for detecting liquid crystal displays in electricity meters is adopted. The liquid crystal image is acquired through a CCD camera, and combined with median filtering, sharpening filtering, edge detection, and the YOLO model, it is segmented into single character blocks and then identified and detected using a deep neural network, replacing manual detection.
It improves the accuracy and efficiency of LCD testing in electricity meters, reduces manual intervention, shortens the R&D iteration cycle, increases production efficiency, and saves test data for easy traceability.
Smart Images

Figure CN120259227B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electricity meter testing technology, and in particular to an image recognition-based method and system for detecting the liquid crystal of an electricity meter. Background Technology
[0002] In the field of electricity meters, there is a need for testing and verification of LCD display functions during both the R&D and production stages. However, the most common method at present is still manual verification. This method not only consumes a lot of manpower and prolongs the verification cycle, but also requires human observation and judgment. When the number of display items is large, for example, some electricity meters in the Southern Power Grid have thousands or even tens of thousands of display items, the error introduced by humans is considerable, and there is a possibility of verification omissions or even verification errors. Using manual verification in the R&D stage will greatly limit the functional verification and software iteration cycle; using manual verification in the production stage will slow down product output. In addition, manual verification methods cannot provide effective process records, resulting in a lack of data support for later data queries and anomaly analysis. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for detecting liquid crystal in electricity meters based on image recognition, so as to improve the above-mentioned technical problems.
[0004] To achieve the above-mentioned objectives, the embodiments of the present invention provide the following technical solutions:
[0005] A method for detecting the liquid crystal of an energy meter based on image recognition includes:
[0006] The liquid crystal image of the electricity meter is acquired and preprocessed to obtain the preprocessed liquid crystal image;
[0007] The preprocessed liquid crystal image is segmented to obtain the corresponding single character blocks and their numbers;
[0008] Based on the numbering, each single character block is sequentially identified and classified using an image recognition algorithm to obtain the corresponding recognition result; the recognition result includes the classification result and the probability; the classification result includes characters and numbers.
[0009] Obtain the actual LCD display code of the electricity meter; based on the actual LCD display code and each recognition result, detect each single character block to obtain the detection result.
[0010] Furthermore, the preprocessing includes:
[0011] The liquid crystal image is subjected to median filtering to obtain the first filtered liquid crystal image;
[0012] Set a sharpening convolution kernel, and use a sharpening filter to enhance the first filtered liquid crystal image to obtain a second filtered liquid crystal image;
[0013] The second filtered liquid crystal image is processed using an edge detection algorithm to obtain a liquid crystal edge feature map.
[0014] The edge feature map of the liquid crystal is processed using a target detection algorithm to obtain the pixel edge positions of the liquid crystal display; the target detection algorithm adopts the YOLO model.
[0015] Based on the pixel edge position, the liquid crystal edge feature map is cropped to obtain the liquid crystal display area image data;
[0016] The image data of the liquid crystal display area is subjected to grayscale processing, normalization, and binarization to obtain the preprocessed liquid crystal image.
[0017] Further, the step of segmenting the preprocessed liquid crystal image to obtain corresponding single-character blocks includes:
[0018] The preprocessed liquid crystal image is segmented once to obtain the corresponding segmented liquid crystal image;
[0019] Multiple liquid crystal segmented images are each segmented twice to obtain corresponding initial single-character blocks;
[0020] Determine if the surrounding pixel values of the N edge pixels of each initial single character block are within the white threshold range; if so, treat each initial single character block as a single character block and sort and number it; otherwise, update the LCD image of the energy meter and process it.
[0021] Furthermore, the process of the first segmentation includes:
[0022] The preprocessed liquid crystal image is processed using the first edge detection algorithm to obtain the liquid crystal edge image;
[0023] The preprocessed liquid crystal image and liquid crystal edge image are projected along the Y-axis and binarized to obtain the first binarized array and the second binarized array.
[0024] Calculate the first XOR array based on the first binarized array and the second binarized array;
[0025] Select the pixel with the middle value of the continuous 0 value interval in the first XOR array as the split point to obtain P split points;
[0026] Based on P segmentation points, the preprocessed liquid crystal image and liquid crystal edge image are segmented to obtain the corresponding first liquid crystal segmentation image and first liquid crystal edge segmentation image;
[0027] The liquid crystal segmented image includes a first liquid crystal segmented image and a first liquid crystal edge segmented image.
[0028] Furthermore, the secondary segmentation process includes:
[0029] The first liquid crystal segmentation image and the first liquid crystal edge segmentation image are projected in the X-axis direction and binarized to obtain the third binarized value and the fourth binarized array.
[0030] Calculate the second XOR array based on the third binarized value and the fourth binarized array;
[0031] Select the pixel with the median value of the consecutive 0 value interval in the second XOR array as the cutting point to obtain Q cutting points;
[0032] Based on Q segmentation points, the first liquid crystal segmentation image is segmented to obtain the corresponding second liquid crystal segmentation image, which is the initial single character block.
[0033] Furthermore, the image recognition algorithm employs a deep neural network; the deep neural network includes a first convolutional layer to a tenth convolutional layer, a pooling layer, a first fully connected layer, a second fully connected layer, and a classification layer, which are sequentially connected in series.
[0034] Further, the actual LCD display code of the energy meter is obtained; based on the actual LCD display code and the recognition result, each single character block is detected to obtain the detection result, including:
[0035] The actual LCD display code of the energy meter is read through the communication module;
[0036] The single character blocks are grouped to obtain M groups of character blocks;
[0037] Based on the classification results, each character block group is encoded in hexadecimal to obtain M strings of data;
[0038] A string of data is randomly selected as the display item to be detected and compared with the actual LCD display code to obtain the comparison result;
[0039] Based on the comparison results and probabilities, calculate the joint probability of the string data and the actual LCD display code;
[0040] Determine if the joint probability is less than the first probability threshold; if so, determine that the detection result is qualified for the item to be detected, and select a new string of data for processing.
[0041] Conversely, if the joint probability is within the probability threshold range, the detection result is determined to be a defective item, and a new string of data is selected for processing; otherwise, the detection result is determined to be an abnormal item, and the detection is stopped.
[0042] Furthermore, the formula for the joint probability is:
[0043] T = (W n *P n +W s *P s )*R;
[0044] Where T represents the joint probability of the string data and the actual LCD display code, and W... n W s P represents the numeric weight parameter and the character weight parameter, respectively. n P s These represent the probabilities that the classification result of the string data is a number or a character, respectively, and R represents the comparison result.
[0045] An image recognition-based liquid crystal detection system for electricity meters includes:
[0046] A CCD camera is used to capture images from an LCD screen.
[0047] The liquid crystal image preprocessing module is used to preprocess liquid crystal images to obtain preprocessed liquid crystal images;
[0048] The character block segmentation module is used to segment the preprocessed liquid crystal image to obtain the corresponding single character blocks and their numbers;
[0049] The character block recognition and classification module is used to sequentially recognize and classify each single character block using an image recognition algorithm to obtain the recognition result.
[0050] The electricity meter LCD detection module is used to obtain the actual LCD display code of the electricity meter; based on the actual LCD display code and the recognition result, it detects each single character block to obtain the detection result.
[0051] The beneficial effects of this invention are as follows:
[0052] This invention combines deep learning, traditional methods, and LCD specifications to detect the LCD in electricity meters while ensuring accuracy. It accurately identifies the deep and edge features of the LCD, replacing manual detection during R&D and production. This reduces the iteration cycle of the program in R&D and improves the efficiency of the production process. It also reduces human intervention in the process, enhances the intelligence of production, eliminates anomalies caused by human error, and improves detection accuracy. Furthermore, it saves images and detection data from the entire detection process, facilitating later traceability and querying. Attached Figure Description
[0053] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart of the method in an embodiment of the present invention;
[0055] Figure 2 This is a flowchart of the preprocessing process in an embodiment of the present invention;
[0056] Figure 3 This is a structural diagram of the YOLO model and deep neural network in an embodiment of the present invention;
[0057] Figure 4 This is a schematic diagram of a full-screen liquid crystal image in an embodiment of the present invention;
[0058] Figure 5 This is a system structure diagram in an embodiment of the present invention. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0060] Please see Figure 1 This embodiment provides a method for detecting the liquid crystal of an energy meter based on image recognition, which includes:
[0061] S1. Use a CCD camera to acquire the liquid crystal image of the electricity meter and perform preprocessing to obtain the preprocessed liquid crystal image.
[0062] like Figure 2 As shown, the preprocessing includes:
[0063] S101. The liquid crystal image is subjected to median filtering to obtain the first filtered liquid crystal image. The median filter is used to remove noise caused by light changes and reflections in the liquid crystal image while preserving the edge features of the liquid crystal image. The size of the median filter is set to 9 to preserve its edge features better.
[0064] S102. Set a sharpening convolution kernel. Define a sharpening convolution kernel with a positive center value and negative values around the center value. Use the sharpening filter to enhance the first filtered liquid crystal image. Increase the edge information of the first filtered liquid crystal image through convolution operation to obtain a second filtered liquid crystal image. The first filtered liquid crystal image and the second filtered liquid crystal image have the same depth. The positive value is 7, and the negative value is -1.
[0065] S103. The edge detection algorithm is used to perform feature processing on the second filtered liquid crystal image to extract the corresponding edge information and obtain a liquid crystal edge feature map with clearer and more prominent edge features, thereby further improving the positioning accuracy of the target detection algorithm; the edge detection algorithm in S102 adopts the Sobel operator.
[0066] S104. The edge feature map of the liquid crystal is processed using a target detection algorithm to obtain the pixel edge positions of the liquid crystal display.
[0067] like Figure 3 As shown, the target detection algorithm uses the YOLO model to detect the edges of the LCD screen of the electricity meter. The YOLO model includes a series of convolutional modules, a fully connected module, and a max-pooling layer. The convolutional module includes Q convolutional layers, namely convolutional layers Conv1 to ConvQ, which are connected in series. The fully connected module includes two fully connected layers, FC1 and FC2, which are connected in series. The output dimensions of fully connected layers FC1 and FC are 8*8*16.
[0068] In this embodiment, the Q value is 20. Specifically, convolutional layers Conv8, Conv11, Conv14, Conv17, and Conv20 all have a kernel size of 1x4 and a stride of 1, generating rectangular receptive fields. The remaining convolutional layers all have kernels of 3x4 and a stride of 1.
[0069] The processing procedure for the YOLO model is as follows:
[0070] The liquid crystal edge feature map is input into the convolution module to extract features such as edges and textures, and obtain the corresponding deep feature representation of the liquid crystal.
[0071] The deep feature representation of the liquid crystal is input into the fully connected module for integration and mapping to obtain the liquid crystal mapped feature representation;
[0072] By inputting the liquid crystal mapping feature representation into the max pooling layer and selecting the most significant features to obtain the initial pixel edge position, the computational load and the risk of overfitting can be further reduced.
[0073] The initial pixel edge positions are transformed to obtain four pixel coordinate points that are the same size as the liquid crystal image, i.e., the pixel edge positions.
[0074] S105. Based on the pixel edge position, the liquid crystal edge feature map is cropped to obtain liquid crystal cropped image data, i.e., the liquid crystal display area image of the energy meter.
[0075] S106. Perform grayscale processing, normalization, and binarization on the LCD cropped image data to obtain the preprocessed LCD image. When normalizing the LCD cropped image data, it is necessary to normalize the LCD cropped image data according to the different specifications of LCD sizes to ensure that the obtained image data sizes are consistent.
[0076] Since the standard LCD size for testing is 60mm*19mm, the grayscale processed LCD cropped image data needs to be normalized to the standard 60mm*19mm size. Because the LCD backlight is white and the displayed text is black, the binarization threshold is set to 127.
[0077] In one embodiment, a power meter test rack is constructed, and the number of power meters mounted on it does not exceed 32. Each power meter mounted on the test rack is equipped with a corresponding robotic arm. Each robotic arm is controlled by a host computer and moves to a designated position according to the instructions transmitted by the host computer. The designated position is a position parallel to and directly opposite the center of the LCD display. After each robotic arm moves to the designated position, it waits for the host computer to transmit a test instruction. After receiving the corresponding test instruction, each robotic arm, through the host computer's control communication module, illuminates the LCD backlight and controls the power meter to display the specified content to be tested. The host computer sends operation instructions to a CCD camera, which acquires images, specifying the image output format as 300 DPI, to obtain the corresponding LCD image. The communication module can use RS485.
[0078] This method applies to all types of electricity meters. In this embodiment, detection is performed using a liquid crystal display based on a single-phase three-phase meter from the Southern Power Grid. Figure 4 As shown.
[0079] S2. Based on the segmentation rules, the preprocessed liquid crystal image is segmented to obtain the corresponding single-character blocks and their numbers, including:
[0080] S201. Perform a segmentation on the preprocessed liquid crystal image to obtain the corresponding segmented liquid crystal image;
[0081] S201 includes:
[0082] The preprocessed liquid crystal image is processed using a first edge detection algorithm to obtain a liquid crystal edge image; the first edge detection algorithm uses the Canny operator. Both the preprocessed liquid crystal image X1 and the liquid crystal edge image X2 are M1*N1 pixels in size.
[0083] The preprocessed liquid crystal image and liquid crystal edge image are projected along the Y-axis and binarized to obtain a first binarized array and a second binarized array; the formula corresponding to the projection along the Y-axis is:
[0084]
[0085] Where ∑(·) represents the summation function, and i and j represent the row index and column index, respectively. X1(i,j) and X2(i,j) represent the pixel sum of all columns in the i-th row of the preprocessed liquid crystal image X1 and the liquid crystal edge image X2, respectively. X1(i,j) and X2(i,j) represent the pixel values in the i-th row and j-th column of the preprocessed liquid crystal image X1 and the liquid crystal edge image X2, respectively.
[0086] The preprocessed liquid crystal image and liquid crystal edge image are processed according to the projection formula to obtain the corresponding one-dimensional array and one-dimensional edge array.
[0087] Based on the first threshold, the one-dimensional array is binarized to obtain the first binarized array. In this embodiment, the first threshold is 200. If the number of pixels in the one-dimensional array is greater than the first threshold, the pixel value of that pixel is normalized to 1; otherwise, the pixel value of that pixel is normalized to 0.
[0088] Based on the second threshold, the one-dimensional edge array is binarized to obtain a second binarized array. Wherein, the second threshold in this embodiment is If a pixel in the one-dimensional edge array is greater than the second threshold, the pixel value corresponding to that pixel is normalized to 1; otherwise, the pixel value corresponding to that pixel is normalized to 0. Max represents the maximum value function.
[0089] Based on the first and second binarized arrays, calculate the first XOR array H. xor (i), that is This indicates XOR processing.
[0090] Select the first XOR array H xor (i) takes the pixel with the middle value of the continuous 0 value interval as the cutting point to obtain P cutting points;
[0091] Based on P segmentation points, the preprocessed liquid crystal image and liquid crystal edge image are segmented to obtain the corresponding first liquid crystal segmentation image and first liquid crystal edge segmentation image;
[0092] The liquid crystal segmented image includes a first liquid crystal segmented image and a first liquid crystal edge segmented image.
[0093] S202. Perform secondary segmentation on multiple liquid crystal segmented images to obtain corresponding initial single character blocks;
[0094] S202 includes:
[0095] The first liquid crystal segmentation image and the first liquid crystal edge segmentation image are projected in the X-axis direction and binarized to obtain the third binarized value and the fourth binarized array.
[0096] Calculate the second XOR array based on the third binarized value and the fourth binarized array;
[0097] Select the pixel with the median value of the consecutive 0 value interval in the second XOR array as the cutting point to obtain Q cutting points;
[0098] Based on Q segmentation points, the first liquid crystal segmentation image is segmented to obtain the corresponding second liquid crystal segmentation image, which is the initial single character block.
[0099] S202 uses the same calculations and processing as S201.
[0100] S203. Determine if the surrounding pixel values of the N edge pixels of each initial single-character block are all within the white threshold range; if so, treat each initial single-character block as a single-character block and sort and number it; otherwise, use the CCD camera to re-capture the LCD image of the energy meter and return to S1. Wherein, N≥3.
[0101] S3. Based on the number, use an image recognition algorithm to sequentially identify and classify each single character block to obtain the corresponding recognition result; the recognition result includes the classification result and the probability; the classification result includes characters and numbers.
[0102] The image recognition algorithm employs a deep neural network to effectively extract image features and recognize numbers and symbols; for example... Figure 3 As shown, the deep neural network includes a first convolutional layer to a tenth convolutional layer, a pooling layer, a first fully connected layer, a second fully connected layer, and a classification layer connected in series.
[0103] The convolutional kernels of the first through tenth convolutional layers are all 3×3, which can extract more hierarchical features from single character blocks, thus better capturing the detailed features of symbols and numbers. The pooling layer has a stride of 2 to reduce the size of the feature map, reduce the complexity of subsequent calculations, and prevent the network from overfitting while preserving the main features of the image. The input dimension of the first fully connected layer is 512×7×7, meaning that the feature map output from the pooling layer is transformed into a one-dimensional vector containing 512 feature channels, each with a size of 7×7. The input dimension of the second fully connected layer is 512, and the output dimension is set to 50, corresponding to the different character categories (characters and numbers) recognized.
[0104] A training dataset containing labels (symbols and numbers) was built using the Labelme tool, and the deep neural network was pre-trained to obtain the trained deep neural network.
[0105] S4. Obtain the actual LCD display code of the energy meter; based on the actual LCD display code and each recognition result, detect each single character block to obtain the detection results, including:
[0106] S401. Read the actual LCD display code of the energy meter through the communication module;
[0107] S402. Group the single character blocks to obtain M groups of character blocks; M takes the value 4.
[0108] S403. Based on each classification result, encode each character block group in hexadecimal to obtain M strings of data. For character blocks whose classification result is a character, use a single hexadecimal digit and pad with 0x0; for character blocks whose classification character is a number, use a single hexadecimal byte and pad with 0x0.
[0109] S404. Randomly select a string of data as the display item to be detected, and compare it with the actual LCD display code to obtain the comparison result R; when the part corresponding to the display item to be detected and the actual LCD display code are the same, the comparison result R is 1, otherwise the comparison result R is 0.
[0110] When the comparison result R is 0, return to S1. If the comparison result R of the item to be detected is still 0 in the next round, that is, when the comparison result R of the same item to be detected is 0 in two consecutive rounds, the detection result of the item to be detected is an abnormal prompt, and proceed to S406 to select a new string data for processing.
[0111] S405. Based on the comparison results and probabilities, calculate the joint probability of the string data and the actual liquid crystal display code;
[0112] The formula for the joint probability is:
[0113] T = (W n *P n +W s *P s )*R;
[0114] Where T represents the joint probability of the string data and the actual LCD display code, and W... n W s P represents the numeric weight parameter and the character weight parameter, respectively. n P s These represent the probabilities that the classification result of the string data is a number or a character, respectively, and R represents the comparison result.
[0115] S406. Determine whether the joint probability is less than the first probability threshold; if so, determine that the detection result is qualified and select a new string data for processing; otherwise, proceed to S407; the first probability threshold is 95%.
[0116] S407. Determine if the joint probability is within the probability threshold range. If yes, determine that the item to be detected is a defective item, select a new string data, and return to S404. Otherwise, determine that the item to be detected is abnormal, and stop the detection. The probability threshold range is [90%, 95%].
[0117] This embodiment utilizes the OpenCV-python computer vision library and the PyTorch deep learning framework to build the YOLO model and deep neural network.
[0118] like Figure 5 As shown, an image recognition-based liquid crystal detection system for electricity meters includes:
[0119] A CCD camera is used to capture images from an LCD screen.
[0120] The liquid crystal image preprocessing module is used to preprocess liquid crystal images to obtain preprocessed liquid crystal images;
[0121] The character block segmentation module is used to segment the preprocessed liquid crystal image to obtain the corresponding single character blocks and their numbers;
[0122] The character block recognition and classification module is used to sequentially recognize and classify each single character block using an image recognition algorithm to obtain the recognition result.
[0123] The electricity meter LCD detection module is used to obtain the actual LCD display code of the electricity meter; based on the actual LCD display code and the recognition result, it detects each single character block to obtain the detection result.
[0124] The invention also includes a storage module for all data throughout the detection process.
[0125] In summary, this invention combines deep learning, traditional methods, and LCD specifications to detect the LCD in electricity meters while ensuring recognition accuracy. It accurately identifies the deep and edge features of the LCD, replacing manual inspection during R&D and production processes. This reduces the iteration cycle of the program during R&D, improves efficiency in the production process, reduces human intervention in each step, enhances the intelligence of production, eliminates anomalies caused by human error, and improves detection accuracy. Furthermore, it saves images and detection data from the entire detection process, facilitating later traceability and querying.
[0126] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting liquid crystal in an energy meter based on image recognition, characterized in that, include: The liquid crystal image of the electricity meter is acquired and preprocessed to obtain the preprocessed liquid crystal image; The preprocessed liquid crystal image is segmented to obtain the corresponding single character blocks and their numbers; Based on the numbering, each single character block is sequentially identified and classified using an image recognition algorithm to obtain the corresponding recognition result; the recognition result includes the classification result and the probability; the classification result includes characters and numbers. Obtain the actual LCD display code of the electricity meter; Based on the actual LCD display code and various recognition results, each single character block is detected to obtain the detection results; The step of segmenting the preprocessed liquid crystal image to obtain corresponding single character blocks includes: The preprocessed liquid crystal image is segmented once to obtain the corresponding segmented liquid crystal image; Multiple liquid crystal segmented images are each segmented twice to obtain corresponding initial single-character blocks; Determine if the surrounding pixel values of the N edge pixels of each initial single character block are within the white threshold range; if so, treat each initial single character block as a single character block and sort and number it; otherwise, update the LCD image of the energy meter and process it. The process of one-time segmentation includes: The preprocessed liquid crystal image is processed using the first edge detection algorithm to obtain the liquid crystal edge image; The preprocessed liquid crystal image and liquid crystal edge image are projected along the Y-axis and binarized to obtain the first binarized array and the second binarized array. Calculate the first XOR array based on the first binarized array and the second binarized array; Select the pixel with the middle value of the continuous 0 value interval in the first XOR array as the split point to obtain P split points; Based on P segmentation points, the preprocessed liquid crystal image and liquid crystal edge image are segmented to obtain the corresponding first liquid crystal segmentation image and first liquid crystal edge segmentation image; The liquid crystal segmented image includes a first liquid crystal segmented image and a first liquid crystal edge segmented image; The secondary segmentation process includes: The first liquid crystal segmentation image and the first liquid crystal edge segmentation image are projected in the X-axis direction and binarized to obtain the third binarized value and the fourth binarized array. Calculate the second XOR array based on the third binarized value and the fourth binarized array; Select the pixel with the median value of the consecutive 0 value interval in the second XOR array as the cutting point to obtain Q cutting points; Based on Q segmentation points, the first liquid crystal segmentation image is segmented to obtain the corresponding second liquid crystal segmentation image, which is the initial single character block.
2. The image recognition based liquid crystal detection method for electric energy meter according to claim 1, characterized in that, The preprocessing includes: The liquid crystal image is subjected to median filtering to obtain the first filtered liquid crystal image; Set a sharpening convolution kernel, and use a sharpening filter to enhance the first filtered liquid crystal image to obtain a second filtered liquid crystal image; The second filtered liquid crystal image is processed using an edge detection algorithm to obtain a liquid crystal edge feature map. The edge feature map of the liquid crystal is processed using a target detection algorithm to obtain the pixel edge positions of the liquid crystal display; the target detection algorithm adopts the YOLO model. Based on the pixel edge position, the liquid crystal edge feature map is cropped to obtain the liquid crystal display area image data; The image data of the liquid crystal display area is subjected to grayscale processing, normalization, and binarization to obtain the preprocessed liquid crystal image. 3.The image recognition based liquid crystal detection method for electric energy meter according to claim 1, characterized in that, The image recognition algorithm employs a deep neural network; the deep neural network comprises a first convolutional layer to a tenth convolutional layer, a pooling layer, a first fully connected layer, a second fully connected layer, and a classification layer, which are sequentially connected in series. 4.The image recognition based liquid crystal detection method for electric energy meter according to claim 1, characterized in that, The actual LCD display code of the energy meter is obtained; Based on the actual LCD display code and recognition results, each single character block is detected to obtain the detection results, including: The actual LCD display code of the energy meter is read through the communication module; The single character blocks are grouped to obtain M groups of character blocks; Based on the classification results, each character block group is encoded in hexadecimal to obtain M strings of data; A string of data is randomly selected as the display item to be detected and compared with the actual LCD display code to obtain the comparison result; Based on the comparison results and probabilities, calculate the joint probability of the string data and the actual LCD display code; Determine if the joint probability is less than the first probability threshold; if so, determine that the detection result is qualified for the item to be detected, and select a new string of data for processing. Conversely, if the joint probability is within the probability threshold range, the detection result is determined to be a defective item, and a new string of data is selected for processing; otherwise, the detection result is determined to be an abnormal item, and the detection is stopped.
5. The image recognition based liquid crystal detection method for electric energy meter according to claim 4, characterized in that, The formula for the joint probability is: ; in, This represents the joint probability of the string data and the actual LCD display code. , These represent the numeric weight parameter and the character weight parameter, respectively. , These represent the probabilities that the classification result of the string data is a number or a character, respectively. This indicates the comparison result.
6. An image recognition-based liquid crystal detection system for electric energy meter, for implementing the image recognition-based liquid crystal detection method of any one of claims 1 to 5, characterized in that, include: A CCD camera is used to capture images from an LCD screen. The liquid crystal image preprocessing module is used to preprocess liquid crystal images to obtain preprocessed liquid crystal images; The character block segmentation module is used to segment the preprocessed liquid crystal image to obtain the corresponding single character blocks and their numbers; The character block recognition and classification module is used to sequentially recognize and classify each single character block using an image recognition algorithm to obtain the recognition result. The electricity meter LCD detection module is used to obtain the actual LCD display code of the electricity meter. Based on the actual LCD display code and recognition results, each single character block is detected to obtain the detection results.