CN107220640A - Character identifying method, device, computer equipment and computer-readable recording medium - Google Patents

Character identifying method, device, computer equipment and computer-readable recording medium Download PDF

Info

Publication number
CN107220640A
CN107220640A CN201710369090.5A CN201710369090A CN107220640A CN 107220640 A CN107220640 A CN 107220640A CN 201710369090 A CN201710369090 A CN 201710369090A CN 107220640 A CN107220640 A CN 107220640A
Authority
CN
China
Prior art keywords
character
picture
identification result
pretreatment
bianry image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710369090.5A
Other languages
Chinese (zh)
Other versions
CN107220640B (en
Inventor
廖伟权
余卫宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GUANGZHOU EPBOX INFORMATION TECHNOLOGY Co Ltd
Original Assignee
GUANGZHOU EPBOX INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GUANGZHOU EPBOX INFORMATION TECHNOLOGY Co Ltd filed Critical GUANGZHOU EPBOX INFORMATION TECHNOLOGY Co Ltd
Priority to CN201710369090.5A priority Critical patent/CN107220640B/en
Publication of CN107220640A publication Critical patent/CN107220640A/en
Application granted granted Critical
Publication of CN107220640B publication Critical patent/CN107220640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/146Aligning or centring of the image pick-up or image-field
    • G06V30/1475Inclination or skew detection or correction of characters or of image to be recognised
    • G06V30/1478Inclination or skew detection or correction of characters or of image to be recognised of characters or characters lines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Abstract

The present invention relates to a kind of character identifying method, device, computer equipment and computer-readable recording medium.The method comprising the steps of:Character picture to be identified is obtained, gray processing processing is carried out to the character picture to be identified, pretreatment character picture is obtained;Default character recognition model is inputted using the pretreatment character picture as an entirety, the first character identification result of pretreatment character picture is calculated by the character recognition model;The pretreatment character picture is rotated several times, the character recognition model will be inputted as an entirety by postrotational pretreatment character picture every time, the second character identification result of postrotational pretreatment character picture is calculated every time by the character recognition model;The character in the character picture to be identified is drawn according to first character identification result and second character identification result, the degree of accuracy of character recognition is the method increase.

Description

Character identifying method, device, computer equipment and computer-readable recording medium
Technical field
The present invention relates to technical field of image processing, more particularly to character identifying method, character recognition device, computer Equipment and computer-readable recording medium.
Background technology
With the development of science and technology, the use of character recognition technologies is more universal, it can reduce or replace cumbersome word Input.For example, for an image for including character, user passes through character recognition technologies, such as OCR (Optical Character Recognition, optical character identification), it is possible to the character in the image is identified, then basis is identified Character the operation such as retrieved or translated.But when the character recognition technologies in using conventional art carry out character recognition Generally require and split the character in image, and because Characters Stuck easily causes the misrecognition of character during Character segmentation, Therefore the character recognition degree of accuracy is not high.
The content of the invention
Based on this, it is necessary to for there is provided a kind of character recognition the problem of the character recognition degree of accuracy is not high in conventional art Method, device, computer equipment and computer-readable recording medium, overall identification can be carried out to character picture, word is improved Accord with the degree of accuracy of identification.
A kind of character identifying method, including step:
Character picture to be identified is obtained, gray processing processing is carried out to the character picture to be identified, pretreatment character is obtained Image;
Default character recognition model is inputted using the pretreatment character picture as an entirety, by the character recognition Model calculates the first character identification result of pretreatment character picture, wherein instruction of the character recognition model by character picture Practice sample set training setting neural network model generation;
The pretreatment character picture is rotated several times, one will be used as by postrotational pretreatment character picture every time Individual entirety inputs the character recognition model, and each postrotational pretreatment character picture is calculated by the character recognition model The second character identification result;
The character picture to be identified is drawn according to first character identification result and second character identification result In character.
Above-mentioned character identifying method, pre-sets character recognition model, then will be overall after character picture to be identified processing Character recognition model is inputted, overall identification is carried out to character picture by character recognition model, it is no longer necessary to carry out Character segmentation, So as to avoid the misrecognition caused during Character segmentation due to Characters Stuck, the degree of accuracy of character recognition, this method are improved Effective robust, with larger application value.
In one embodiment, according to being drawn first character identification result and second character identification result Character in character picture to be identified includes:If first character identification result is identical with each second character identification result, Calculate the length-width ratio of the pretreatment character picture before rotation and the length-width ratio of each postrotational pretreatment character picture;Calculate The character total length of first character identification result or the second character identification result;If all length-width ratios are all higher than the word The product of symbol total length and the first ratio and the product for being less than the character total length and the second ratio, first character is known Other result or the second character identification result as the character picture to be identified character identification result.In view of working as character picture Pixel it is more symmetrical when, it is consistent to easily cause each recognition result, can be wrong if at this moment occurring in that misrecognition As a result final output is treated as, and by the comparison of length-width ratio and character total length, then it is possible to prevente effectively from the problem, is further sieved Select correct recognition result.
In one embodiment, the character picture to be identified is carried out after gray processing processing, obtains pretreatment character Before image, in addition to step:Image binaryzation is carried out to the character picture to be identified after gray processing, bianry image is obtained;It is right The bianry image carries out image normalization.
In one embodiment, carrying out image normalization to the bianry image includes:The bianry image is adjusted to The pattern of black background white characters.
In one embodiment, the pattern for the bianry image being adjusted into black background white characters includes:Obtain institute State the first profile of the white portion in bianry image;Black and white upset processing is carried out to the bianry image, obtained after upset Second profile of the white portion in bianry image;The Breadth Maximum and second profile of the first profile are calculated respectively Breadth Maximum;If the Breadth Maximum of the first profile is less than the Breadth Maximum of second profile, retain before black and white upset Bianry image, otherwise retains the bianry image after black and white upset.
In one embodiment, carrying out image normalization to the bianry image also includes:By the side of the bianry image Boundary is removed, and the bianry image removed behind border is zoomed into pre-set dimension.
In one embodiment, the border of the bianry image is removed includes:Water-filling is entered respectively to the bianry image Flat integral projection and vertical integral projection;The row pixel of the bianry image after horizontal integral projection is traveled through, the row picture is obtained Starting line number and end line number in element;The row pixel of the bianry image after vertical integral projection is traveled through, the row picture is obtained Starting columns and end columns in element;According to starting line number, terminate line number, starting columns and the end columns setting two-value Area-of-interest in image, will remove the overseas border of region of interest and removes in the bianry image.
A kind of character recognition device, including:
Character picture pretreatment module, for obtaining character picture to be identified, ash is carried out to the character picture to be identified Degreeization processing, obtains pretreatment character picture;
First character recognition module, knows for the pretreatment character picture to be inputted into default character as an entirety Other model, the first character identification result of pretreatment character picture is calculated by the character recognition model, wherein the character Identification model is generated by the training sample set training setting neural network model of character picture;
Second character recognition module, for being rotated several times to the pretreatment character picture, after rotating every time Pretreatment character picture as entirety input the character recognition model, calculated every time by the character recognition model Second character identification result of postrotational pretreatment character picture;
Character identification result determining module, for according to first character identification result and the second character recognition knot Fruit draws the character in the character picture to be identified.
Above-mentioned character recognition device, pre-sets character recognition model, then will be overall after character picture to be identified processing Character recognition model is inputted, overall identification is carried out to character picture by character recognition model, it is no longer necessary to carry out Character segmentation, So as to avoid the misrecognition caused during Character segmentation due to Characters Stuck, the degree of accuracy of character recognition is improved, the character The effective robust of identifying device, with larger application value.
A kind of computer equipment, including memory, processor and storage can be run on a memory and on a processor Computer program, the step of above-mentioned any one methods described is realized during the computing device described program.
Above computer equipment, pre-sets character recognition model, then will be overall defeated after character picture to be identified processing Enter character recognition model, overall identification is carried out to character picture by character recognition model, it is no longer necessary to carry out Character segmentation, from And the misrecognition caused during Character segmentation due to Characters Stuck is avoided, the degree of accuracy of character recognition is improved, the computer The effective robust of equipment, with larger application value.
A kind of computer-readable recording medium, is stored thereon with computer program, and the computer program is executed by processor The step of Shi Shixian above-mentioned any one methods describeds.
Above computer readable storage medium storing program for executing, pre-sets character recognition model, then handles character picture to be identified Overall input character recognition model, carries out overall identification to character picture, it is no longer necessary to carry out word by character recognition model afterwards Symbol segmentation, so that the misrecognition caused when avoiding Character segmentation due to Characters Stuck, improves the degree of accuracy of character recognition, The effective robust of the computer-readable recording medium, with larger application value.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the character identifying method of an embodiment;
Fig. 2 utilizes the schematic flow sheet of character recognition Model Identification character for the test phase of a specific embodiment;
Fig. 3 is the schematic flow sheet that bianry image is adjusted to white with black printed words formula of an embodiment;
Fig. 4 is the schematic flow sheet that border is removed to bianry image of an embodiment;
Fig. 5 is the schematic flow sheet of the character identifying method of another embodiment;
Fig. 6 is the schematic flow sheet of the character identifying method of a specific embodiment;
Fig. 7 is the structural representation of the character recognition device of an embodiment;
Fig. 8 is the structural representation of the computer equipment of an embodiment.
Embodiment
It is below in conjunction with the accompanying drawings and preferably real further to illustrate the effect of the technological means of the invention taken and acquirement Example is applied, to technical scheme, clear and complete description is carried out.
As shown in figure 1, there is provided a kind of character identifying method, including step in one embodiment:
S110, acquisition character picture to be identified, carry out gray processing processing to the character picture to be identified, are pre-processed Character picture;
Character picture to be identified is the image for needing to recognize character.Gray processing processing is carried out to images to be recognized can root Realized according to existing mode in the prior art, to image obtain the pretreatment word of character picture to be identified after gray processing processing Accord with image.
S120, the pretreatment character picture as entirety inputted into default character recognition model, by the word Symbol identification model calculates the first character identification result of pretreatment character picture, wherein the character recognition model is by character figure The training sample set training setting neural network model generation of picture;
Default character recognition model sets the model that neural network model is generated to be trained by training sample set, character Identification model is used to carry out character recognition to character picture to be identified.Setting neural network model has polytype, optionally, if Neural network model is determined for BP (Back Propagation, backpropagation) neural network model.Training sample set includes multiple Character picture training sample, optionally, after original character image is obtained, gray processing, binaryzation is carried out to original character image With normalization etc. a series of processing, obtain character picture training sample.It is not that character picture, which is pre-processed, as an entirety input Need to carry out Character segmentation to pretreatment character picture, character recognition is carried out directly as an entirety.Character figure will be pre-processed As being inputted as an entirety after character recognition model, character recognition model obtains character identification result A.
S130, to it is described pretreatment character picture rotated several times, will every time postrotational pretreatment character picture The character recognition model is inputted as an entirety, each postrotational pretreatment word is calculated by the character recognition model Accord with the second character identification result of image;
The number of times that pretreatment character picture is rotated can be determined according to actual needs, each postrotational pretreatment Character picture inputs character recognition model, obtains every time the character identification result of postrotational pretreatment character picture.For example, Due to pretreatment character picture be likely to be just put or it is counter put, therefore the direction of character can not be determined, so, as shown in Fig. 2 In one embodiment, three rotations can be carried out to pretreatment character picture:90 is turned clockwise to pretreatment character picture A Degree obtains pretreatment character picture B, obtains pretreatment character picture C and right to pretreatment character picture A dextrorotation turnbacks Pretreatment character picture C dextrorotations, which are turn 90 degrees, to be obtained pre-processing character picture D, and pretreatment character picture A is pre- in S120 Processing character image.Three postrotational pretreatment character pictures are inputted into character recognition model respectively, you can to obtain character Recognition result B, character identification result C and character identification result D.
S140, the character to be identified drawn according to first character identification result and second character identification result Character in image.
The character identifying method that the present embodiment is provided can realize that program is run in the terminal by corresponding program, For example in mobile phone, tablet personal computer or computer.This method carries out overall identification to character picture region, eliminates Character segmentation The step for, it is to avoid the misrecognition caused during Character segmentation due to Characters Stuck, effective robust, with larger application valency Value.In addition, comparison of this method by each character identification result after image rotation, effectively prevent due to terminal modes of emplacement The error of character recognition caused by difference, improves the accurate probability of actual identification.
In order to further improve the degree of accuracy of character recognition, in one embodiment, the character picture to be identified is entered After the processing of row gray processing, obtain before pre-processing character picture, in addition to step:To the character picture to be identified after gray processing Image binaryzation is carried out, bianry image is obtained;Image normalization is carried out to the bianry image.It should be noted that of the invention This is not limited, can also only carry out the operation of image binaryzation, or only carry out the operation of image normalization, and or Person also carried out outside image binaryzation and image normalization the processing of other images.
Image binaryzation is exactly that the gray value of the pixel on image is set into 0 or 255, that is, is in by whole image Reveal obvious black and white effect.The binaryzation of image is conducive to the further processing of image, image is become simple, and data Amount reduces, and can highlight the profile of target interested.Image binaryzation has a variety of implementations, optionally, is calculated using big Tianjin Method realizes image binaryzation.
Image normalization is exactly that (finding one group of parameter using the not bending moment of image can disappear by a series of conversion The influence converted except other transforming function transformation functions to image), pending original image is converted into corresponding sole criterion form (should Canonical form image has invariant feature to translation, rotation, scaling equiaffine conversion).Image normalization allows image to support The attack of anti-geometric transformation.Image normalization has a variety of implementations, for example, in one embodiment, to the bianry image Carrying out image normalization includes S1101:The bianry image is adjusted to the pattern of black background white characters.
As shown in figure 3, in one embodiment, the bianry image to be adjusted to the pattern bag of black background white characters Include:
S1101a, the white portion obtained in the bianry image the first profile A;
Extracting the profile of the white portion of bianry image has a variety of implementations, for example, using function CvFindContours extracts profile A.
S1101b, to the bianry image carry out black and white upset processing, obtain upset after bianry image in white portion The the second profile B divided;
It is that the white pixel point in bianry image is changed into black pixel point that black and white upset processing is carried out to bianry image, Black pixel point is changed into white pixel point simultaneously.Carry out after black and white upset, can be extracted by function cvFindContours Profile B.
S1101c, respectively calculating profile A Breadth Maximum maxw_a and profile B Breadth Maximum maxw_b;
Calculating the Breadth Maximum of profile can realize according to existing mode in the prior art.
If S1101d, profile A Breadth Maximum maxw_a are less than profile B Breadth Maximum maxw_b, retain black and white upset Preceding bianry image, otherwise retains the bianry image after black and white upset.
Bianry image before upset is the bianry image in S1101a.Due to white portion wheel when picture is black matrix wrongly written or mispronounced character The Breadth Maximum of white portion profile when wide Breadth Maximum is less than picture for white gravoply, with black engraved characters, therefore can be sentenced according to the rule Whether disconnected artwork is the pattern of black matrix wrongly written or mispronounced character, so as to adjust.
In another embodiment, carrying out image normalization to the bianry image includes S1102:To the bianry image Carrying out image normalization also includes:The border of the bianry image is removed, and the bianry image removed behind border is zoomed to Pre-set dimension.It should be noted that step S1102 and step S1101 can be performed simultaneously, an execution can also be selected.Default chi Very little to be determined according to actual needs, it is 50 pixels that bianry image for example is zoomed into height.
As shown in figure 4, in one embodiment, the border of the bianry image, which is removed, to be included:
S1102a, horizontal integral projection and vertical integral projection are carried out respectively to the bianry image;
The row pixel of the bianry image, obtains the starting in the row pixel after S1102b, the horizontal integral projection of traversal Line number and end line number;
The row pixel of the bianry image, obtains the starting in the row pixel after S1102c, traversal vertical integral projection Columns and end columns;
S1102d, the sense in starting line number, end line number, starting columns and the end columns setting bianry image Interest region (ROI, region of interest), will remove the overseas border of region of interest and removes in the bianry image.Rise Begin number, to terminate line number, starting columns and terminate the region that is fenced up of columns be area-of-interest.
It should be noted that the process of above-mentioned character picture processing to be identified is also applied for training sample in character recognition model The acquisition of this collection, that is, obtain after multiple original character images, can carry out ash to multiple original character images using aforesaid way Degreeization processing, image binaryzation and image normalization, then pass through nerve of the normalized character picture of multiple images to setting Network model is trained, and retains network model parameter, obtains character recognition model.
As shown in figure 5, in one embodiment, according to first character identification result and the second character recognition knot Fruit show that the character in the character picture to be identified includes:
If S1401, first character identification result are identical with each second character identification result, calculate pre- before rotation The length-width ratio of processing character image and the every time length-width ratio of postrotational pretreatment character picture;First character is calculated to know The character total length of other result or the second character identification result;
Due in practical, commercial to character recognition accuracy rate require it is stricter, it is therefore desirable to verification step S120 and Character identification result in step S130 is consistent, could improve the actual accurate probability of identification.Therefore need to obtain in the step Each character identification result obtained is compared, if each character identification result is consistent, retains the character identification result, It is inconsistent if there is character identification result, then give up character identification result.For example, being obtained using identification method as shown in Figure 2 Obtain four character identification results:Character identification result A, character identification result B, character identification result C and character identification result D, If character identification result A=character identification result B=character identification result C=character identification result D, retain, if four times Character identification result is inconsistent, then gives up the character identification result.
Pretreatment character picture before rotation is the pretreatment character picture in step S120.For example, as shown in Fig. 2 should Step calculates pretreatment character picture A, pretreatment character picture B, pretreatment character picture C and pretreatment character picture respectively D four length-width ratio Ratio.
Due to each character identification result all same, so only needing to according to wherein any character identification result meter once Calculate character total length StrLen.
If S1402, all length-width ratios are all higher than the product of the character total length and the first ratio and are less than the word The product of total length and the second ratio is accorded with, first character identification result or the second character identification result are waited to know as described The character identification result of other character picture.
First ratio A is less than the second ratio B, and two ratios can be determined according to actual needs.For example, A is set For 1/2, B is set to 3/2, judges whether Ratio ∈ ((1/2) * StrLen, (3/2) * StrLen) set up respectively, if each Ratio values belong in the range of this, then this character identification result is defined as to final recognition result, if part Ratio values do not belong to In the range of this, then give up the character identification result.
When pixel or the more symmetrical content of character picture, each character identification result one is easily caused Cause, if there is misrecognition, then the result of mistake can be treated as final output, and can be effective by the embodiment shown in Fig. 5 The problem is solved, correct character identification result is further filtered out.
For a better understanding of the present invention, described in detail with reference to a specific embodiment.
As shown in fig. 6, a kind of character identifying method includes training stage and test phase:
S1, training stage:
S11, acquisition include the training sample set of multiple character pictures, and gray processing is carried out to training sample set;
S12, using Otsu algorithm to after gray processing training sample set carry out image binaryzation, obtain bianry image;
S13, to bianry image carry out image normalization, including:Bianry image is adjusted to black background white characters Pattern;Border, and uniform sizes size are gone to bianry image;Wherein adjustment pattern and removal border can be according to side described above Formula is realized;
S14, the bianry image training BP neural network model after normalization is taken, and preserve neural network model parameter, extremely This character recognition model trained.
S2, test phase:
S21, acquisition character picture to be identified, gray processing is carried out to character picture to be identified;
S22, using Otsu algorithm to after gray processing character picture to be identified carry out image binaryzation, obtain binary map Picture;
S23, to bianry image carry out image normalization, including:Bianry image is adjusted to black background white characters Pattern;Border, and uniform sizes size are gone to bianry image;Wherein adjustment pattern and removal border can be according to side described above Formula is realized;
S24, take normalization after bianry image using train BP neural network model (character recognition model) progress Identification, is identified result A, with the BP nerve nets trained after then the bianry image dextrorotation after normalization is turn 90 degrees Network Model Identification is identified result B, then the BP trained will be used after the bianry image dextrorotation turnback after normalization Neural network model identification is identified result C, with instruction after then the bianry image dextrorotation rotated after 180 degree is turn 90 degrees The BP neural network Model Identification perfected is identified result D, it is ensured that the character picture of four direction recognized respectively once To four recognition results, treat that next step is determined;
S25, judge whether recognition result A=recognition result B=recognition result C=recognition results D sets up, if four identification As a result it is identical, then retain recognition result, into next step, if four recognition results are inconsistent, give up the result;
S26, the length-width ratio Ratio that four character pictures to be identified are calculated respectively and obtained recognition result character Total length StrLen.Judge whether Ratio ∈ ((1/2) * StrLen, (3/2) * StrLen) set up respectively, if all Ratio values Belong in the range of this, then this result is defined as to final recognition result, if condition is invalid, give up the result.
Based on same inventive concept, the present invention also provides a kind of character recognition device, below in conjunction with the accompanying drawings to word of the present invention The embodiment of symbol identifying device is described in detail.
As shown in fig. 7, a kind of character recognition device, including:
Character picture pretreatment module 110, for obtaining character picture to be identified, is carried out to the character picture to be identified Gray processing processing, obtains pretreatment character picture;
First character recognition module 120, for inputting default word using the pretreatment character picture as an entirety Identification model is accorded with, the first character identification result of pretreatment character picture is calculated by the character recognition model, wherein described Character recognition model is generated by the training sample set training setting neural network model of character picture;
Second character recognition module 130, for being rotated several times to the pretreatment character picture, will rotate every time Pretreatment character picture afterwards inputs the character recognition model as an entirety, is calculated often by the character recognition model Second character identification result of secondary postrotational pretreatment character picture;
Character identification result determining module 140, for according to first character identification result and second character knowledge Other result draws the character in the character picture to be identified.
The character recognition device (character classifier) that the present embodiment is provided may operate in terminal, such as mobile phone, flat In plate computer or computer.The device carries out overall identification to character picture region, and the step for eliminating Character segmentation is kept away The misrecognition caused during Character segmentation due to Characters Stuck, effective robust, with larger application value are exempted from.In addition, should Device effectively prevent caused by terminal modes of emplacement is different by the comparison of each character identification result after image rotation Character recognition error, improve the accurate probability of actual identification.
In one embodiment, character identification result determining module 140 is in first character identification result and each When two character identification results are identical, the length-width ratio of the pretreatment character picture before rotation and postrotational pretreatment every time are calculated The length-width ratio of character picture;Calculate the character total length of first character identification result or the second character identification result;If institute Some length-width ratios are all higher than the product of the character total length and the first ratio and are less than the character total length and the second ratio Product, the character of first character identification result or the second character identification result as the character picture to be identified is known Other result.When pixel or the more symmetrical content of character picture, each character identification result is easily caused unanimously, If there is misrecognition, then the result of mistake can be treated as final output, and the problem can effectively be solved by the embodiment, Further filter out correct character identification result.
In order to further improve the degree of accuracy of character recognition, in one embodiment, 110 pairs of character picture pretreatment module The character picture to be identified is carried out after gray processing processing, is obtained before pretreatment character picture, is additionally operable to after gray processing Character picture to be identified carry out image binaryzation, obtain bianry image, to the bianry image carry out image normalization.
In one embodiment, character picture pretreatment module 110 by the bianry image by being adjusted to black background The pattern of white characters carries out image normalization to the bianry image.Optionally, character picture pretreatment module 110 obtains institute State the first profile of the white portion in bianry image;Black and white upset processing is carried out to the bianry image, obtained after upset Second profile of the white portion in bianry image;The Breadth Maximum and second profile of the first profile are calculated respectively Breadth Maximum;If the Breadth Maximum of the first profile is less than the Breadth Maximum of second profile, retain before black and white upset Bianry image, otherwise retains the bianry image after black and white upset.
In one embodiment, character picture pretreatment module 110 is also by the way that the border of the bianry image is removed, and The bianry image removed behind border is zoomed into pre-set dimension image normalization is carried out to the bianry image.Optionally, character 110 pairs of bianry images of image pre-processing module carry out horizontal integral projection and vertical integral projection respectively;Traversal level is accumulated Divide the row pixel of the bianry image after projection, obtain the starting line number in the row pixel and terminate line number;The vertical product of traversal Divide the row pixel of the bianry image after projection, obtain the starting columns in the row pixel and terminate columns;According to initial row Number, the area-of-interest terminated in line number, starting columns and the end columns setting bianry image, by the bianry image Except the overseas border of region of interest is removed.
Other technical characteristics of above-mentioned character recognition device are identical with above-mentioned character identifying method, will not be described here.
As shown in figure 8, there is provided a kind of computer equipment, including memory, processor and storage in one embodiment On a memory and the computer program that can run on a processor, following walk is realized during the computing device described program Suddenly:
Character picture to be identified is obtained, gray processing processing is carried out to the character picture to be identified, pretreatment character is obtained Image;
Default character recognition model is inputted using the pretreatment character picture as an entirety, by the character recognition Model calculates the first character identification result of pretreatment character picture, wherein instruction of the character recognition model by character picture Practice sample set training setting neural network model generation;
The pretreatment character picture is rotated several times, one will be used as by postrotational pretreatment character picture every time Individual entirety inputs the character recognition model, and each postrotational pretreatment character picture is calculated by the character recognition model The second character identification result;
The character picture to be identified is drawn according to first character identification result and second character identification result In character.
In another embodiment, following steps are also realized during the computing device described program:According to described first Character identification result and second character identification result show that the character in the character picture to be identified includes:If described One character identification result is identical with each second character identification result, calculate rotation before pretreatment character picture length-width ratio with And the length-width ratio of each postrotational pretreatment character picture;Calculate first character identification result or the second character recognition knot The character total length of fruit;If all length-width ratios are all higher than the product of the character total length and the first ratio and are less than the word The product of total length and the second ratio is accorded with, first character identification result or the second character identification result are waited to know as described The character identification result of other character picture.
In another embodiment, following steps are also realized during the computing device described program:To described to be identified Character picture is carried out after gray processing processing, is obtained before pre-processing character picture, in addition to step:Treating after gray processing is known Other character picture carries out image binaryzation, obtains bianry image;Image normalization is carried out to the bianry image.
In another embodiment, following steps are also realized during the computing device described program:To the binary map Include as carrying out image normalization:The bianry image is adjusted to the pattern of black background white characters.
In another embodiment, following steps are also realized during the computing device described program:By the binary map As the pattern for being adjusted to black background white characters includes:Obtain the first profile of the white portion in the bianry image;It is right The bianry image carries out black and white upset processing, obtains the second profile of the white portion in the bianry image after upset;Respectively Calculate the Breadth Maximum of the first profile and the Breadth Maximum of second profile;If the Breadth Maximum of the first profile is small In the Breadth Maximum of second profile, retain the bianry image before black and white upset, otherwise retain the binary map after black and white upset Picture.
In another embodiment, following steps are also realized during the computing device described program:To the binary map Also include as carrying out image normalization:The border of the bianry image is removed, and is scaled the bianry image behind border is removed To pre-set dimension.
In another embodiment, following steps are also realized during the computing device described program:By the binary map The border of picture, which is removed, to be included:Horizontal integral projection and vertical integral projection are carried out respectively to the bianry image;Traversal level is accumulated Divide the row pixel of the bianry image after projection, obtain the starting line number in the row pixel and terminate line number;The vertical product of traversal Divide the row pixel of the bianry image after projection, obtain the starting columns in the row pixel and terminate columns;According to initial row Number, the area-of-interest terminated in line number, starting columns and the end columns setting bianry image, by the bianry image Except the overseas border of region of interest is removed.
Other technical characteristics of above computer equipment are identical with the technical characteristic of above-mentioned character identifying method, refuse herein Repeat.
In one embodiment there is provided a kind of computer-readable recording medium, computer program is stored thereon with, the meter Calculation machine program realizes following steps when being executed by processor:
Character picture to be identified is obtained, gray processing processing is carried out to the character picture to be identified, pretreatment character is obtained Image;
Default character recognition model is inputted using the pretreatment character picture as an entirety, by the character recognition Model calculates the first character identification result of pretreatment character picture, wherein instruction of the character recognition model by character picture Practice sample set training setting neural network model generation;
The pretreatment character picture is rotated several times, one will be used as by postrotational pretreatment character picture every time Individual entirety inputs the character recognition model, and each postrotational pretreatment character picture is calculated by the character recognition model The second character identification result;
The character picture to be identified is drawn according to first character identification result and second character identification result In character.
In another embodiment, also realize following steps according to described first when the computer program is executed by processor Character identification result and second character identification result show that the character in the character picture to be identified includes:If described One character identification result is identical with each second character identification result, calculate rotation before pretreatment character picture length-width ratio with And the length-width ratio of each postrotational pretreatment character picture;Calculate first character identification result or the second character recognition knot The character total length of fruit;If all length-width ratios are all higher than the product of the character total length and the first ratio and are less than the word The product of total length and the second ratio is accorded with, first character identification result or the second character identification result are waited to know as described The character identification result of other character picture.
In another embodiment, following steps are also realized when the computer program is executed by processor:Wait to know to described Other character picture is carried out after gray processing processing, is obtained before pre-processing character picture, in addition to step:To treating after gray processing Recognize that character picture carries out image binaryzation, obtain bianry image;Image normalization is carried out to the bianry image.
In another embodiment, following steps are also realized when the computer program is executed by processor:To the two-value Image, which carries out image normalization, to be included:The bianry image is adjusted to the pattern of black background white characters.
In another embodiment, following steps are also realized when the computer program is executed by processor:By the two-value Image Adjusting includes for the pattern of black background white characters:Obtain the first profile of the white portion in the bianry image; Black and white upset processing is carried out to the bianry image, the second profile of the white portion in the bianry image after upset is obtained;Point The Breadth Maximum of the first profile and the Breadth Maximum of second profile are not calculated;If the Breadth Maximum of the first profile Less than the Breadth Maximum of second profile, retain the bianry image before black and white upset, otherwise retain the two-value after black and white upset Image.
In another embodiment, following steps are also realized when the computer program is executed by processor:To the two-value Image, which carries out image normalization, also to be included:The border of the bianry image is removed, and is contracted the bianry image behind border is removed Put to pre-set dimension.
In another embodiment, following steps are also realized when the computer program is executed by processor:By the two-value The border of image, which is removed, to be included:Horizontal integral projection and vertical integral projection are carried out respectively to the bianry image;Traversal level The row pixel of the bianry image after integral projection, obtains the starting line number in the row pixel and terminates line number;Traversal is vertical The row pixel of the bianry image after integral projection, obtains the starting columns in the row pixel and terminates columns;According to starting Line number, the line number that terminates, starting columns and end columns set the area-of-interest in the bianry image, by the bianry image In remove except the overseas border of region of interest.
Other technical characteristics of above computer readable storage medium storing program for executing are identical with the technical characteristic of above-mentioned character identifying method, It will not be described here.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with The hardware of correlation is instructed to complete by computer program, described program can be stored in a computer read/write memory medium In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited In contradiction, the scope of this specification record is all considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and it describes more specific and detailed, but simultaneously Can not therefore it be construed as limiting the scope of the patent.It should be pointed out that coming for one of ordinary skill in the art Say, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention Scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

1. a kind of character identifying method, it is characterised in that including step:
Character picture to be identified is obtained, gray processing processing is carried out to the character picture to be identified, pretreatment character picture is obtained;
Default character recognition model is inputted using the pretreatment character picture as an entirety, by the character recognition model The first character identification result of pretreatment character picture is calculated, wherein training sample of the character recognition model by character picture The training setting neural network model generation of this collection;
The pretreatment character picture is rotated several times, postrotational pretreatment character picture every time is whole as one Body inputs the character recognition model, and the of postrotational pretreatment character picture is calculated every time by the character recognition model Two character identification results;
Drawn according to first character identification result and second character identification result in the character picture to be identified Character.
2. character identifying method according to claim 1, it is characterised in that according to first character identification result and institute State the second character identification result and show that the character in the character picture to be identified includes:
If first character identification result is identical with each second character identification result, the pretreatment character figure before rotation is calculated The length-width ratio of picture and the every time length-width ratio of postrotational pretreatment character picture;Calculate first character identification result or The character total length of two character identification results;
If all length-width ratios be all higher than the product of the character total length and the first ratio and less than the character total length with The product of second ratio, regard first character identification result or the second character identification result as the character picture to be identified Character identification result.
3. character identifying method according to claim 2, it is characterised in that gray scale is carried out to the character picture to be identified After change processing, obtain before pre-processing character picture, in addition to step:
Image binaryzation is carried out to the character picture to be identified after gray processing, bianry image is obtained;
Image normalization is carried out to the bianry image.
4. character identifying method according to claim 3, it is characterised in that image normalization is carried out to the bianry image Including:The bianry image is adjusted to the pattern of black background white characters.
5. character identifying method according to claim 4, it is characterised in that the bianry image is adjusted to black background The pattern of white characters includes:
Obtain the first profile of the white portion in the bianry image;
Black and white upset processing is carried out to the bianry image, the second wheel of the white portion in the bianry image after upset is obtained It is wide;
The Breadth Maximum of the first profile and the Breadth Maximum of second profile are calculated respectively;
If the Breadth Maximum of the first profile is less than the Breadth Maximum of second profile, retain the binary map before black and white upset Picture, otherwise retains the bianry image after black and white upset.
6. character identifying method according to claim 4, it is characterised in that image normalization is carried out to the bianry image Also include:The border of the bianry image is removed, and the bianry image removed behind border is zoomed into pre-set dimension.
7. character identifying method according to claim 6, it is characterised in that the border of the bianry image is removed and wrapped Include:
Horizontal integral projection and vertical integral projection are carried out respectively to the bianry image;
The row pixel of the bianry image after horizontal integral projection is traveled through, starting line number and end line in the row pixel is obtained Number;
The row pixel of the bianry image after vertical integral projection is traveled through, starting columns and end column in the row pixel is obtained Number;
, will according to starting line number, the area-of-interest terminated in line number, starting columns and the end columns setting bianry image Except the overseas border of region of interest is removed in the bianry image.
8. a kind of character recognition device, it is characterised in that including:
Character picture pretreatment module, for obtaining character picture to be identified, gray processing is carried out to the character picture to be identified Processing, obtains pretreatment character picture;
First character recognition module, for inputting default character recognition mould using the pretreatment character picture as an entirety Type, the first character identification result of pretreatment character picture is calculated by the character recognition model, wherein the character recognition Model is generated by the training sample set training setting neural network model of character picture;
Second character recognition module, will be postrotational pre- every time for being rotated several times to the pretreatment character picture Processing character image inputs the character recognition model as an entirety, and each rotation is calculated by the character recognition model Second character identification result of pretreatment character picture afterwards;
Character identification result determining module, for being obtained according to first character identification result and second character identification result The character gone out in the character picture to be identified.
9. a kind of computer equipment, including memory, processor and storage are on a memory and the meter that can run on a processor Calculation machine program, it is characterised in that any one methods described in claim 1-7 is realized during the computing device described program The step of.
10. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the computer program quilt The step of any one methods described in claim 1-7 is realized during computing device.
CN201710369090.5A 2017-05-23 2017-05-23 Character recognition method, character recognition device, computer equipment and computer-readable storage medium Active CN107220640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710369090.5A CN107220640B (en) 2017-05-23 2017-05-23 Character recognition method, character recognition device, computer equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710369090.5A CN107220640B (en) 2017-05-23 2017-05-23 Character recognition method, character recognition device, computer equipment and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN107220640A true CN107220640A (en) 2017-09-29
CN107220640B CN107220640B (en) 2020-07-17

Family

ID=59945268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710369090.5A Active CN107220640B (en) 2017-05-23 2017-05-23 Character recognition method, character recognition device, computer equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN107220640B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108345853A (en) * 2018-02-08 2018-07-31 吉首大学 Character identifying method, device based on isomorphism theory and terminal device
CN108681738A (en) * 2018-03-21 2018-10-19 江苏善壶网络科技有限公司 A kind of seal recognition methods and system
CN109271993A (en) * 2018-09-28 2019-01-25 徐常柏 A kind of document scanning system, computer equipment and readable storage medium storing program for executing
CN109271998A (en) * 2018-08-31 2019-01-25 摩佰尔(天津)大数据科技有限公司 Character identifying method, device, equipment and storage medium
CN109344836A (en) * 2018-09-30 2019-02-15 金蝶软件(中国)有限公司 A kind of character recognition method and equipment
CN109447081A (en) * 2018-11-14 2019-03-08 广东小天才科技有限公司 A kind of acquisition methods and system of optical character identification data set
CN111401366A (en) * 2020-03-20 2020-07-10 江苏苏宁物流有限公司 Character recognition method, character recognition device, computer equipment and storage medium
CN114666312A (en) * 2022-03-29 2022-06-24 西安热工研究院有限公司 Weighing instrument universal data acquisition method, system and equipment and readable storage medium
US11798250B2 (en) 2019-02-18 2023-10-24 Ecoatm, Llc Neural network based physical condition evaluation of electronic devices, and associated systems and methods
US11843206B2 (en) 2019-02-12 2023-12-12 Ecoatm, Llc Connector carrier for electronic device kiosk
USD1010271S1 (en) 2020-02-12 2024-01-02 Ecoatm, Llc Kiosk for processing electronic devices
US11922467B2 (en) 2020-08-17 2024-03-05 ecoATM, Inc. Evaluating an electronic device using optical character recognition

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890784A (en) * 2011-07-20 2013-01-23 富士通株式会社 Method and device for identifying directions of characters in image blocks
CN103870799A (en) * 2012-12-17 2014-06-18 北京千橡网景科技发展有限公司 Character direction judging method and device
CN105139042A (en) * 2015-09-08 2015-12-09 携程计算机技术(上海)有限公司 Image identification method and system
CN106408038A (en) * 2016-09-09 2017-02-15 华南理工大学 Rotary Chinese character identifying method based on convolution neural network model
CN106407976A (en) * 2016-08-30 2017-02-15 百度在线网络技术(北京)有限公司 Image character identification model generation and vertical column character image identification method and device
CN107220611A (en) * 2017-05-23 2017-09-29 上海交通大学 A kind of space-time feature extracting method based on deep neural network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890784A (en) * 2011-07-20 2013-01-23 富士通株式会社 Method and device for identifying directions of characters in image blocks
CN103870799A (en) * 2012-12-17 2014-06-18 北京千橡网景科技发展有限公司 Character direction judging method and device
CN105139042A (en) * 2015-09-08 2015-12-09 携程计算机技术(上海)有限公司 Image identification method and system
CN106407976A (en) * 2016-08-30 2017-02-15 百度在线网络技术(北京)有限公司 Image character identification model generation and vertical column character image identification method and device
CN106408038A (en) * 2016-09-09 2017-02-15 华南理工大学 Rotary Chinese character identifying method based on convolution neural network model
CN107220611A (en) * 2017-05-23 2017-09-29 上海交通大学 A kind of space-time feature extracting method based on deep neural network

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108345853B (en) * 2018-02-08 2020-10-23 吉首大学 Character recognition method and device based on isomorphic theory and terminal equipment
CN108345853A (en) * 2018-02-08 2018-07-31 吉首大学 Character identifying method, device based on isomorphism theory and terminal device
CN108681738A (en) * 2018-03-21 2018-10-19 江苏善壶网络科技有限公司 A kind of seal recognition methods and system
CN109271998A (en) * 2018-08-31 2019-01-25 摩佰尔(天津)大数据科技有限公司 Character identifying method, device, equipment and storage medium
CN109271993A (en) * 2018-09-28 2019-01-25 徐常柏 A kind of document scanning system, computer equipment and readable storage medium storing program for executing
CN109344836B (en) * 2018-09-30 2021-05-14 金蝶软件(中国)有限公司 Character recognition method and equipment
CN109344836A (en) * 2018-09-30 2019-02-15 金蝶软件(中国)有限公司 A kind of character recognition method and equipment
CN109447081A (en) * 2018-11-14 2019-03-08 广东小天才科技有限公司 A kind of acquisition methods and system of optical character identification data set
CN109447081B (en) * 2018-11-14 2021-07-23 广东小天才科技有限公司 Method and system for acquiring optical character recognition data set
US11843206B2 (en) 2019-02-12 2023-12-12 Ecoatm, Llc Connector carrier for electronic device kiosk
US11798250B2 (en) 2019-02-18 2023-10-24 Ecoatm, Llc Neural network based physical condition evaluation of electronic devices, and associated systems and methods
USD1010271S1 (en) 2020-02-12 2024-01-02 Ecoatm, Llc Kiosk for processing electronic devices
CN111401366A (en) * 2020-03-20 2020-07-10 江苏苏宁物流有限公司 Character recognition method, character recognition device, computer equipment and storage medium
CN111401366B (en) * 2020-03-20 2022-08-19 江苏苏宁物流有限公司 Character recognition method, character recognition device, computer equipment and storage medium
US11922467B2 (en) 2020-08-17 2024-03-05 ecoATM, Inc. Evaluating an electronic device using optical character recognition
CN114666312A (en) * 2022-03-29 2022-06-24 西安热工研究院有限公司 Weighing instrument universal data acquisition method, system and equipment and readable storage medium
CN114666312B (en) * 2022-03-29 2024-03-01 西安热工研究院有限公司 Universal data acquisition method, system and equipment for weighing instrument and readable storage medium

Also Published As

Publication number Publication date
CN107220640B (en) 2020-07-17

Similar Documents

Publication Publication Date Title
CN107220640A (en) Character identifying method, device, computer equipment and computer-readable recording medium
Liu et al. Picanet: Learning pixel-wise contextual attention for saliency detection
Zhao et al. Pyramid feature attention network for saliency detection
CN109614922B (en) Dynamic and static gesture recognition method and system
CN103116763B (en) A kind of living body faces detection method based on hsv color Spatial Statistical Character
CN111354017A (en) Target tracking method based on twin neural network and parallel attention module
US10565713B2 (en) Image processing apparatus and method
CN111160533A (en) Neural network acceleration method based on cross-resolution knowledge distillation
US20210012096A1 (en) Expression recognition method, computer device, and computer-readable storage medium
CN107918773B (en) Face living body detection method and device and electronic equipment
CN108021869A (en) A kind of convolutional neural networks tracking of combination gaussian kernel function
CN113392856B (en) Image forgery detection device and method
CN110472625A (en) A kind of pieces of chess visual identity method based on Fourier descriptor
CN109614866A (en) Method for detecting human face based on cascade deep convolutional neural networks
CN111898731A (en) Bias-based universal countermeasure patch generation method and device
Ribeiro et al. Exploring deep learning image super-resolution for iris recognition
CN103778430B (en) Rapid face detection method based on combination between skin color segmentation and AdaBoost
CN109727363A (en) A method of identifying amount in Chinese character in bill
CN113888501B (en) Attention positioning network-based reference-free image quality evaluation method
Wicht et al. Camera-based sudoku recognition with deep belief network
CN108876776B (en) Classification model generation method, fundus image classification method and device
Wicht et al. Mixed handwritten and printed digit recognition in Sudoku with Convolutional Deep Belief Network
Shi et al. Training-free object counting with prompts
CN111881965B (en) Hyperspectral pattern classification and identification method, device and equipment for medicinal material production place grade
CN111127407B (en) Fourier transform-based style migration forged image detection device and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Character recognition method, device, computer equipment and computer-readable storage medium

Effective date of registration: 20210923

Granted publication date: 20200717

Pledgee: Bank of China Limited by Share Ltd. Guangzhou Panyu branch

Pledgor: GUANGZHOU EPBOX INFORMATION TECHNOLOGY Co.,Ltd.

Registration number: Y2021440000297

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20231012

Granted publication date: 20200717

Pledgee: Bank of China Limited by Share Ltd. Guangzhou Panyu branch

Pledgor: GUANGZHOU EPBOX INFORMATION TECHNOLOGY Co.,Ltd.

Registration number: Y2021440000297