A kind of based on the water, electricity and gas meter reading automatic identifying method rolling couplingTechnical field
The present invention relates to data identification, particularly relate to a kind of based on rolling the water, electricity and gas meter reading automatic identifying method mated, belong to automation instrument and digital image processing field.
Background technology
At present, checking meter of the electric table of domestic use of water, in addition to ammeter, substantially still manual metering, all the more so especially for old-fashioned water meter.Manual metering needs staff to enter every household, checks aqueous vapor ammeter, records data, inputs computer, computational costs, reinforms subscriber payment;The method wastes time and energy, and labor intensity is big, and labour cost is high, and owing to resident family stays out, it is difficult to ensure to obtain aqueous vapor ammeter data on time.
By digital identification techniques, the most automatically obtain water power gas meter data, it is to avoid the problems of manual metering become technical problem in the urgent need to address on time.But the template matching technique of current template cannot carry out correct identification by double character, and water power gas meter dial reading is the most all rolling, the probability of half character occurred is the highest, dial reading from left to right counts, and general units on the right, is tens the most successively, hundreds, thousands digits etc., can not accurately read if in water power gas meter dial reading, will directly affect the application that digital identification techniques counts at water power gas meter.
Summary of the invention
The problem that it is an object of the invention to overcome prior art manual metering, it is provided that a kind of counting is accurately, time saving and energy saving, can obtain the water, electricity and gas meter reading automatic identifying method based on rolling coupling of water power gas meter data on time.
The object of the invention is realized by following technical elements:
A kind of based on rolling the water, electricity and gas meter reading automatic identifying method mated, comprise the following steps:
(1) the real time billing data picture of photographic head timing acquiring water power gas meter, is sent to Single Chip Microcomputer (SCM) system by data wire;
(2) Single Chip Microcomputer (SCM) system carries out image binaryzation, location, charging digital block, noise filtering, Character segmentation and the judgement of half character, the all-character after being split and half character photo to the metering data photo gathered;
(3) all-character to be identified and half character photo are normalized to template character boundary, and prospect preserves between two parties;Described prospect is character stroke region, and in prospect, pixel represents with 1, and non-character stroke region is background, and in background, pixel represents with 0;
(4) for half character photo after normalization, calculate the line-spacing in the middle of upper and lower two and half characters of half character photo to be identified, copy the form of data band in water power gas meter, according to the end to end order of adjacent character and the character pitch of character picture to be identified, by the 0-9 longitudinally connected Form board tape circlewise of ten template character matrixs;
(5) from the beginning of first template character 0, the annular die that scrolls up in units of pixel strip, the character in corresponding ring-type Form board tape position is carried out matching rate calculating with input character picture;After the annular die that the most once scrolls up strip, move left and right character to be identified or 0-K location of pixels of half character picture respectively, calculate the matching rate of character and the input character picture every time moving left and right in rear corresponding templates band position;Roll ring-type Form board tape again, until annular die strip is returned to template character 0 position;The value of described integer K determines, less than template width according to template dot matrix size;Matching rate C=α × (character to be identified or half character prospect count with the pixel that overlaps of template the non-zero pixels of M/ Character mother plate count)+(1-the α) × non-zero pixel number of M/ input picture (character to be identified or the half character prospect count with the pixel that overlaps of template);α is empirical value;After the coincidence number M of pixel is for the most once moving up or move left and right, character to be identified or half character image lattice are multiplied with the data of character scroll template correspondence position dot matrix, and income value that this result of product is added up;
(6) with matching rate result that Dynamic Array record is each;By comparing, select the result that matching rate is maximum, determine the template position corresponding to maximum result, determine with this and input the template character that character picture mates most;The character that ring-type Form board tape is corresponding is exported for all-character;For half character, with numeral corresponding to upper semisection half character of annular die strip corresponding region for output result;
(7) for the all-character to be identified being partitioned into and half character digital picture, from left to right it is sequentially output identification numeric results according to corresponding dial reading picture, obtains the charging reading of water power gas meter.
Further, location, described charging digital block is dial reading position in specific bit metering data photo.Described noise filtering includes filtering Gaussian noise, salt-pepper noise and other noise.Described Character segmentation be by noise filtering after metering data photo in dial reading become isolated character by column split.Described half character refers to the character that can not completely show in metering data photo, and character is the Arabic numerals of 0-9.Described template character refers to that water power gas meter to be identified is fallen into a trap the computer representation of the pixel-matrix picture of font used by 0-9 in expense reading numeric area.The order that described data band refers to fall into a trap water power gas meter 0-9 in expense reading numeric area shows.Described moving left and right refers to character to be identified or half character picture are moved to the left 0-K location of pixels, in order to carry out matching primitives;Returning the position before being moved to the left, move right 0-K location of pixels the most again to character to be identified or half character picture, in order to carries out matching primitives.Described timing is according to one or many in January or time of once determining for many months.
In the matching process of character, encountering target character right and left sometimes has the situation being adhered noise to occur.Because being adhered noise can affect the translation placed in the middle process of input character picture, so, character to be identified now is not often the center position being in matrix.The most at this moment need to combine Form board tape and move left and right the matching process of K the picture width of character to be identified (K of the present invention can at most get) location of pixels, find out the matching area that template character is optimal with character to be identified.Again because computer is different from human eye and has thinking arbitration functions, therefore, each character to be identified is required for using the scroll-up/down of Form board tape and moving left and right the method combined mating.
The computational methods of matching rate have a variety of, and the present invention uses matching degree weighting algorithm, and template character and target character matching rate on overlapping positions are with formula i.e. every time: C=a × P1+b×P2Calculate.A, b are weight coefficients, a+b=1.In the present invention, a=0.59, b=0.41, but it is not limited to this.P in formula1、P2It is defined respectively as:
P1: character to be identified or half character prospect are counted with the pixel that overlaps of template the ratio that the non-zero pixels of M and Character mother plate is counted.
P2: character to be identified or half character prospect are counted with the pixel that overlaps of template the ratio of non-zero pixel number of M and input picture.
Compared with prior art, the invention have the advantages that
(1) there is the phenomenon of half character of appearance due to the dial plate of the table tools such as water meter, current template matching technique cannot carry out correct identification by double character, the present invention makes 0 to 9 in totally ten standard character templates, adjacent Character mother plate joins end to end, wherein 0 it is connected with each other with 9, form a ring-type standard character annular die strip, the data band rotated as water, electricity and gas the exterior and the interior.Utilize data band rotary principle, roll Character mother plate band, make ten templates carry out omnibearing displacement field match with input character picture respectively;And employ and when brand-new circular template rolls, combine left and right displacement coupling, find suitable matching area territory and the highest template position of the goodness of fit, it is possible to identify half character being rolled on diverse location exactly.
(2) present invention solves manual metering problem by the method for image understanding, and this kind of technology has versatility, and the enumeration data that may be used for various dial plate reads, it is achieved Common & automatic meter reading charging.
(3) hardware that the inventive method utilizes is simple, easily realizes.
Accompanying drawing explanation
Fig. 1 is based on the water, electricity and gas meter reading automatic identifying method FB(flow block) rolling coupling.
Fig. 2 is the pattern of half character.
Fig. 3-Figure 12 is the partial routine displaying schematic diagram that annular die strip is rolled to 3 from 0.Wherein, Fig. 3 is circular template band original position;Fig. 4 be annular die strip when rolling the 9th time template character 0 during being rolled to template character 1, the schematic diagram of matching area during half occurs;Fig. 5 is annular die strip matching area schematic diagram when rolling the 20th time;Fig. 6 is annular die strip matching area schematic diagram when rolling the 29th time;Fig. 7 is annular die strip matching area schematic diagram when rolling the 40th time;Fig. 8 is annular die strip matching area schematic diagram when rolling the 43rd time;Fig. 9 is annular die strip matching area schematic diagram when rolling the 46th time;Figure 10 is annular die strip schematic diagram matching area schematic diagram when rolling the 48th time;Figure 11 is annular die strip matching area schematic diagram when rolling the 50th time;Figure 12 is annular die strip matching area schematic diagram when rolling the 52nd time.
Detailed description of the invention
For being more fully understood that the present invention, the present invention is further illustrated below in conjunction with the accompanying drawings, but the scope of protection of present invention is not limited to the scope of embodiment statement.
Mainly it is made up of optical capturing equipment (photographic head) and Single Chip Microcomputer (SCM) system based on the water, electricity and gas meter reading automatic recognition system hardware rolling coupling;Photographic head is installed on water power gas meter, and photographic head connects Single Chip Microcomputer (SCM) system by data wire, and Single Chip Microcomputer (SCM) system mainly includes embedded type control module, image procossing and identification module, power supply etc..Embedded type control module completes to manage for the control of whole system, and system Power-On Self-Test, duty indicates, Data Transmission Controlling etc.;Image procossing and identification module are responsible for realizing image denoising, normalization, Character segmentation, character recognition, result output etc..The present invention is automatically identified by Single Chip Microcomputer (SCM) system based on the water, electricity and gas meter reading rolling coupling and realizes.
As it is shown in figure 1, a kind of based on rolling the water, electricity and gas meter reading automatic identifying method mated, comprise the following steps:
(1) photographic head (being arranged on water power gas meter) is according to payment needs, regularly (such as one or many in January or many months once) gathers the real time billing data picture of water power gas meter, is sent to Single Chip Microcomputer (SCM) system by data wire.
(2) according to routine data preprocess method, Single Chip Microcomputer (SCM) system carries out image binaryzation, location, charging digital block, noise filtering, Character segmentation and half character to the metering data photo gathered and judges, the all-character after being split and half character photo;Wherein, location, charging digital block is dial reading position in specific bit metering data photo.Noise filtering includes filtering Gaussian noise, salt-pepper noise and other noise.Character segmentation be by noise filtering after metering data photo in dial reading become isolated character by column split;Half character refers to the character that can not completely show in metering data photo, such as Fig. 2,4,6, the character that can not completely show in Fig. 8-12;Here character refers to Arabic numerals.Being arranged by photographic head, charging digital block positions, and after Character segmentation, every character picture the most at most only has two characters that can not completely show.All-character refers to the Arabic numerals completely shown;Half character is the Arabic numerals that part shows.
(3) all-character to be identified and half character photo being normalized to template character boundary, prospect preserves between two parties;Character stroke region is prospect, and in prospect, pixel represents with 1, and non-character stroke region is background, and in background, pixel represents with 0;Template character refers to that water power gas meter to be identified is fallen into a trap the computer representation of the pixel-matrix picture of font used by 0-9 in expense reading numeric area.
(4) for half character photo after normalization, calculate the line-spacing in the middle of upper and lower two and half characters of half character photo to be identified, copy the form of data band in water power gas meter, according to the end to end order of adjacent character and the character pitch of character picture to be identified, by the 0-9 longitudinally connected Form board tape circlewise of ten template character matrixs;The order that data band refers to fall into a trap water power gas meter 0-9 in expense reading numeric area shows.
(5) from the beginning of first template character 0, the combination that scrolls up moves left and right annular die strip, and with circular template band, input character and half character picture are carried out registration matching primitives;During the annular die strip that scrolls up, the displacement every time rolled is in units of a pixel, after rolling a pixel unit, image after rolling input picture and annular die strip carries out images match, by that analogy, constantly roll ring-type Form board tape, gradually input picture is mated, until annular die strip is returned to template character 0 position;Combine Form board tape while the annular die that scrolls up strip and move left and right character to be identified or 0-K location of pixels of half character picture, calculate the matching rate of character and the input character picture rolling every time or moving left and right in rear corresponding templates band position, i.e. registration, the value of described integer K determines, less than template width according to template dot matrix size;K of the present invention can at most get the picture width of character to be identified.Move left and right and refer to all-character to be identified or half character picture are moved to the left 0-K location of pixels, in order to carry out matching primitives;Returning the position before being moved to the left, move right 0-K location of pixels the most again to character to be identified or half character picture, in order to carries out matching primitives.While the coupling that scrolls up, in order to avoid owing to there being half character being adhered noise, the inaccurate matching result brought, also move left and right.
(6) after the most once moving up or move left and right, character to be identified or half character picture are multiplied with the data of character scroll template correspondence position dot matrix, and this result of product is added up, for calculating the coincidence number M of pixel;Coincidence number M according to pixel calculates matching rate C;Matching rate C=α × (coincidence pixel count the non-zero pixels of M/ Character mother plate count)+(1-the α) × non-zero pixel number of M/ input picture (the coincidence pixel count);α is test value or empirical value, can test for different types of water power gas meter and different types of photographic head and obtain, and α is the positive number less than 1;
(7) with matching rate result that Dynamic Array record is each;By comparing, select the result that matching rate is maximum, determine the template position corresponding to maximum result, determine with this and input the template character that character picture mates most;The character that ring-type Form board tape is corresponding is exported for all-character;For half character, numeral corresponding to upper semisection half character of the annular die strip corresponding region to determine is for output result;It is namely this output character with numeral less in half character.
(8) for the all-character to be identified being partitioned into and half character digital picture, from left to right it is sequentially output identification numeric results according to corresponding dial reading picture, obtains the charging reading of water power gas meter.
Fig. 2 is the sample instance randomly drawed from the experimentation of the present invention, is that data of water meter band gathers when being rolled between 2 and 3.As shown in figure Fig. 3-Figure 12, the partial routine that Fig. 2 carries out rolling coupling is shown.Fig. 3-Figure 12 is that annular die strip is rolled to 3 partial routine displaying schematic diagrams from 0.Wherein, Fig. 3 is circular template band original position;Fig. 4 be annular die strip when rolling the 9th time template character 0 during being rolled to template character 1, the schematic diagram of matching area during half occurs;Fig. 5 is annular die strip matching area schematic diagram when rolling the 20th time;Fig. 6 is annular die strip matching area schematic diagram when rolling the 29th time;Fig. 7 is annular die strip matching area schematic diagram when rolling the 40th time;Fig. 8 is annular die strip matching area schematic diagram when rolling the 43rd time;Fig. 9 is annular die strip matching area schematic diagram when rolling the 46th time;Figure 10 is annular die strip schematic diagram matching area schematic diagram when rolling the 48th time;Figure 11 is annular die strip matching area schematic diagram when rolling the 50th time;Figure 12 is annular die strip matching area schematic diagram when rolling the 52nd time, and circular template now and the matching rate of sample are also the highest (at this moment the registration of the stroke of the sample that the stroke in Figure 12 is to be identified with Fig. 2 are the highest, i.e. the goodness of fit is the highest).Visible, no matter dial plate data band forwards that position to, and the present invention can find the position that circular template and target image mate most, thus reaches the purpose of identification.
Owing to the dial plate of the table tools such as water meter exists the phenomenon of half character of appearance, current template matching technique cannot carry out correct identification by double character, the present invention makes 0 to 9 in totally ten standard character templates, adjacent Character mother plate joins end to end, wherein 0 it is connected with each other with 9, form a ring-type standard character annular die strip, the data band rotated as water, electricity and gas the exterior and the interior.Utilize data band rotary principle, roll Character mother plate band, make ten templates carry out omnibearing displacement field match with input character picture respectively;And employ brand-new circular template roller and combine left and right displacement coupling, find suitable matching area territory and the highest template of the goodness of fit, it is possible to identify half character being rolled on diverse location exactly.
The inventive method can be applicable to water power gas meter, but is not limited to this it can also be used to the automatic of reading of other similar tables tool identifies.