A low-power digital recognition remote meter reading device and its recognition method
By designing a low-power remote meter reading device, using MCU chip and template library comparison technology, the problems of high power consumption and low recognition accuracy in the existing technology are solved, and fast and accurate water meter digital identification and transmission are achieved, and the popularization and efficiency of the system are improved.
Patent Information
- Application Number
- CN202210379101.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-04-12
AI Technical Summary
The existing remote water meter reading technology has problems such as high power consumption, slow transmission rate and unstable network performance, which affects the popularity and efficiency of the system.
A low-power digital recognition remote meter reading device is designed, which uses a camera, MCU chip, wireless communication module and battery to identify and transmit the digital area of the water meter through local adaptive threshold algorithm, binary processing, morphological operations and template library comparison.
It realizes low power consumption, rapid identification and transmission of water meter flow values, reduces battery life problems, improves identification accuracy and system efficiency.
Smart Images

Figure CN114845180B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image recognition, and specifically relates to a low-power consumption digital recognition remote meter reading device and a recognition method thereof. Background Art
[0002] Remote water meter digital automatic meter reading is of great significance in the intelligent management of drinking water resources. Water management companies can use remote water meter automatic meter reading systems to automatically detect the use of local water resources and detect abnormal water loss in real time. The automatic recognition of digital numbers at water meter terminals helps reduce the power consumption of terminal equipment in remote water meter automatic meter reading systems and the time for remote data transmission, thereby greatly promoting the popularity of remote water meter automatic meter reading systems. Water meter digital area recognition is the key to remote water meter digital automatic meter reading systems.
[0003] Existing water meters are divided into smart water meters and mechanical water meters. Smart water meters have many replacement restrictions, which makes the penetration rate of smart water meters not high. Therefore, there are still a large number of communities using mechanical water meters, which require meter readers to come to the door to read the meters. Therefore, it is particularly important to solve the problem of remote meter reading when the original mechanical water meters cannot be replaced. For ordinary mechanical water meters, the existing remote meter reading technology is to install an external camera device on the water meter. The water meter image taken by the camera is transmitted to the server through a wireless network, and the server completes the task of identifying the water meter value in the water meter image. This method is relatively simple to implement, but it has the following problems: (1) The network transmission of the image requires a high power consumption of the water meter external camera module device, which greatly reduces the service life of the external camera device; (2) During the image transmission process, due to network performance problems, part of the image information is lost, which will seriously affect the server's recognition accuracy of the water meter value; (3) The image data volume is quite large, and the network bandwidth requirement is high. These problems will greatly affect the promotion and popularization of remote meter reading technology such as external camera devices. The system designed by this patent can effectively solve the above problems. Summary of the invention
[0004] The invention provides a low-power consumption digital identification remote meter reading device and an identification method thereof, which are used to solve the problems of high power consumption and slow transmission rate of the existing camera direct reading remote meter reading device.
[0005] The present invention is achieved through the following technical solutions:
[0006] A low-power digital recognition remote meter reading device, the meter reading device comprises a camera, an MCU chip, a wireless communication module and a battery. The camera transmits the captured picture to the MCU chip, the MCU chip recognizes the captured picture to obtain the recognition result of the water meter flow count value and sends it to a water service server, and the battery supplies power to the camera, the MCU chip and the wireless communication module respectively.
[0007] A digital recognition method for a low-power digital recognition remote meter reading device, the water meter digital recognition method comprising the following steps:
[0008] Step 1: The water meter image collected by the meter reading device is transmitted to the MCU chip. The MCU chip uses a local adaptive threshold algorithm to perform binary processing on the original image containing the digital area of the water meter, and extracts the binary image of the digital area of the water meter;
[0009] Step 2: Based on the binary image of the water meter digital area extracted in step 1, extract each digital area again;
[0010] Step 3: Based on each digital area extracted in step 2, morphological corrosion and dilation operations are used to remove the background area of each water meter digital area;
[0011] Step 4: for each digital region after removing the background region in step 3, determine whether each digital region extracted is a half-word region, if so, proceed to step 5, if not, proceed to step 6;
[0012] Step 5: Expand the half-word area into a full-word area and then proceed to step 6;
[0013] Step 6: Calculate the similarity between the full-word area and each digital template in the template library, select the template area with the highest probability as the final digital recognition result, and transmit the recognition result to the water service server through the wireless communication module.
[0014] In the digital recognition method, the step 1 of performing binarization processing on the image is specifically as follows: the image binarization processing formula is:
[0015]
[0016] In the formula, I(x,y) represents the pixel value of the original image at the coordinate (x,y), I b (x,y) represents the binarized value of the binary image at the coordinate (x,y), where 1 represents the digital area and 0 represents the background area. th(x,y) represents the threshold at the coordinate (x,y);
[0017] The calculation formula of the threshold th(x,y) is as follows:
[0018]
[0019] In the formula, g(0)=f(0)=127·s, where 127 is the average grayscale value of the image, s is the width of the sliding window when calculating the threshold of each pixel; t is the percentage of grayscale values of the image greater than the threshold, and its value ranges from 0 to 100.
[0020] The digital recognition method, the step 2 of extracting each digital area specifically comprises the following steps:
[0021] Step 2.1: Project the predetermined digital area of the water meter in all directions to obtain a one-dimensional signal;
[0022] Step 2.2: Calculate the persistence length of the one-dimensional signal in step 2.1 to determine the rotation direction of the image;
[0023] Step 2.3: Project the rotated image vertically in the horizontal direction, and search for the first five continuous regions with the largest length in the horizontal direction after projection, so as to determine the x-axis coordinates of the five digital regions;
[0024] Step 2.4: Use steps 2.2-2.3 to horizontally project the digital area of the water meter in the vertical direction, search for the largest continuous area in the vertical direction, and thus determine the y-axis coordinate of each digital area.
[0025] The digital recognition method, the step 2.1 is specifically to project each pixel point (x, y) in the predetermined digital area R in the θ direction as:
[0026]
[0027] In the formula, P(x new ) represents the projection of the digital region R onto the θ direction;
[0028] Specifically, step 2.2 is as follows: if the duration of the one-dimensional signal is The selection direction of the image is determined using the criterion in the following formula:
[0029]
[0030] The direction θ corresponding to the smallest value of α is selected as the rotation direction of the image; the digital area can be rotated to the horizontal direction by rotating the digital area in the direction of -θ.
[0031] In the digital recognition method, the step 3 of deleting the background area of the digital area is specifically:
[0032] Step 3.1: Perform corrosion and expansion operations on each digital region successively to delete some disconnected regions in the digital region;
[0033] Step 3.2: After cleaning some disconnected areas of each digital area in step 3.1, for the pixel points with a pixel value of 1 in the digital area, cluster the pixel points using the gray value of each pixel point as input;
[0034] Step 3.3: For the clustering result of step 3.2, select the area with the smallest cluster center as the digital area.
[0035] The digital recognition method, the step 4 of distinguishing half-words and full-words in the digital area specifically comprises the following steps:
[0036] Step 4.1: Set a threshold value for the height of the rectangular area formed by the non-zero pixels in the digital area;
[0037] Step 4.2: Calculate the height of the rectangular area formed by the non-zero pixels in the digital area, and compare it with the threshold set in step 4.1. If it is less than the threshold, proceed to step 4.3; if it is greater than the threshold, proceed to step 4.4;
[0038] Step 4.3: The digital area is the half-word area. The center coordinate position of the half-word area is determined again. If the center coordinate is in the upper half of the complete area, the digital area is the lower half-word area; if the center coordinate is in the lower half of the complete area, the digital area is the upper half-word area.
[0039] Step 4.4: The digital area is a full-word area.
[0040] The digital recognition method, the step 5 of expanding the half-word area into the full-word area is specifically as follows:
[0041] If the digital area belongs to the upper half-word area, move it to the top of the entire digital area, and then add an area with a pixel value of 0 below to expand the half-word area into a full-word area;
[0042] If the digital area belongs to the lower half-word area, it is moved to the bottom of the entire digital area, and then an area with a pixel value of 0 is added on top to expand the half-word area into a full-word area.
[0043] The digital recognition method, the step 6 of calculating the similarity between the full word region and each digital template in the template library is specifically as follows: for the extracted digital region R extracted and the template region R of number i in the template library i , i = 0, 1, ..., 9, the similarity between them is calculated using the following formula: S(R extracted ,R i ): (5)
[0044]
[0045] In the formula, R extracted(x, y) represents the pixel value at row y and column x in the extracted digital area, and its value is 0 or 1; R i (x,y) represents the value at row y and column x in the template of number i. The value range of this value is [0, 65535];
[0046] Assume that the width and height of each digital area are M and N respectively. In the system, M = 30 and N = 50. The symbol · represents real number multiplication operation; ⊙ represents binary bit AND operation; R i (x,y)>>i represents a right shift operation, which is to shift R i The binary string corresponding to (x,y) is shifted left by i bits;
[0047] In the formula, (R i (x,y)>>i)⊙1 is 0 or 1 if R i In the binary string (x, y), the value at bit i is 1, then (R i (x,y)>>i)⊙1 has a value of 1, otherwise, it is 0;
[0048] Using the above formulas (5) and (6), the extracted digital area R is calculated extracted The similarity with the 9 numbers 0, 2, 3, 4, 5, 6, 7, 8, 9 in the template library; in the recognition algorithm, the recognition of the number 1 does not need to calculate the similarity. If the width of the extracted digital area is less than the threshold, the extracted area is recognized as the number 1; for each extracted digital area, the templates with similarity greater than the pre-set similarity threshold are selected as candidate recognition numbers, and they are put into the candidate template number set.
[0049] In the digital recognition method, the step 6 of selecting the template area with the highest probability is specifically:
[0050] For any two regions R in the candidate template region set i and R j , respectively calculate the extracted digital area R extracted is the probability of number i and number j, p i and p j ; They are calculated as follows:
[0051]
[0052] By using the above formula (7), after calculating the probability that each template in the candidate template region set is the final recognition result, the number corresponding to the template region with the largest probability is selected as the recognition result.
[0053] The beneficial effects of the present invention are:
[0054] The water meter digital region recognition algorithm described in the present invention can recognize the digital region at any time when the water meter is in operation, and can handle any half-word phenomenon that occurs in the water meter.
[0055] The water meter digital area recognition algorithm proposed in the present invention is simple and effective. The designed template library has a very small capacity, with only 10 digital areas. Each time recognition is performed, it is only necessary to compare the extracted digital area with the 10 digital areas in the template library; this greatly improves the computational efficiency of the algorithm.
[0056] The present invention directly converts the captured pictures into digital data by using an MCU chip and sends them to a water service server. Since the data sent is only the water meter reading, the file is very small, the speed is fast, the power consumption is low, and a battery life of 10 years is achieved.
[0057] The present invention can realize rapid recognition of the accumulated flow number on the water meter dial to reduce power consumption during the recognition process.
[0058] The present invention realizes a small amount of transmitted data and a short communication time by transmitting the accumulated flow number, thereby achieving the purpose of reducing communication power consumption.
[0059] The present invention uses a low-power MCU processor to enable the device to enter deep sleep during non-working hours, effectively reducing power consumption during the dormant period. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 The figure is a flow chart of the method of the present invention.
[0061] Figure 2 This is the water meter digital template diagram of the present invention.
[0062] Figure 3 It is a schematic diagram of the device of the present invention. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings 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.
[0064] A low-power digital recognition remote meter reading device, the meter reading device comprises a camera, an MCU chip, a wireless communication module and a battery. The camera transmits the captured picture to the MCU chip, the MCU chip recognizes the captured picture to obtain the recognition result of the water meter flow count value and sends it to a water service server, and the battery supplies power to the camera, the MCU chip and the wireless communication module respectively.
[0065] The digital dial is photographed through the camera of the meter reading device to obtain the water pen dial image, and the low-power MCU processor of the meter reading device is used to locally recognize the graphic. The water meter digital recognition algorithm is used to obtain the recognition result of the water meter flow value, and then the recognition result is sent to the water server to realize remote meter reading.
[0066] A digital recognition method for a low-power digital recognition remote meter reading device, the water meter digital recognition method comprising the following steps:
[0067] Step 1: Use the local adaptive threshold algorithm to perform binarization on the original image containing the digital area of the water meter, and extract the binary image of the digital area of the water meter;
[0068] Step 2: Based on the binary image of the water meter digital area extracted in step 1, extract each digital area again;
[0069] Step 3: Based on each digital area extracted in step 2, morphological corrosion and dilation operations are used to remove the background area of each water meter digital area;
[0070] Step 4: for each digital region after removing the background region in step 3, determine whether each digital region extracted is a half-word region, if so, proceed to step 5, if not, proceed to step 6;
[0071] Step 5: Expand the half-word area into a full-word area and then proceed to step 6;
[0072] Step 6: Calculate the similarity between the whole word area and each digital template in the template library, and select the template area with the highest probability as the final digital recognition result.
[0073] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the image is binarized in step 1, and the image binarization formula is:
[0074]
[0075] In the formula, I(x,y) represents the pixel value of the original image at the coordinate (x,y), I b (x,y) represents the binarized value of the binary image at the coordinate (x,y), where 1 represents the digital area and 0 represents the background area. th(x,y) represents the threshold at the coordinate (x,y);
[0076] The calculation formula of the threshold th(x,y) is as follows:
[0077]
[0078] In the formula, g(0)=f(0)=127·s, where 127 is the average grayscale value of the image, s is the width of the sliding window when calculating the threshold of each pixel; t is the percentage of grayscale values of the image greater than the threshold, and its value ranges from 0 to 100.
[0079] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the step 2 of extracting each digital area specifically includes the following steps: extracting each digital area of a water meter from a binary image, and this patent uses an image rotation and vertical projection method to extract each digital area. Due to the influence of the camera position, the digital area of the water meter photographed may not be in the horizontal direction, which requires rotating the binary image so that the digital area is in the horizontal direction.
[0080] Step 2.1: Project the predetermined digital area of the water meter in all directions to obtain a one-dimensional signal;
[0081] Step 2.2: Calculate the persistence length of the one-dimensional signal in step 2.1 to determine the rotation direction of the image;
[0082] Step 2.3: Project the rotated image vertically in the horizontal direction, and search for the first five continuous regions with the largest length in the horizontal direction after projection, so as to determine the x-axis coordinates of the five digital regions;
[0083] Step 2.4: Use steps 2.2-2.3 to horizontally project the digital area of the water meter in the vertical direction, search for the largest continuous area in the vertical direction, and thus determine the y-axis coordinate of each digital area.
[0084] A digital recognition method for a low-power digital recognition remote meter reading device, wherein step 2.1 is specifically to project each pixel point (x, y) in a predetermined digital area R in the θ direction as:
[0085]
[0086] In the formula, P(x new ) represents the projection of the digital region R onto the θ direction;
[0087] Specifically, step 2.2 is as follows: if the duration of the one-dimensional signal is The selection direction of the image is determined using the criterion in the following formula:
[0088]
[0089] The direction θ corresponding to the smallest value of α is selected as the rotation direction of the image; the digital area can be rotated to the horizontal direction by rotating the digital area in the direction of -θ.
[0090] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the background area of the digital area is deleted in step 3, specifically,
[0091] Step 3.1: Perform corrosion and expansion operations on each digital region successively to delete some disconnected regions in the digital region;
[0092] Step 3.2: After cleaning some disconnected areas of each digital area in step 3.1, for the pixel points with a pixel value of 1 in the digital area, cluster the pixel points using the gray value of each pixel point as input;
[0093] Step 3.3: For the clustering result of step 3.2, select the area with the smallest cluster center as the digital area.
[0094] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the step 4 of distinguishing half-words and full-words in a digital area specifically comprises the following steps:
[0095] Step 4.1: Set a threshold value for the height of the rectangular area formed by the non-zero pixels in the digital area;
[0096] Step 4.2: Calculate the height of the rectangular area formed by the non-zero pixels in the digital area, and compare it with the threshold set in step 4.1. If it is less than the threshold, proceed to step 4.3; if it is greater than the threshold, proceed to step 4.4;
[0097] Step 4.3: The digital area is the half-word area. The position of the center coordinates of the half-word area is determined again. If the center coordinates of the half-word area are in the upper half of the complete area, the digital area is the lower half-word area; if the center coordinates of the half-word area are in the lower half of the complete area, the digital area is the upper half-word area.
[0098] Step 4.4: The digital area is a full-word area.
[0099] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the step 5 expands the half-word area into a full-word area, specifically,
[0100] If the digital area belongs to the upper half-word area, move it to the top of the entire digital area, and then add an area with a pixel value of 0 below to expand the half-word area into a full-word area; that is, make the size of the digital area the same as the size of the full-word area;
[0101] If the digital area belongs to the lower half-word area, move it to the bottom of the entire digital area, and then add an area with a pixel value of 0 on it to expand the half-word area into a full-word area. That is, make the size of the digital area the same as the size of the full-word area. The full-word area is expanded to an area of the same size as the template area: The size of each digital area in the template library is fixed and the same. Before comparing the extracted digital area of the water meter with each digital area in the template, you first need to expand the extracted digital area to an area that is larger than the digital area in the template library. The method we use to expand the size of the digital area is to use the nearest neighbor interpolation method.
[0102] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the template library is specifically constructed as follows: Figure 2 The templates of all the numbers in the template library used in the recognition algorithm are given in . In the constructed template library, there is a template for each of the 9 numbers 0, 2, 3, 4, 5, 6, 7, 8, and 9; there is no template for number 1. The reason is that in our number recognition algorithm, we only need to judge the width of the extracted water meter number area to determine whether it is 1. If the extracted number is 1, there is no need to compare the templates of the other 9 numbers in the template library. In order to reduce the storage space of the template library, each number area stores the number itself and the difference area between it and other number areas. This information is stored in the form of bit operations.
[0103] Figure 2 The number i, i = 0, 2, 3, 4, 5, 6, 7, 8, 9, corresponds to the area R i In the example, each pixel R i In the binary bit of (x, y), the i-th bit stores the information of number i. If the value of number i at the pixel point (x, y) is 1, then the value of the i-th bit in the binary bit is 1, otherwise, it is 0. i In the binary bit of (x, y), the jth (j>i) bit stores the difference area between the numbers i and j. If there is a difference between the numbers i and j at the pixel point (x, y), then the pixel point R i In the binary digits of (x,y), the value of the jth (j>i) bit is 1, otherwise, its value is 0.
[0104] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the step 6 calculates the similarity between the full-word region and each digital template in the template library, and specifically selects the digital region in the template library whose similarity is greater than a threshold (the threshold value is 0.7) as the candidate digital region, which reduces the comparison space for further determining which digital region in the template library the extracted digital region belongs to. extracted and the template region R of number i in the template library i, i = 0, 1, ..., 9, the similarity between them is calculated using the following formula: S(R extracted ,R i ): (5)
[0105]
[0106] In the formula, R extracted (x, y) represents the pixel value at row y and column x in the extracted digital area, and its value is 0 or 1; R i (x,y) represents the value at row y and column x in the template of number i. The value range of this value is [0, 65535];
[0107] Assume that the width and height of each digital area are M and N respectively. In the system, M = 30 and N = 50. The symbol · represents real number multiplication operation; ⊙ represents binary bit AND operation; R i (x,y)>>i represents a right shift operation, which is to shift R i The binary string corresponding to (x,y) is shifted left by i bits;
[0108] In the formula, (R i (x,y)>>i)⊙1 is 0 or 1 if R i In the binary string (x, y), the value at bit i is 1, then (R i (x,y)>>i)⊙1 has a value of 1, otherwise, it is 0;
[0109] Using the above formulas (5) and (6), the extracted digital area R is calculated extracted The similarity with the 9 numbers 0, 2, 3, 4, 5, 6, 7, 8, 9 in the template library; in the recognition algorithm, the recognition of the number 1 does not require the calculation of the similarity. If the width of the extracted digital area is less than the threshold (the threshold value range is 17 to 20), the extracted area is recognized as the number 1; for each extracted digital area, the templates with similarity greater than the pre-set similarity threshold are selected as candidate recognition numbers, and they are placed in the candidate template number set.
[0110] A digital recognition method for a low-power digital recognition remote meter reading device, wherein the template area with the highest probability selected in step 6 is specifically:
[0111] According to the characteristics of each number, the area in the candidate number area with the highest matching degree with the number area extracted from the water meter is calculated, that is, the probability of matching the candidate number area with the extracted number area is calculated, and the number corresponding to the number area with the highest probability is the recognition result of the number area extracted from the water meter; the difference area between each number area and other number areas is retained in the template library, and then for each template area in the candidate template area, the frequency of the pixel points in the extracted number area and the characteristic pixel points of the number corresponding to the candidate template area are calculated to be 1; finally, the number corresponding to the candidate template area with the maximum frequency value is selected as the final number recognition result;
[0112] For any two regions R in the candidate template region set i and R j , respectively calculate the extracted digital area R extracted is the probability of number i and number j, p i and p j ; They are calculated as follows:
[0113]
[0114] By using the above formula (7), after calculating the probability that each template in the candidate template region set is the final recognition result, the number corresponding to the template region with the largest probability is selected as the recognition result.
[0115] Image binarization: Since the numbers in the water meter dashboard are in black font and the dashboard background is white, we can use the thresholding method to binarize the original image data to obtain a binary image of the water meter digital area. The binary image makes the difference between the water meter digital area and the background area more obvious, which helps to improve the extraction of the digital area.
[0116] Extract each digital area: In order to identify each digital area in the water meter and delete the background area caused by illumination in the digital area, we use image rotation and vertical projection methods to extract each digital area. The digital area in the image is rotated to the horizontal direction through image rotation. Then, the rotated image is vertically projected in the horizontal direction, and the continuous area with the largest length is searched in the horizontal direction after projection to determine the x-axis coordinate of each digital area. Then, in the same way, the digital area of the water meter is horizontally projected in the vertical direction, and the largest continuous area is searched in the vertical direction to determine the y-axis coordinate of each digital area. In this way, we calculate the x and y coordinate values of each digital area.
[0117] Deleting the background area of the digital area: Due to the influence of light, there may be some background area in each extracted digital area. In order to delete the background area of the extracted digital area, this patent uses morphological corrosion and expansion operations and K-means clustering method to delete the possible background area in each digital area. The digital area after deleting the background area helps to improve the recognition accuracy of the digital area.
[0118] Identification and expansion of half-word and full-word digital area: Due to the continuous operation of the water meter, there are a large number of half-word areas in the digital area of the water meter. Before identifying the digital area, first check whether the extracted digital area is a half-word area. If it is a half-word area, we need to expand it into a full-word area.
[0119] The full-word area is expanded to an area of the same size as the template area: The size of each digital area in the template library is fixed and the same. Before comparing the extracted water meter digital area with each digital area in the template, the extracted digital area must first be expanded to an area larger than the digital area in the template library, so that the digital area comparison can be performed, and then the template area in the template library that is most similar to the extracted water meter digital area can be selected.
[0120] Extract candidate digital regions in the template library based on similarity: calculate the similarity between the extracted digital region and each digital region in the template library. This patent selects digital regions in the template library whose similarity is greater than a certain threshold as candidate digital regions. In order to further determine which digital region in the template library the extracted digital region belongs to, the comparison space is reduced and the recognition accuracy of the digital region is increased.
[0121] Extract the digital area with the highest probability from the candidate digital area: According to the characteristics of each number, calculate the area in the candidate digital area that has the highest match with the digital area extracted from the water meter, that is, calculate the probability of matching the extracted digital area in the candidate digital area. The number corresponding to the digital area with the highest probability is the recognition result of the digital area extracted from the water meter.
[0122] Template library construction: In order to reduce the storage space and computational complexity of the overall algorithm, a template area is constructed for each number except the number 1. In this target area, both the digital information and the difference information between this number and other numbers are saved. When constructing the template library, we construct the digital information and the difference information between it and other numbers based on binary bits. This method of constructing the template library greatly reduces the storage space of the template library and the computational complexity of the digital area recognition process.
Claims
1. A digital recognition method for a low-power digital recognition remote meter reading device, characterized in that: The meter reading device includes a camera, an MCU chip, a wireless communication module and a battery. The camera transmits the captured image to the MCU chip. The MCU chip recognizes the captured image to obtain the recognition result of the water meter flow count value and sends it to the water service server. The battery supplies power to the camera, the MCU chip and the wireless communication module respectively. The digital recognition method comprises the following steps: Step 1: The water meter image collected by the meter reading device is transmitted to the MCU chip. The MCU chip uses a local adaptive threshold algorithm to perform binary processing on the original image containing the digital area of the water meter, and extracts the binary image of the digital area of the water meter; Step 2: Based on the binary image of the water meter digital area extracted in step 1, extract each digital area again; Step 3: Based on each digital area extracted in step 2, morphological corrosion and dilation operations are used to remove the background area of each water meter digital area; Step 4: for each digital region after removing the background region in step 3, determine whether each digital region extracted is a half-word region, if so, proceed to step 5, if not, proceed to step 6; Step 5: Expand the half-word area into a full-word area and then proceed to step 6; Step 6: Calculate the similarity between the full-word area and each digital template in the template library, select the template area with the highest probability as the final digital recognition result, and transmit the recognition result to the water service server through the wireless communication module; The step 2 of extracting each digital region specifically comprises the following steps: Step 2.1: Project the predetermined digital area of the water meter in all directions to obtain a one-dimensional signal; Step 2.2: Calculate the persistence length of the one-dimensional signal in step 2.1 to determine the rotation direction of the image; Step 2.3: Project the rotated image vertically in the horizontal direction, search for the first five continuous areas with the largest length in the horizontal direction after projection, and thus determine the x-axis coordinates of the five digital areas; Step 2.4: Use steps 2.2-2.3 to project the digital area of the water meter horizontally in the vertical direction, search for the largest continuous area in the vertical direction, and thus determine the y-axis coordinate of each digital area.
2. The digital recognition method according to claim 1, characterized in that: Specifically, the image is binarized in step 1, and the image binarization formula is: In the formula, I(x,y) represents the pixel value of the original image at the coordinate (x,y), I b (x,y) represents the binarized value of the binary image at the coordinate (x,y), where 1 represents the digital area and 0 represents the background area; th(x,y) represents the threshold at the coordinate (x,y); The calculation formula of the threshold th(x,y) is as follows: In the formula, g(0)=f(0)=127·s, where 127 is the average grayscale value of the image, s is the width of the sliding window when calculating the threshold of each pixel; t is the percentage of grayscale values of the image greater than the threshold, and its value ranges from 0 to 100.
3. The digital recognition method according to claim 2, characterized in that: Specifically, step 2.1 projects each pixel point (x, y) in the predetermined digital region R in the θ direction as follows: In the formula, P(x new ) represents the projection of the digital region R onto the θ direction; Specifically, step 2.2 is as follows: if the duration of the one-dimensional signal is The selection direction of the image is determined using the criterion in the following formula: The direction θ corresponding to the smallest value of α is selected as the rotation direction of the image; the digital area can be rotated to the horizontal direction by rotating the digital area in the direction of -θ.
4. The digital recognition method according to claim 1, characterized in that: The specific step 3 of deleting the background area of the digital area is: Step 3.1: Perform corrosion and expansion operations on each digital region successively to delete some disconnected regions in the digital region; Step 3.2: After cleaning some disconnected areas of each digital area in step 3.1, for the pixel points with a pixel value of 1 in the digital area, cluster the pixel points using the gray value of each pixel point as input; Step 3.3: For the clustering result of step 3.2, select the area with the smallest cluster center as the digital area.
5. The digital recognition method according to claim 1, characterized in that: The step 4 of distinguishing half-words and full-words in the digital area specifically comprises the following steps: Step 4.1: Set a threshold value for the height of the rectangular area formed by the non-zero pixels in the digital area; Step 4.2: Calculate the height of the rectangular area formed by the non-zero pixels in the digital area, and compare it with the threshold set in step 4.
1. If it is less than the threshold, proceed to step 4.3; if it is greater than the threshold, proceed to step 4.4; Step 4.3: The digital area is the half-word area. The center coordinate position of the half-word area is determined again. If the center coordinate is in the upper half of the complete area, the digital area is the lower half-word area; if the center coordinate is in the lower half of the complete area, the digital area is the upper half-word area. Step 4.4: The digital area is a full-word area.
6. The digital recognition method according to claim 5, characterized in that: The step 5 expands the half-word area into the full-word area specifically as follows: If the digital area belongs to the upper half-word area, move it to the top of the entire digital area, and then add an area with a pixel value of 0 below to expand the half-word area into a full-word area; If the digital area belongs to the lower half-word area, it is moved to the bottom of the entire digital area, and then an area with a pixel value of 0 is added on top to expand the half-word area into a full-word area.
7. The digital recognition method according to claim 1, characterized in that: The step 6 calculates the similarity between the whole word region and each digital template in the template library as follows: extracted and the template region R of number i in the template library i , i = 0, 1, ..., 9, the similarity between them is calculated using the following formula: S(R extracted ,R i ):(5) In the formula, R extracted (x, y) represents the pixel value at row y and column x in the extracted digital area, and its value is 0 or 1; R i (x,y) represents the value at row y and column x in the template of number i. The value range of this value is [0, 65535]; Assume that the width and height of each digital area are M and N respectively. In the system, M = 30 and N = 50. The symbol · represents real number multiplication operation; ⊙ represents binary bit AND operation; R i (x,y)>>i represents a right shift operation, which is to shift R i The binary string corresponding to (x,y) is shifted left by i bits; In the formula, (R i (x,y)>>i)⊙1 is 0 or 1 if R i In the binary string (x, y), the value at bit i is 1, then (R i (x,y)>>i)⊙1 has a value of 1, otherwise, it is 0; Using the above formulas (5) and (6), the extracted digital area R is calculated extracted The similarity with the 9 numbers 0, 2, 3, 4, 5, 6, 7, 8, 9 in the template library; in the recognition algorithm, the recognition of the number 1 does not need to calculate the similarity. If the width of the extracted digital area is less than the threshold, the extracted area is recognized as the number 1; for each extracted digital area, the templates with similarity greater than the pre-set similarity threshold are selected as candidate recognition numbers, and they are put into the candidate template number set.
8. The digital recognition method according to claim 7, characterized in that: The template region with the highest probability selected in step 6 is specifically: For any two regions R in the candidate template region set i and R j , respectively calculate the extracted digital area R extracted is the probability of number i and number j, p i and p j ; They are calculated as follows: By using the above formula (7), after calculating the probability that each template in the candidate template region set is the final recognition result, the number corresponding to the template region with the largest probability is selected as the recognition result.
Citation Information
Patent Citations
Meter reading method and device based on image recognition
CN110263778A
Equipment state visual detection method integrating deep learning and morphological filtering
CN110674827A