Data recognition method and device for digital water meter
By combining the deep learning model with the BP neural network, the problem of low recognition accuracy of digital water meters under different environmental conditions is solved, and efficient reading recognition in complex environments is achieved.
Patent Information
- Application Number
- CN202111601753.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2041-12-24
AI Technical Summary
When the environmental conditions of the digital water meter are poor, the recognition accuracy is difficult to guarantee.
The YOLOv3 model based on deep learning is used to extract the reading detection area. Through annotation box matching and character segmentation processing, combined with the BP neural network recognition algorithm, historical water meter images are used to calculate the character confidence and improve the recognition accuracy.
Improves the recognition accuracy of digital water meter readings under adverse environmental conditions.
Smart Images

Figure CN114267044B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data recognition, and in particular relates to a data recognition method and device for a digital water meter. Background Art
[0002] In recent years, with the further development of image processing technology, many researchers have proposed low-cost, high-efficiency intelligent meter reading technology to address the high labor costs and time management costs of manual meter reading. Replacing traditional methods with computer-generated artificial intelligence recognition technology can significantly improve worker productivity and labor efficiency.
[0003] However, the accuracy of digital water meter readings is closely related to the specific environment in which the digital water meter is located. The accuracy of recognition is difficult to guarantee under different environmental conditions. Summary of the Invention
[0004] The present invention provides a data recognition method and device for a digital water meter, which are used to at least solve the technical problem that the recognition accuracy is difficult to ensure when the environmental conditions of the digital water meter are poor.
[0005] According to an embodiment of the present invention, a data recognition method for a digital water meter includes: obtaining a real-time water meter image of a certain user, detecting the real-time water meter image based on a preset water meter detection model, and extracting a detection image containing a reading detection area, wherein the reading detection area is the area in the water meter image containing the water meter reading; marking the digital area in the detection image according to a labeling frame of a preset size, so as to obtain the four vertex coordinates of the actual labeling frame, and matching the four vertex coordinates of the actual labeling frame with the vertex coordinates of a preset target frame; correcting the digital area in the detection image based on the matching result, and performing regional character segmentation processing on the corrected digital area; judging whether the characters in a certain area after the regional character segmentation processing are clearly displayed; if the characters in a certain area after the regional character segmentation processing are not clearly displayed, calculating the confidence of a certain character belonging to the characters in a certain area based on a historical water meter image of a certain user, and outputting a character with the highest confidence as the character in the certain area; recognizing the characters in the digital area based on a digital recognition algorithm of a BP neural network, so as to obtain the water meter reading.
[0006] In addition, the data recognition method for a digital water meter according to the above embodiment of the present invention may also have the following additional technical features:
[0007] Furthermore, the water meter detection model is a YOLOv3 model based on deep learning.
[0008] Furthermore, the correction of the digital area in the detection image based on the matching result and the regional character segmentation processing of the corrected digital area include: moving and / or rotating the digital area in the detection image according to the difference between the four vertex coordinates of the actual annotation box and the vertex coordinates of the preset target box; and dividing the corrected digital area in the preset target box in proportion to the width.
[0009] Furthermore, after determining whether the characters in a certain area after the area character segmentation processing are clearly displayed, the method also includes: if the characters in a certain area after the area character segmentation processing are clearly displayed, directly identifying the characters in the digital area based on the BP neural network digital recognition algorithm to obtain the water meter reading.
[0010] Furthermore, if the characters in a certain area are not displayed clearly after the area character segmentation processing, the confidence of the characters in a certain area belonging to a certain character is calculated based on the historical water meter images of a certain user, including: obtaining at least two historical water meter images of a certain user within a preset time; identifying predicted characters that have not changed and / or the change difference is less than a threshold in at least two historical water meter images of a certain user; and calculating the confidence of the characters in a certain area belonging to a certain character based on the predicted characters.
[0011] According to an embodiment of the present invention, a data recognition device for a digital water meter includes: a detection module, configured to obtain a real-time water meter image of a certain user, detect the real-time water meter image based on a preset water meter detection model, and extract a detection image containing a reading detection area, wherein the reading detection area is an area in the water meter image containing a water meter reading; a labeling module, configured to label the digital area in the detection image according to a labeling frame of a preset size, so as to obtain the four vertex coordinates of the actual labeling frame, and match the four vertex coordinates of the actual labeling frame with the vertex coordinates of the preset target frame; a correction module, configured to perform a correction based on The matching result corrects the digital area in the detection image and performs regional character segmentation processing on the corrected digital area; the judgment module is configured to judge whether the characters in a certain area after the regional character segmentation processing are clearly displayed; the calculation module is configured to calculate the confidence of a certain character in a certain area based on a historical water meter image of a certain user if the characters in a certain area after the regional character segmentation processing are not clearly displayed, and output a character with the highest confidence as the character in a certain area; the recognition module is configured to recognize the characters in the digital area based on the digital recognition algorithm of the BP neural network, so as to obtain the water meter reading.
[0012] The present invention also provides an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the data identification method for a digital water meter according to any embodiment of the present invention.
[0013] The present invention also provides a computer-readable storage medium having a computer program stored thereon. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the data recognition method for a digital water meter according to any embodiment of the present invention.
[0014] The data recognition method and device for digital water meters of the present application use a preset water meter detection model to extract a detection image containing a reading detection area from a real-time water meter image, and by marking the detection image and matching it with the vertex coordinates of a target box, the characters in the detection image are segmented. The confidence level of the characters to which unclear characters in a certain area belong is calculated based on the user's historical water meter images, thereby improving the accuracy of digital water meter readings. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0016] Figure 1 A flow chart of a data recognition method for a digital water meter provided in one embodiment of the present invention;
[0017] Figure 2 A structural block diagram of a data recognition device for a digital water meter provided by one embodiment of the present invention;
[0018] Figure 3 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0020] See also Figure 1 , which shows a flow chart of a data identification method for a digital water meter of the present application.
[0021] like Figure 1 As shown, the data recognition method of the digital water meter specifically includes the following steps:
[0022] Step S101 : obtaining a real-time water meter image of a certain user, detecting the real-time water meter image based on a preset water meter detection model, and extracting a detection image including a reading detection area.
[0023] In this embodiment, a real-time water meter image of a certain user is input into a YOLOv3 model based on deep learning, so that a detection image containing a reading detection area is output.
[0024] It should be noted that the reading detection area is the area in the water meter image that contains the water meter reading.
[0025] Step S102 : annotating the digital area in the detection image according to the annotation frame of a preset size, obtaining the four vertex coordinates of the actual annotation frame, and matching the four vertex coordinates of the actual annotation frame with the vertex coordinates of the preset target frame.
[0026] Step S103 , correcting the digital region in the detection image based on the matching result, and performing region character segmentation processing on the corrected digital region.
[0027] In this embodiment, the digital area in the detection image is moved and / or rotated according to the difference between the four vertex coordinates of the actual annotation box and the vertex coordinates of the preset target box, and the corrected digital area located in the preset target box is divided proportionally according to the width.
[0028] Step S104 , determining whether the characters in a certain area after the area character segmentation process are clearly displayed.
[0029] It should be noted that the characters in a certain area may be unclear or incomplete due to the influence of the water meter environment. For example, the light at the location where the water meter is installed is poor, and the surface of the water meter is stained and obscured by stains.
[0030] Step S105 , if the characters in a certain area are not clearly displayed after the area character segmentation process, the confidence of the characters in the certain area is calculated based on the historical water meter images of a certain user, and the character with the highest confidence is output as the character in the certain area.
[0031] In this embodiment, if the characters within a certain area after the regional character segmentation process are not clearly displayed, at least two historical water meter images of a certain user are obtained within a preset time, and predicted characters that have not changed and / or whose change difference is less than a threshold value in the at least two historical water meter images of the certain user are identified. The confidence level of the characters within the certain area is calculated based on the predicted characters, and the character with the highest confidence level is output as the character within the certain area. If the characters within a certain area after the regional character segmentation process are clearly displayed, the characters in the digital area are directly identified based on the BP neural network digital recognition algorithm to obtain the water meter reading.
[0032] Step S106: recognizing characters in the digital area using a digital recognition algorithm based on a BP neural network to obtain a water meter reading.
[0033] In this embodiment, the segmented characters to be recognized are standardized to a predetermined pixel size through image scaling transformation, and the maximum value method is used to unify the grayscale information of the image into a decimal between 0 and 1; the pixel data is read as the input of the BP neural network, and the weight and threshold matrix stored in the data memory is used for forward calculation. Among the nodes in the output layer, the node with the maximum value is taken as the result of the neural network digital recognition.
[0034] In summary, the method of the present application uses a preset water meter detection model to extract a detection image containing a reading detection area in a real-time water meter image, and by marking the detection image and matching it with the vertex coordinates of the target box, the characters in the detection image are segmented, and the confidence of the characters to which the unclear characters in a certain area belong is calculated based on the user's historical water meter images, thereby improving the accuracy of reading digital water meters.
[0035] See also Figure 2 , which shows a structural block diagram of a data recognition device for a digital water meter of the present application.
[0036] like Figure 2 As shown, the data recognition device 200 includes a detection module 210 , a labeling module 220 , a correction module 230 , a judgment module 240 , a calculation module 250 and an identification module 260 .
[0037] Among them, the detection module 210 is configured to obtain a real-time water meter image of a certain user, detect the real-time water meter image based on a preset water meter detection model, and extract a detection image containing a reading detection area, wherein the reading detection area is an area in the water meter image containing a water meter reading; the annotation module 220 is configured to annotate the digital area in the detection image according to an annotation frame of a preset size, so as to obtain the four vertex coordinates of the actual annotation frame, and match the four vertex coordinates of the actual annotation frame with the vertex coordinates of the preset target frame; the correction module 230 is configured to annotate the digital area in the detection image based on the matching result. The digital area is corrected, and the corrected digital area is subjected to regional character segmentation processing; the judgment module 240 is configured to judge whether the characters in a certain area after the regional character segmentation processing are clearly displayed; the calculation module 250 is configured to calculate the confidence of a certain character in a certain area based on a historical water meter image of a certain user if the characters in a certain area after the regional character segmentation processing are not clearly displayed, and output a character with the highest confidence as the character in a certain area; the recognition module 260 is configured to recognize the characters in the digital area based on the digital recognition algorithm of the BP neural network, so as to obtain the water meter reading.
[0038] It should be understood that Figure 2 Modules and references documented in Figure 1 Therefore, the operations and features described above for the method and the corresponding technical effects also apply to Figure 2 The modules in it will not be described in detail here.
[0039] In other embodiments, embodiments of the present invention further provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions can execute the data recognition method of the digital water meter in any of the above method embodiments;
[0040] As an embodiment, the non-volatile computer storage medium of the present invention stores computer-executable instructions, and the computer-executable instructions are configured as follows:
[0041] Obtain a real-time water meter image of a user, detect the real-time water meter image based on a preset water meter detection model, and extract a detection image containing a reading detection area, wherein the reading detection area is an area in the water meter image containing a water meter reading;
[0042] Annotating the digital area in the detection image according to a labeling frame of a preset size to obtain the coordinates of four vertices of the actual labeling frame, and matching the four vertex coordinates of the actual labeling frame with the vertex coordinates of the preset target frame;
[0043] Correcting the digital area in the detection image based on the matching result, and performing regional character segmentation processing on the corrected digital area;
[0044] Determine whether the characters in a certain area after the area character segmentation process are clearly displayed;
[0045] If the characters in a certain area are not clearly displayed after the regional character segmentation process, the confidence of the characters in the certain area is calculated based on the historical water meter images of a certain user, and the character with the highest confidence is output as the character in the certain area;
[0046] A digital recognition algorithm based on BP neural network recognizes the characters in the digital area, so as to obtain the water meter reading.
[0047] The non-volatile computer-readable storage medium may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function; the data storage area may store data generated based on the use of the data identification device for the remotely powered digital water meter. Furthermore, the non-volatile computer-readable storage medium may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, the non-volatile computer-readable storage medium may optionally include a memory remotely located from the processor. Such remote memory may be connected to the data identification device for the remotely powered digital water meter via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0048] An embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes any of the above-mentioned digital water meter data recognition methods.
[0049] Figure 3 Schematic diagram of the structure of the vehicle provided by the embodiment of the present invention, such as Figure 3 As shown, the device includes: one or more processors 310 and a memory 320, Figure 3 A processor 310 is used as an example. The apparatus of the digital water meter data recognition method may further include: an input device 330 and an output device 340. The processor 310, the memory 320, the input device 330 and the output device 340 may be connected via a bus or other means. Figure 3The example uses a bus connection. Memory 320 is the aforementioned non-volatile computer-readable storage medium. Processor 310 executes the various server functional applications and data processing by running the non-volatile software programs, instructions, and modules stored in memory 320, thereby implementing the digital water meter data recognition method of the aforementioned method embodiment. Input device 330 can receive input digital or character information and generate key signal input related to user settings and function control of the remotely powered digital water meter data recognition device. Output device 340 may include a display device such as a display screen.
[0050] The above-mentioned product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0051] As an embodiment, the above-mentioned vehicle is applied to a data recognition device of a digital water meter, which is used for a client and includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0052] Obtain a real-time water meter image of a user, detect the real-time water meter image based on a preset water meter detection model, and extract a detection image containing a reading detection area, wherein the reading detection area is an area in the water meter image containing a water meter reading;
[0053] Annotating the digital area in the detection image according to a labeling frame of a preset size to obtain the coordinates of four vertices of the actual labeling frame, and matching the four vertex coordinates of the actual labeling frame with the vertex coordinates of the preset target frame;
[0054] Correcting the digital area in the detection image based on the matching result, and performing regional character segmentation processing on the corrected digital area;
[0055] Determine whether the characters in a certain area after the area character segmentation process are clearly displayed;
[0056] If the characters in a certain area are not clearly displayed after the regional character segmentation process, the confidence of the characters in the certain area is calculated based on the historical water meter images of a certain user, and the character with the highest confidence is output as the character in the certain area;
[0057] A digital recognition algorithm based on BP neural network recognizes the characters in the digital area, so as to obtain the water meter reading.
[0058] Those skilled in the art will appreciate that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0059] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0060] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement the hardware: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0061] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0062] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A data recognition method for a digital water meter, characterized in that: include: Obtain a real-time water meter image of a user, detect the real-time water meter image based on a preset water meter detection model, and extract a detection image containing a reading detection area, wherein the reading detection area is an area in the water meter image containing a water meter reading; Annotating the digital area in the detection image according to a labeling frame of a preset size to obtain the coordinates of four vertices of the actual labeling frame, and matching the four vertex coordinates of the actual labeling frame with the vertex coordinates of the preset target frame; Correcting the digital region in the detection image based on the matching result, and performing regional character segmentation processing on the corrected digital region, wherein correcting the digital region in the detection image based on the matching result, and performing regional character segmentation processing on the corrected digital region includes: Performing a movement transformation and / or a rotation transformation on the digital area in the detection image according to the difference between the four vertex coordinates of the actual annotation frame and the vertex coordinates of the preset target frame; The corrected digital area located in the preset target frame is divided proportionally according to width; Determine whether the characters in a certain area after the area character segmentation process are clearly displayed; If the characters in a certain area after the regional character segmentation processing are not clearly displayed, the confidence of the characters in the certain area belonging to a certain character is calculated based on a historical water meter image of a certain user, and a character with the highest confidence is output as the character in the certain area, wherein if the characters in a certain area after the regional character segmentation processing are not clearly displayed, the confidence of the characters in the certain area belonging to a certain character is calculated based on a historical water meter image of a certain user includes: Obtain at least two historical water meter images of a user within a preset time; Identify predicted characters that have not changed and / or whose change difference is less than a threshold in at least two historical water meter images of a user; Calculating the confidence level of a character in a certain area based on the predicted character; A digital recognition algorithm based on BP neural network recognizes the characters in the digital area, so as to obtain the water meter reading.
2. The data recognition method of a digital water meter according to claim 1, characterized in that: The water meter detection model is a YOLOv3 model based on deep learning.
3. The data recognition method for a digital water meter according to claim 1, characterized in that: After determining whether the characters in a certain area after the area character segmentation process are clearly displayed, the method further includes: If the characters in a certain area after the area character segmentation process are clearly displayed, the characters in the digital area are directly recognized by the digital recognition algorithm based on the BP neural network to obtain the water meter reading.
4. A data recognition device for a digital water meter, characterized in that: include: a detection module configured to obtain a real-time water meter image of a user, detect the real-time water meter image based on a preset water meter detection model, and extract a detection image containing a reading detection area, wherein the reading detection area is an area in the water meter image containing a water meter reading; a marking module configured to mark the digital area in the detection image according to a marking frame of a preset size, so as to obtain the coordinates of four vertices of the actual marking frame, and match the coordinates of the four vertices of the actual marking frame with the coordinates of the vertices of the preset target frame; The correction module is configured to correct the digital area in the detection image based on the matching result and perform regional character segmentation processing on the corrected digital area, wherein the correction of the digital area in the detection image based on the matching result and the regional character segmentation processing on the corrected digital area include: Performing a movement transformation and / or a rotation transformation on the digital area in the detection image according to the difference between the four vertex coordinates of the actual annotation frame and the vertex coordinates of the preset target frame; The corrected digital area located in the preset target frame is divided proportionally according to width; A judgment module configured to judge whether characters in a certain area after the area character segmentation process are clearly displayed; The calculation module is configured to calculate the confidence level of a character in a certain area based on a historical water meter image of a certain user if the characters in a certain area after the regional character segmentation processing are not clearly displayed, and output a character with the highest confidence level as the character in the certain area, wherein if the characters in a certain area after the regional character segmentation processing are not clearly displayed, calculating the confidence level of a character in a certain area based on a historical water meter image of a certain user includes: Obtain at least two historical water meter images of a user within a preset time; Identify predicted characters that have not changed and / or whose change difference is less than a threshold in at least two historical water meter images of a user; Calculating the confidence level of a character in a certain area based on the predicted character; The recognition module is configured to recognize characters in the digital area based on a digital recognition algorithm of a BP neural network, so as to obtain a water meter reading.
5. An electronic device, characterized in that: include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Cloud end meter reading method and device
CN108124487A
Water meter reading recognition method and equipment and storage medium
CN111444781A