Background
Water electric heating is a common resource in family life, but the problem of social disturbance caused by the difficulty in meter reading is solved. If the problem of meter reading can be thoroughly solved, all meters such as an electric meter, a water meter, a gas meter, a heat meter and the like can realize multi-meter centralized reading, one-time intelligentization and remote reading, and one-time settlement brings great convenience to life of people.
At present, the intelligent user management and the bidirectional interaction platform are built under the intelligent power grid architecture and are gradually realized, so that a common family can realize user energy management, mobile terminal electricity purchasing, multi-meter reading of water, electricity and gas, comprehensive information service, remote household appliance control and the like through the intelligent power grid, and the living intelligence level of people is comprehensively improved.
However, at present, for some old cells, most of the meters used in remote areas are still mechanical meters, and the collection of the readings of the mechanical meters is mainly realized by manual home-entry collection. And manual household collection reading consumes a large amount of labor, wastes time and labor, has high labor intensity and high labor cost, and is difficult to ensure that the water, electricity, heat and other instrument data can be obtained on time because a resident is not at home.
Aiming at the mechanical metering instrument, the reading of the electric water heat meter and the like is accurately and automatically obtained on time through a digital identification technology, and the technical problem that a plurality of problems of manual meter reading are urgently needed to be solved is avoided. However, the current identification technology cannot accurately and reliably identify and has high error rate, so the technology cannot be popularized and applied to the counting of meters such as water, electricity, heat and the like.
Disclosure of Invention
The present invention is directed to a method and an apparatus for recognizing readings of a measuring instrument.
In order to achieve the above object, in one aspect, the present invention provides a reading identification method for a metering device, including:
acquiring a digital character wheel image acquired by a camera;
preliminarily positioning a digital domain window area in the digital character wheel image, and then removing an edge interference area outside the digital domain window area to obtain an accurate digital domain window area image, wherein the accurate digital domain window area image comprises a plurality of characters;
performing character segmentation on the accurate window area image of the digital domain to obtain a single character image;
and identifying each single character image by using a machine learning method.
Preferably, the preliminary positioning of the window area of the digital domain in the digital character wheel image, and then the elimination of the edge interference area outside the window area of the digital domain to obtain the accurate window area image of the digital domain specifically include:
detecting the upper and lower boundary lines of a digital domain window area in the digital character wheel image by a vertical direction gradient method;
detecting the left and right boundary lines of the digital domain window area after the upper and lower boundary lines are determined by a horizontal direction gradient method;
preliminarily positioning the digital domain window area according to the determined upper, lower, left and right boundary lines, and cutting to form a digital domain window area image;
and carrying out global binarization primary processing on the digital domain window area image and eliminating an edge interference area of the digital domain window area image by adopting a connected domain analysis method to obtain an accurate digital domain window area image.
Preferably, the character segmentation of the precise window area image in the digital domain to obtain a single character image specifically includes:
carrying out global binarization reprocessing on the accurate digital domain window area image by using a global binarization algorithm;
carrying out noise elimination on the accurate digital domain window area image after global binarization reprocessing so as to remove an interference area on the accurate digital domain window area image;
character segmentation is carried out on the character area in the accurate window area image of the digital domain by adopting a vertical projection method so as to obtain the left and right boundaries of each character, and a single character image is cut out;
and carrying out binarization on the cut single character image by using a local binarization algorithm, and eliminating noise points and interference areas by using a priori knowledge and a connected domain analysis method.
Preferably, the identifying each of the single character images by using a machine learning method specifically includes:
and identifying each single character by adopting a neural network algorithm and combining the geometrical prior knowledge characteristics of each character.
In another aspect, the present invention provides a reading identification apparatus for a measuring instrument, including:
the acquisition module is used for acquiring a digital character wheel image acquired by the camera;
the positioning unit is used for carrying out primary positioning on a digital domain window area in the digital character wheel image and then eliminating an edge interference area outside the digital domain window area to obtain an accurate digital domain window area image, wherein the accurate digital domain window area image comprises a plurality of characters;
the character segmentation unit is used for carrying out character segmentation on the accurate window area image of the digital domain to obtain a single character image;
and the identification unit is used for identifying each single character image by using a machine learning method.
Preferably, the positioning unit specifically includes:
the first detection module is used for detecting the upper and lower boundary lines of a digital domain window area in the digital character wheel image by a vertical direction gradient method;
the second detection module is used for detecting the left and right boundary lines of the digital domain window area after the upper and lower boundary lines are determined by a horizontal direction gradient method;
the cutting module is used for preliminarily positioning the digital domain window area according to the determined upper, lower, left and right boundary lines and cutting to form a digital domain window area image;
and the initial processing module is used for carrying out global binarization initial processing on the digital domain window area image and eliminating an edge interference area of the digital domain window area image by adopting a connected domain analysis method to obtain an accurate digital domain window area image.
Preferably, the character segmentation unit specifically includes:
the global binarization module is used for carrying out global binarization reprocessing on the accurate digital domain window area image by using a global binarization algorithm;
the noise elimination module is used for eliminating noise of the accurate digital domain window area image after global binarization reprocessing so as to remove an interference area on the accurate digital domain window area image;
the character segmentation module is used for performing character segmentation on the character area in the accurate window area image of the digital domain by adopting a vertical projection method to obtain the left and right boundaries of each character and cutting out a single character image;
and the local binarization module is used for carrying out binarization on the cut single character image by using a local binarization algorithm and eliminating noise points and interference areas by adopting a priori knowledge and connected domain analysis method.
Preferably, the identification unit is specifically configured to:
and identifying each single character by adopting a neural network algorithm and combining the geometrical prior knowledge characteristics of each character.
According to the reading identification method and device for the metering instrument, a digital domain window area in a digital character wheel image is initially positioned, and an edge interference area outside the digital domain window area is eliminated to obtain an accurate digital domain window area image, wherein the accurate digital domain window area image comprises a plurality of characters; performing character segmentation on the accurate window area image of the digital domain to obtain a single character image; and identifying each single character image by adopting a machine learning method. So, can realize the discernment of measurement appearance meter reading, moreover, the accuracy of discernment is high, can ensure to popularize and apply on water, electricity gas meter count.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
Referring to fig. 1, fig. 1 illustrates a flow of implementing a method for identifying reading of a metering device according to an embodiment of the present invention, and for convenience of description, only a portion related to the embodiment of the present invention is shown. Specifically, the reading identification method of the metering device comprises the following steps:
s101, acquiring a digital character wheel image acquired by a camera.
The camera is generally installed at a certain distance position in front of the dial plate of the metering instrument, and the camera collects digital character wheel images to pass back after receiving a collection instruction.
S102, preliminarily positioning a digital domain window area in the digital character wheel image, and then eliminating an edge interference area outside the digital domain window area to obtain an accurate digital domain window area image, wherein the accurate digital domain window area image comprises a plurality of characters.
Because the digital character wheel image shot by the camera comprises a digital domain window area and a blank interference area positioned on the periphery of the digital domain window area, the digital domain window area is a position for displaying metering data, the metering data is generally 0 to 9, and the blank interference area on the periphery of the digital domain window area is a useless area, and the digital domain window area in the collected digital character wheel image must be preliminarily positioned for identifying the number on the character wheel, and then the edge interference area of the preliminarily positioned digital domain window area is removed to obtain an accurate digital domain window area image.
S103, performing character segmentation on the accurate window area image of the digital domain to obtain a single character image.
Specifically, characters in the window area image of the digital domain are sequentially arranged at intervals from left to right, and the character identification is character-by-character identification, so that the window area image of the digital domain must be firstly subjected to character segmentation to obtain a single character image, then binarized by adopting a local binarization algorithm, and then subjected to connected domain analysis to remove a noise interference area and then identified.
And S104, identifying each single character image by using a machine learning method. That is, the recognition judges which number of 0 to 9 the character is.
According to the reading identification method for the metering instrument, a digital domain window area in a digital character wheel image is preliminarily positioned, and an edge interference area outside the digital domain window area is removed to obtain an accurate digital domain window area image, wherein the accurate digital domain window area image comprises a plurality of characters; performing character segmentation on the accurate window area image of the digital domain to obtain a single character image; the single character images are recognized by a machine learning method, so that the reading of the measuring instrument can be recognized, the recognition accuracy is high, and the popularization and the application on the counting of instruments such as water, electricity, gas and heat instruments can be ensured.
Referring to fig. 2, fig. 2 illustrates another implementation flow of a method for identifying reading of a metering device according to an embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown. Specifically, the reading identification method of the metering device comprises the following steps:
s201, acquiring a digital character wheel image acquired by the camera.
The camera is generally installed at a certain distance position in front of the dial plate of the metering instrument, and the camera collects digital character wheel images to pass back after receiving a collection instruction.
S202, detecting the upper and lower boundary lines of a digital domain window area in the digital character wheel image by a vertical direction gradient method.
Specifically, metering device's structure includes dial plate and count number wheel, is equipped with the window on the dial plate, and count number wheel just is located the window. Based on the structure of the metering instrument, in the digital character wheel image collected by the camera, corresponding upper, lower, left and right boundary lines can be formed corresponding to the window edge on the dial plate, so that the upper and lower boundary lines in the digital domain window area can be known by detecting the upper and lower boundary lines in the digital domain window area.
And S203, detecting the left and right boundary lines of the digital domain window area after the upper and lower boundary lines are determined by a horizontal gradient method.
That is, the window region of the digital domain is generally a substantially rectangular shape, and after the upper and lower boundary lines of the window region of the digital domain are determined, the left and right boundary lines of the window region of the digital domain are detected to know the left and right boundary lines of the window region of the digital domain.
S204, preliminarily positioning the digital domain window area according to the determined upper, lower, left and right boundary lines, and cutting to form a digital domain window area image.
That is, after the upper, lower, left and right boundaries of the digital domain window area on the image are determined, the digital domain window area image can be cut by cutting according to the upper, lower, left and right boundaries.
It should be noted that, the digital character wheel image shot by the camera includes a digital domain window area and a blank interference area located at the periphery of the digital domain window area, the digital domain window area is a position for displaying the metering data, the metering data is generally composed of ten characters from 0 to 9, and the blank interference area at the periphery of the digital domain window area is a useless area. Therefore, the digital window area image can be obtained by positioning and cutting through the steps S202 to S204.
S205, carrying out global binarization primary processing on the digital domain window area image and eliminating an edge interference area by adopting a connected domain analysis method to obtain an accurate digital domain window area image.
When the camera collects images, interference pixel points and/or interference areas exist in the collected digital character wheel images possibly due to factors such as brightness and environment, positioning and cutting are carried out to obtain digital domain window area images, some interference pixel points and/or interference areas also exist in the digital domain window area images, especially edge areas of the digital domain window area images just cut exist obvious interference areas which can influence character recognition, therefore, after global binarization initial processing is carried out on the digital domain window area images, the edge interference areas of the digital domain window area images after binarization are removed by using a connected domain analysis method, and then accurate digital domain window area images are obtained.
And S206, carrying out global binarization reprocessing on the accurate digital domain window area image by using a global binarization algorithm. That is, this step requires global binarization again for the precise window area image in the digital domain, resulting in a more standard binarized image.
S207, noise elimination is carried out on the accurate digital domain window area image after global binarization reprocessing, so that an interference area on the accurate digital domain window area image is eliminated. That is, in step S208, the noise processing is performed to remove the interference pixel points in the window area image in the digital domain, where the interference pixel points mainly refer to pixel points near the character position, and the edge interference area in step S205 refers to pixel points at the edge of the image.
And S208, performing character segmentation on the character area in the accurate digital domain window area image by adopting a vertical projection method to obtain the left and right boundaries of each character, and cutting out a single character image.
Since the characters in the numeric field window area image are sequentially arranged at intervals from left to right, each character corresponds to one character image through a single character image formed by splitting the precise numeric field window area image. Therefore, the single character image can be recognized, and the recognition accuracy of the single character image is improved.
S209, carrying out binarization on the cut single character image by using a local binarization algorithm, and eliminating noise points and interference areas by using a priori knowledge and a connected domain analysis method. That is, in step S209, the single character recognition area is further binarized, and further, the interference pixels and the interference area in the single character image are eliminated, so that the character recognition in the subsequent step is facilitated, and the character recognition efficiency and accuracy are improved.
And S210, identifying each single character image by using a machine learning method. That is, a single character image is recognized, and it is recognized which number of 0 to 9 the character in the character image is.
That is to say, in this embodiment, after the window area image in the digital domain is formed, the initial global binarization processing and the noise elimination processing are performed on the window area image in the whole digital domain, then the subsequent global binarization reprocessing and the further noise elimination are performed, then the window area image in the digital domain is further subjected to projection segmentation to form a single character image, then the subsequent local binarization and the noise elimination processing are performed on the single character image, and finally, the single character image after the local binarization and the noise elimination processing is identified. By adopting the processing method, the identification precision can be greatly improved, and the reliability of reading data is ensured.
It is understood that, in some embodiments of the present invention, step S210, the identification of each of the single character images using a machine learning method: and identifying each single character by adopting a neural network algorithm and combining the geometrical prior knowledge characteristics of each character.
According to the reading identification method for the metering instrument, a digital domain window area in a digital character wheel image is preliminarily positioned, and an edge interference area outside the digital domain window area is removed to obtain an accurate digital domain window area image, wherein the accurate digital domain window area image comprises a plurality of characters; performing character segmentation on the accurate window area image of the digital domain to obtain a single character image; and identifying each single character image by adopting a machine learning method. So, can realize the discernment of measurement appearance meter reading, moreover, the accuracy of discernment is high, can ensure to popularize and apply on water, electricity gas meter count.
Referring to fig. 3, fig. 3 illustrates a meter reading identification apparatus provided by an embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown. Specifically, the device for recognizing the reading of the metering device provided by the embodiment of the present invention includes:
an obtaining module 301, configured to obtain a digital print wheel image acquired by a camera;
the positioning unit 302 is configured to perform initial positioning on a digital domain window area in the digital character wheel image, and then eliminate an edge interference area outside the digital domain window area to obtain an accurate digital domain window area image, where the accurate digital domain window area image includes a plurality of characters;
a character segmentation unit 303, configured to perform character segmentation on the accurate window region image in the number domain to obtain a single character image;
a recognition unit 304, configured to recognize each of the single character images by using a machine learning method.
Referring to fig. 4, in an embodiment of the present invention, the positioning unit 302 specifically includes:
a first detecting module 3021, configured to detect upper and lower boundary lines of a digital window area in the digital print wheel image by using a vertical gradient method;
a second detecting module 3022, configured to detect left and right boundary lines of the window area of the digital domain after determining the upper and lower boundary lines by using a horizontal gradient method;
a cropping module 3023, configured to preliminarily position the window area in the digital domain according to the determined upper, lower, left, and right boundary lines, and crop the window area to form an image of the window area in the digital domain;
and the primary processing module 3024 is configured to perform global binarization primary processing on the window area image in the digital domain and remove an edge interference area by using a connected domain analysis method, so as to obtain an accurate window area image in the digital domain.
Referring to fig. 5, in an embodiment of the present invention, the character segmentation unit 303 specifically includes:
a global binarization module 3031, configured to perform global binarization reprocessing on the accurate digital domain window area image by using a global binarization algorithm;
a noise elimination module 3032, configured to perform noise elimination on the accurate window area image after global binarization reprocessing, so as to remove an interference area on the accurate window area image;
a character segmentation module 3033, configured to perform character segmentation on the character region in the accurate window region image in the digital domain by using a vertical projection method, so as to obtain left and right boundaries of each character, and cut out a single character image;
a local binarization module 3034, configured to binarize the clipped single character image by using a local binarization algorithm and eliminate noise points and interference areas by using a priori knowledge and a connected domain analysis method.
It is to be understood that the identification unit 304 is specifically configured to: and identifying each single character by adopting a neural network algorithm and combining the geometrical prior knowledge characteristics of each character.
It should be noted that the reading identification apparatus for a metering device in the embodiment of the present invention may be used to implement all technical solutions in the above method embodiments, and the functions of each functional unit may be specifically implemented according to the method in the above method embodiments, and the specific implementation process may refer to the relevant description in the above method embodiments, and is not described herein again.
According to the reading identification device of the metering instrument, a digital domain window area in a digital character wheel image is preliminarily positioned, and an edge interference area outside the digital domain window area is removed to obtain an accurate digital domain window area image, wherein the accurate digital domain window area image comprises a plurality of characters; performing character segmentation on the accurate window area image of the digital domain to obtain a single character image; and identifying each single character image by adopting a machine learning method. So, can realize the discernment of measurement appearance meter reading, moreover, the accuracy of discernment is high, can ensure to popularize and apply on water, electricity gas meter count.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device or system type embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the use of the phrase "comprising a. -. said" to define an element does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.