A method for identifying readings of digital multimeter
Through camera collection and image processing technology, the readings of digital universal meters are automatically identified, solving the problem of low recognition efficiency and artificial detection errors in existing technologies, and realizing high accuracy and high efficiency reading recognition.
Patent Information
- Application Number
- CN202010994840.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-21
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-09-21
AI Technical Summary
The reading recognition efficiency of digital multimeters is low, resulting in low calibration efficiency and high cost, and manual detection can easily lead to visual fatigue and reading errors.
Collect the reading number images of the universal meter through the camera, conduct pre -processing, cutting and digital string recognition, combined with decimal point recognition methods to achieve automated identification.
Improved the accuracy and efficiency of digital multimeter digital tubes displaying numbers, reducing the complexity of the operation, reducing artificial errors, and improving the verification efficiency.
Smart Images

Figure CN112232344B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of multimeter reading recognition, in particular to a digital multimeter reading recognition method. Background Art
[0002] Digital multimeters have many functions and their calibration is complicated. Enterprises are unable to allocate a large number of technicians to calibrate the instruments, resulting in low calibration efficiency and high calibration costs. In addition, conventional manual inspections require real-time recording and switching of the output of the standard source and the indication of the digital multimeter. This workload can easily lead to visual fatigue for the inspectors, making it impossible to record for a long time and prone to reading erroneous data. Based on this, this design uses image segmentation and character recognition to solve this problem. Summary of the invention
[0003] The present invention is to more accurately identify the multimeter reading. The present invention provides a digital multimeter reading identification method. The present invention provides the following technical solutions:
[0004] A method for identifying a digital multimeter reading comprises the following steps:
[0005] Step 1: Capture the reading image of the digital multimeter through a camera and pre-process the reading image;
[0006] Step 2: According to the preprocessed image, the preprocessed image is cropped, and the digital string recognition is performed on the cropped area;
[0007] Step 3: Identify the decimal point based on the identified digital string.
[0008] Preferably, the step 1 is specifically:
[0009] Step 1.1: Use Gaussian blurring method and histogram equalization method to process the collected reading image and remove white noise;
[0010] Step 1.2: Through the binarization of the image, the visual effect of the image is divided into black and white. The grayscale image with brightness levels between 0 and 255 is distinguished by the selected threshold. The image determination method of the specific object and the image outside the object area is compared with the selected threshold according to the current threshold. When all pixels greater than or equal to the threshold have their grayscale values set to 255, otherwise the grayscale value becomes 0, and a binary image reflecting the overall and local features is obtained;
[0011] When the grayscale values on the image are the same but the background of the object is still different, the difference features are converted into grayscale differences, and then the threshold selection technology is used to segment the image, and the Gaussian threshold method is used to binarize the image to obtain the preprocessed image.
[0012] Preferably, the threshold selection technology also includes: selecting threshold T by bimodal method, selecting threshold T by Otsu method and determining threshold T by iteration method.
[0013] Preferably, the step 2 is specifically:
[0014] Step 2.1: According to the preprocessed image, the preprocessed image is cropped. The basis for cropping in the horizontal direction is that the numerical integral of the pixels projected to the horizontal axis exceeds a certain threshold and is continuous. The valid rows and columns are determined by accumulating more than 20 white pixels on the projection axis. The valid character width is determined by continuous valid pixels exceeding 35 pixels on the row or column. The continuous valid pixels not exceeding 35 are merged with the adjacent invalid areas as the same invalid area, and the invalid area is cropped to obtain the cropped area;
[0015] Step 2.2: Perform digital string recognition on the cropped area, divide a single number into seven parts numbered 1 to 7, and encode the entire number by judging the presence or absence of these seven parts. The value of the number is obtained by comparing the data table. The aspect ratio of the segmented image except the number "1" is 1.9:1. Therefore, the detection of the number "1" can be determined by reading the aspect ratio of the number. For numbers other than 1, determine whether there is a line by detecting whether the effective pixel ratio exceeds 20%, encode according to the position of the detected line, and determine the number according to the code.
[0016] Preferably, the step 3 is specifically:
[0017] The position and reading of the decimal point are determined by calculating the width of the string and the character spacing. Two arrays m[] and L[] are set to store the position at the end of the string segmentation and the distance between characters respectively. The width of the number at position i on the image is expressed by the following formula: i :
[0018] l i =m[i]-m[i-1]-L[i-1]
[0019] Where i≥2;
[0020] Determine the average width of each character It is expressed by the following formula
[0021]
[0022] Among them, n represents the number of characters to be recognized, l n Represents the width of the nth character;
[0023] When the number "1" does not appear in all characters, and l i≥1.1l, it means that the decimal point is after the i-th character; when there is a number "1" in the character, then When , it indicates that the decimal point exists at the i-th position, so the decimal point position is determined and the reading is completed.
[0024] The present invention has the following beneficial effects:
[0025] Compared with the existing method, the method designed by the present invention has low computational complexity and high effect, and has a good effect on recognizing numbers displayed on the nixie tube of a digital multimeter.
[0026] Since the digital instrument is fixed by a fixing device during the identification process, the relative position of the camera and the instrument is fixed. Therefore, for the same type of digital instrument, the pixel position of the digital image captured by the camera each time is consistent. When recognizing the image, only the fixed pixels on the image need to be segmented to meet the recognition requirements. In this way, the interference factors on the image can be removed during each processing, which improves the accuracy of recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 The present invention is a flow chart of a method for identifying a reading of a digital multimeter;
[0028] Figure 2 is the histogram of image background and target;
[0029] Figure 3 is a grayscale image;
[0030] Figure 4 is the cropped digital image;
[0031] Figure 5 A schematic diagram of a single character;
[0032] Figure 6 This is a schematic diagram of coding detection. DETAILED DESCRIPTION
[0033] The present invention is described in detail below in conjunction with specific embodiments. Specific embodiment one:
[0035] according to Figures 1 to 6 As shown, the present invention provides a method for identifying readings of a digital multimeter, specifically:
[0036] according to Figure 1 As shown, a method for identifying readings of a digital multimeter comprises the following steps:
[0037] Step 1: Capture the reading image of the digital multimeter through a camera and pre-process the reading image;
[0038] The step 1 is specifically as follows:
[0039] Step 1.1: Use Gaussian blurring method and histogram equalization method to process the collected reading image and remove white noise;
[0040] Step 1.2: Through the binarization of the image, the visual effect of the image is divided into black and white. The grayscale image with brightness levels between 0 and 255 is distinguished by the selected threshold. The image determination method of the specific object and the image outside the object area is compared with the selected threshold according to the current threshold. When all pixels greater than or equal to the threshold have their grayscale values set to 255, otherwise the grayscale value becomes 0, and a binary image reflecting the overall and local features is obtained;
[0041] When the grayscale values on the image are the same but the background of the object is still different, the difference features are converted into grayscale differences, and then the threshold selection technology is used to segment the image. The Gaussian threshold method is used for binarization to obtain the preprocessed image. The grayscale image is as follows Figure 3 shown.
[0042] The threshold selection technology also includes: selecting threshold T by bimodal method, selecting threshold T by Otsu method and determining threshold T by iteration method. After the three thresholds are selected, the background and image of the digital instrument can be presented with obvious black and white effects. After the threshold determined by Otsu method is binarized, black spots exist in the digital background, and the digital edge of the image after iterative binarization is relatively fuzzy. In contrast, the threshold selected by Gaussian threshold method in local adaptive method has the best effect on the image after image binarization. Therefore, this design uses Gaussian threshold method to binarize the image of the digital instrument screen to obtain the preprocessed image z. After the three thresholds are selected, the background and image of the digital instrument can be presented with obvious black and white effects. After the threshold determined by Otsu method is binarized, black spots exist in the digital background, and the digital edge of the image after iterative binarization is relatively fuzzy. In contrast, the threshold selected by Gaussian threshold method in local adaptive method has the best effect on the image after image binarization. Therefore, this design uses Gaussian threshold method to binarize the image of the digital instrument screen to obtain the preprocessed image.
[0043] When the grayscale distribution of the selected image is uniform and regular, that is, there are valleys between the peaks formed by each target and background in the image histogram, then the following can be selected: Figure 2 The grayscale value corresponding to the trough under the double peaks shown is used as the threshold for binary distinction.
[0044] Gaussian weighted threshold determines the threshold T
[0045] The Gaussian weighted threshold is selected by performing Gaussian convolution on the distance from the point (x, y) to the center point of a specific window. The threshold can be expressed as:
[0046]
[0047] Among them, w st is the value of the Gaussian convolution kernel at point (s, t).
[0048] Since the digital instrument is fixed by a fixing device and the camera is controlled by a mechanical arm to take pictures, the relative position of the camera and the instrument is fixed. Therefore, for the same type of digital instrument, the pixel position of the digital image taken by the camera each time is consistent. When recognizing the image, only the fixed pixels on the image need to be segmented to meet the recognition requirements. In this way, the interference factors on the image can be removed during each processing, which improves the accuracy of recognition.
[0049] Because the positions of the camera and the electric meter are fixed, there is no need to find the recognition area. The original image is directly cropped according to the parameters to separate the individual characters and the image is binarized.
[0050] Step 2: According to the preprocessed image, the preprocessed image is cropped, and the digital string recognition is performed on the cropped area;
[0051] The step 2 is specifically as follows:
[0052] Step 2.1: According to the preprocessed image, the preprocessed image is cropped. The basis for cropping in the horizontal direction is that the numerical integral of the pixels projected to the horizontal axis exceeds a certain threshold and is continuous. The effective rows and columns are determined by accumulating more than 20 white pixels on the projection axis. The effective character width is determined by continuous effective pixels exceeding 35 pixels on the row or column. The continuous effective pixels not exceeding 35 are merged with the adjacent invalid areas as the same invalid area, and the invalid area is cropped to obtain the cropped area, such as Figure 4 As shown;
[0053] Step 2.2: According to Figure 5 and Figure 6 As shown, the cropped area is subjected to digital string recognition, and a single number is divided into seven parts numbered 1 to 7. The entire number is encoded by judging the presence or absence of the seven parts, and the value of the number is obtained by comparing the data table. The aspect ratios of the segmented images except for the number "1" are all 1.9:1. Therefore, the detection of the number "1" can be determined by reading the aspect ratio of the number. For numbers other than 1, whether there are lines is determined by detecting whether the effective pixel ratio exceeds 20%, and encoding is performed according to the position of the detected line, and the number is determined according to the encoding.
[0054] The code is (0,1,1,1,1,1,1,1). According to the data table in Table 1, it can be concluded that the number is "6".
[0055] Table 1 Digital codes corresponding to digital tube characters
[0056]
[0057] Step 3: Identify the decimal point based on the identified digital string.
[0058] The step 3 is specifically as follows:
[0059] The position and reading of the decimal point are determined by calculating the width of the string and the character spacing. Two arrays m[] and L[] are set to store the position at the end of the string segmentation and the distance between characters respectively. The width of the number at position i on the image is expressed by the following formula: i :
[0060] l i =m[i]-m[i-1]-L[i-1]
[0061] Where i≥2;
[0062] Determine the average width of each character It is expressed by the following formula
[0063]
[0064] Among them, n represents the number of characters to be recognized, l n Represents the width of the nth character;
[0065] When the number "1" does not appear in all characters, and l i ≥1.1l, it means that the decimal point is after the i-th character; when there is a number "1" in the character, then When , it indicates that the decimal point exists at the i-th position, so the decimal point position is determined and the reading is completed.
[0066] Because the positions of the camera and the electric meter are fixed, there is no need to find the recognition area. The original image can be directly cropped according to the parameters to separate the single characters, and the image is binarized. Since the digital tube itself is in a rectangle, the basis for cropping in the horizontal (vertical) direction is that the pixel value integral projected to the horizontal (vertical) axis exceeds a certain threshold and is continuous. According to known statistical results, the determination of valid rows (columns) can be more than 20 white pixels accumulated on the projection axis, and the determination of valid character width can be more than 35 pixels continuously valid on the row (column). The continuous valid pixels not exceeding 35 are merged with the adjacent invalid area and regarded as the same invalid area.
[0067] The above is only a preferred implementation of a method for identifying readings of a digital multimeter. The protection scope of a method for identifying readings of a digital multimeter is not limited to the above embodiments. All technical solutions under this idea belong to the protection scope of the present invention. It should be pointed out that for those skilled in the art, several improvements and changes without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for identifying readings of a digital multimeter, characterized in that: The following steps are involved: Step 1: Capture the reading image of the digital multimeter through a camera and pre-process the reading image; Step 2: According to the preprocessed image, the preprocessed image is cropped, and the digital string recognition is performed on the cropped area; Step 3: Identify the decimal point based on the identified digital string; The step 1 is specifically as follows: Step 1.1: Use Gaussian blurring method and histogram equalization method to process the collected reading image and remove white noise; Step 1.2: Through the binarization of the image, the visual effect of the image is divided into black and white. The grayscale image with brightness levels between 0 and 255 is distinguished by the selected threshold. The method for determining the image of a specific object and the image outside the object area is to compare the current threshold with the selected threshold. All pixels greater than or equal to the threshold have their grayscale values set to 255, otherwise the grayscale value becomes 0, and a binary image reflecting the overall and local features is obtained; When the grayscale values on the image are the same but the background of the object is still different, the difference is converted into grayscale difference, and then the threshold selection technology is used to segment the image, and the Gaussian threshold method is used to binarize to obtain the preprocessed image; The step 2 is specifically as follows: Step 2.1: According to the preprocessed image, the preprocessed image is cropped. The basis for cropping in the horizontal direction is that the numerical integral of the pixels projected to the horizontal axis exceeds a certain threshold and is continuous. The effective rows and columns are determined when the cumulative number of pixels on the projection axis exceeds 20. The effective character width is determined when the number of pixels on the row or column is continuous and exceeds 35. The continuous valid pixels not exceeding 35 are merged with the adjacent invalid areas and regarded as the same invalid area. The invalid area is cropped to obtain the cropped area. Step 2.2: Perform digital string recognition on the cropped area, divide a single number into seven parts numbered 1 to 7, encode the entire number by judging the presence or absence of these seven parts, and obtain the value of the number by comparing with the data table. The aspect ratio of the segmented image except the number "1" is 1.9:1, so the detection of the number "1" can be determined by reading the aspect ratio of the number. For numbers other than 1, determine whether there is a line by detecting whether the effective pixel ratio exceeds 20%, encode according to the position of the detected line, and determine the number according to the code; The step 3 is specifically as follows: The position and reading of the decimal point are determined by calculating the width of the string and the character spacing. Two arrays m[] and L[] are set to store the position at the end of the string segmentation and the distance between characters respectively. The width of the number at position i on the image is expressed by the following formula: i : l i =m[i]-m[i-1]-L[i-1] Where i≥2; Determine the average width of each character It is expressed by the following formula Among them, n represents the number of characters to be recognized, l n Represents the width of the nth character; When the number "1" does not appear in all characters, and l i ≥1.1l, it means that the decimal point is after the i-th character; when there is a number "1" in the character, then When , it indicates that the decimal point exists at the i-th position, so the decimal point position is determined and the reading is completed.
Citation Information
Patent Citations
Electric meter automatic reading method based on image recognition
CN110084241A