[go: up one dir, main page]

CN102750530B - Character recognition method and device - Google Patents

Character recognition method and device Download PDF

Info

Publication number
CN102750530B
CN102750530B CN201210177765.3A CN201210177765A CN102750530B CN 102750530 B CN102750530 B CN 102750530B CN 201210177765 A CN201210177765 A CN 201210177765A CN 102750530 B CN102750530 B CN 102750530B
Authority
CN
China
Prior art keywords
character
pixel point
value
gradient
template
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.)
Expired - Fee Related
Application number
CN201210177765.3A
Other languages
Chinese (zh)
Other versions
CN102750530A (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.)
He Jiangtao
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201210177765.3A priority Critical patent/CN102750530B/en
Publication of CN102750530A publication Critical patent/CN102750530A/en
Application granted granted Critical
Publication of CN102750530B publication Critical patent/CN102750530B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Character Discrimination (AREA)
  • Character Input (AREA)

Abstract

The invention discloses character recognition method and device. The method comprises the steps that: when recognition and template of a character to be recognized are established, conducting normalization processing, determining character edge information graph, and determining the dereferencing of each value in an edge gradient array; after assignment of corresponding position in the edge gradient array, determining matching distance according to matching between the edge gradient array corresponding to the character to be recognized and each template corresponding to each character, and recognizing the character according to the matching distance. In the invention, corresponding value in the edge gradient array is determined according to the gradient direction of each pixel point in the character, and the gradient direction has strong anti-interference capability, thus the character recognition method has strong robustness, each character and each template are correspondingly matched in the recognition process, and character corresponding to the minimum matching distance is used as the recognition result, thus the poor robustness problem caused by single template matching of the characters can be avoided, and the application range of the matching method is improved.

Description

Character recognition method and device
Technical Field
The invention relates to the technical field of computer image processing, in particular to a character recognition method and device.
Background
With the development of social economy, the number of vehicles is increasing, and therefore, it is necessary to manage the vehicles by a scheme of computerized informatization and intellectualization. In the prior art, license plate recognition plays an important role in the field of intelligent traffic, and the license plate recognition has wide application in traffic flow monitoring, highway toll collection, red light violation vehicle monitoring and community automatic toll collection systems.
The existing license plate type identification process mainly comprises the following steps: the method comprises the following main steps of license plate positioning, license plate correction, license plate character segmentation, character recognition and the like. The character recognition is a core technology in license plate recognition, and after a character sequence is recognized, each character in the character sequence needs to be recognized through the character recognition technology.
The currently adopted license plate character recognition algorithm comprises the following steps: template matching algorithms and machine learning algorithms. The machine learning algorithm needs to learn a large number of character samples, and needs to be trained for a long time, so that the calculation amount is large and the efficiency is low. The template matching algorithm is simple to implement compared with a machine learning algorithm, but is less robust because the template matching algorithm compares a recognition character with each template in a stored standard character template set, and then selects a template with the closest distance as a recognition result. The template matching method mostly utilizes the statistical characteristics of the outline, the grid, the projection and the like of the character, so that the problems of poor distinguishing capability of similar characters, low recognition speed and the like caused by overlarge feature data dimension can be caused, and for the character to be recognized with deformation, displacement and inclination, the template matching method is easy to generate misrecognition and has poor recognition accuracy.
Disclosure of Invention
In view of this, embodiments of the present invention provide a character recognition method and device, so as to solve the problem of poor robustness in the character recognition process in the prior art.
The invention provides a character recognition method, which comprises the following steps:
carrying out binarization processing on a picture containing character information to be recognized, recognizing the boundary of characters in the picture after binarization processing, intercepting a character area to be recognized in a sample picture containing the character information to be recognized according to the determined boundary, and carrying out binarization and normalization processing on the intercepted character area;
in the character area to be identified after normalization processing, jumping of a pixel value is identified, according to the position of a white pixel point during jumping, the position of the corresponding pixel point in a character edge information graph is assigned with 255, and the positions of other pixel points are assigned with other values, wherein the size of the character edge information graph is equal to that of the character area after normalization;
identifying the pixel value of each pixel point in the character edge information graph, calculating the gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determining the direction of ownership, assigning a value to a corresponding position in the edge gradient array by adopting the direction of ownership, and assigning values to other positions of the array to be-1;
and matching the edge gradient array with each template corresponding to each stored character, determining a matching distance, and taking the character corresponding to the minimum matching distance as a recognition result.
The present invention provides a character recognition apparatus, the apparatus including:
the normalization module is used for carrying out binarization processing on the picture containing the information of the characters to be recognized, recognizing the boundary of the characters to be recognized in the picture after the binarization processing, intercepting a character area to be recognized in a sample picture containing the information of the characters to be recognized according to the determined boundary, and carrying out binarization and normalization processing on the intercepted character area;
the edge information determining module is used for identifying the jump of a pixel value in the character area to be identified after normalization processing, assigning 255 values to the positions of corresponding pixel points in a character edge information graph according to the positions of white pixel points during jump, and assigning other values to the positions of other pixel points, wherein the size of the character edge information graph is equal to that of the character area after normalization;
the gradient direction determining module is used for identifying the pixel value of each pixel point in the character edge information graph, calculating the gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determining the home direction, assigning a value to a corresponding position in the edge gradient array by adopting the home direction value, and assigning the value to the other positions of the array to be-1;
and the matching identification module is used for matching the edge gradient array with each stored template, determining a matching distance and taking the character corresponding to the minimum matching distance as an identification result.
The invention provides a character recognition method and a device, wherein the method aims at character recognition and template creation to be recognized, normalization processing is carried out, a character edge information graph is determined, the value of each numerical value in an edge gradient array is determined, after the assignment of the corresponding position in the edge gradient array is determined, the matching distance is determined according to the matching between the edge gradient array corresponding to the character to be recognized and each template corresponding to each character, and the character is recognized according to the matching distance. According to the invention, the gradient direction of each pixel point in the character is used as a corresponding numerical value in the edge gradient array, and the gradient direction has strong anti-interference capability, so that the character recognition method has strong robustness, is matched with each template corresponding to each character in the recognition process, and uses the character corresponding to the minimum matching distance as a recognition result according to the matching distance, thereby avoiding the problem of poor robustness of character single template matching and improving the application range of the matching method.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic diagram of a character recognition process provided by the present invention;
FIG. 2 is a process of normalization in the process of creating a character template according to the present invention;
FIG. 3 is a feature extraction process in the creation of a character template according to the present invention;
fig. 4 is a schematic structural diagram of a character recognition device provided in the present invention.
Detailed Description
The embodiment of the invention provides a character recognition method and device in order to improve the efficiency and the precision of character recognition.
The present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a character recognition process provided by the present invention, which includes the following steps:
s101: the method comprises the steps of carrying out binarization processing on a picture containing character information to be recognized, recognizing the boundary of characters to be recognized in the picture after the binarization processing, intercepting a character area to be recognized in a sample picture containing the character information to be recognized according to the determined boundary, and carrying out binarization and normalization processing on the intercepted character area.
S102: and in the character area to be identified after normalization processing, jumping of the pixel value is identified, according to the position of a white pixel point during jumping, the position of the corresponding pixel point in the character edge information graph is assigned with 255, and the positions of other pixel points are assigned with other values, wherein the size of the character edge information graph is equal to that of the character area after normalization.
S103: and identifying the pixel value of each pixel point in the character edge information graph, calculating the gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determining the direction of ownership, assigning a value to a corresponding position in the edge gradient array by adopting the direction of ownership, and assigning values to other positions of the array to be-1.
S104: and matching the edge gradient array with each template corresponding to each stored character, determining a matching distance, and taking the character corresponding to the minimum matching distance as a recognition result.
Before character recognition, a plurality of templates of each character are created, and when each template of each character is created, normalization processing, determination of a character edge information graph and determination of a value of each numerical value in an edge gradient array are also required, that is, the creation process of the templates is the same as the steps performed in the character recognition process. And after the assignment of the corresponding position in the edge gradient array corresponding to the template is determined, determining the assignment of each corresponding position in the edge gradient array corresponding to the character to be recognized by adopting the same method, determining the matching distance according to the matching between the edge gradient array corresponding to the character to be recognized and the template, and recognizing the character according to the matching distance.
According to the invention, the gradient direction of each pixel point in the character is used as a corresponding numerical value in the edge gradient array, and the gradient direction has stronger anti-jamming capability, so that the character recognition method has stronger robustness, is matched with each template corresponding to each character in the recognition process, and uses the character corresponding to the minimum matching distance as a recognition result according to the matching distance, thereby avoiding the problem of poor robustness of character single template matching and improving the application range of the matching method.
The character recognition process of the present invention will be described in detail below by way of specific examples.
In order to improve the accuracy of character recognition and improve the efficiency of character recognition, a plurality of templates need to be stored for each character, each template needs to be representative, and the difference between the templates is large. When creating and storing a template of a character, it is necessary to perform normalization processing on a character region and extract the features of the character region after the normalization processing.
Fig. 2 is a process of normalization processing in the process of creating a character template, which includes the following steps:
s201: and carrying out binarization processing on the sample picture containing the character information.
Generally, a sample picture including character information is a color picture, before binarization of the color picture, the color picture needs to be converted into a gray-scale picture firstly, and then binarization processing is performed on the gray-scale picture by adopting a corresponding binarization algorithm.
S202: searching the interior of the picture from the four boundaries of the picture after the binarization processing; when a white pixel point in the picture is searched, determining that the white pixel point is positioned at the boundary of the character; and determining the boundary of the character according to the positions of the white pixel points scanned from each boundary direction.
In order to detect the region where the character is located in the binarized picture, the invention scans the inside of the picture from the four boundaries of the binarized picture, namely scans the inside of the picture from the upper direction, the lower direction, the left direction and the right direction of the binarized picture. Specifically, when a white pixel point is recognized from the upper and lower directions for the first time, the row where the upper and lower boundaries of the character are located is considered as the row where the upper and lower boundaries of the character are located, and when the white pixel point is recognized from the left and right directions for the first time, the column where the white pixel point is located is considered as the column where the left and right boundaries of the character are located.
S203: and intercepting a character area in the sample picture containing the character information according to the determined boundary of the character.
After the rows and columns forming the character boundary are determined, the picture of the character area can be cut out from the sample picture containing the character information.
S204: and carrying out binarization processing on the intercepted character area, and carrying out normalization processing on the picture after binarization processing according to the set size.
After the character region is cut from the color picture, the picture corresponding to the character region is still the color picture, the color picture of the character region is converted into a gray scale picture, the otsu binarization algorithm is adopted for the gray scale picture for binarization processing, then the binarization processing is carried out on the picture after binarization processing according to the set size, for example, the set size can be 24 width and 48 height in the invention, and meanwhile, the normalization processing is carried out on the converted gray scale picture according to the set size. Thereby obtaining a normalized binary image and a normalized gray image.
Fig. 3 is a feature extraction process in the character template creation process provided by the present invention, which includes the following steps:
s301: and identifying the jump of the pixel value of the pixel point in the normalized character area.
The normalized character region is a binary character image, the width of the binary character image is W, and the height of the binary character image is H. And identifying the jump of the pixel value in the binary character image, namely changing the pixel values of two adjacent pixel points from 1 to 0 or changing the pixel values from 0 to 1.
S302: and according to the position of the white pixel point when the pixel value jumps, assigning the pixel point corresponding to the position of the white pixel point to be 255 in a character edge information graph, otherwise, assigning the pixel point to be other values, wherein the size of the character edge information graph is equal to that of the normalized character area.
The character edge information map and the normalized character area have the same size, that is, the character edge information map and the binary character map have the same size, that is, the number of rows, columns and the number of pixel points are the same. When the pixel value of each pixel point in the character edge information graph is determined, the jump of the pixel value in the binary character graph which needs to be identified, according to the position corresponding to the white pixel point in the jump, the pixel point corresponding to the position of the white pixel point in the character edge information graph is assigned to be 255, and the positions of other pixel points in the character edge information graph are assigned to be other values, for example, 0.
S303: and identifying the pixel value of each pixel point in the character edge information graph, calculating the gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, and determining the attribution direction.
S304: and assigning the position corresponding to the pixel point position in the template as the gradient direction angle, and assigning other positions as-1.
In the invention, a template which is equal to the height and the width of the character edge information graph is created, and the template can also be regarded as a two-dimensional array which is equal to the height and the width of the character edge information graph. When the assignment of each position in the template is determined, scanning the character edge information graph, and when the pixel value of a scanned pixel point is other values, for example, 0, assigning the corresponding position in the template corresponding to the position of the pixel point to-1; when the pixel value of the scanned pixel point is 255, namely when the white point is scanned, calculating the gradient value of the pixel point according to the following formula at the position corresponding to the pixel point in the normalized gray image:
Gradient=dy/dx
wherein dy is g (i, j +1) -g (i, j-1), dx is g (i +1, j) -g (i-1, j), g (i, j) is the gray value of the corresponding position of the pixel point in the normalized gray image, i represents the row where the pixel point is located, j represents the column where the pixel point is located, and Gradient is the calculated Gradient value of the pixel point.
Dividing an angle range of 0 degree to 360 degrees into 8 equal parts, wherein each equal part corresponds to a gradient direction and is marked by 1-8, calculating the gradient direction angle of the pixel point according to the calculated gradient value of the pixel point, and determining the direction to which the gradient direction angle belongs according to the calculated gradient direction angle.
After a plurality of templates are created for each character, each template is saved in a position corresponding to each character in the template library, that is, a plurality of templates are saved for each character in the template library.
When characters are identified, after a picture containing the characters to be identified is obtained, the picture is converted into a gray-scale image according to the creation process of the template, and the converted picture is subjected to binarization processing by adopting a corresponding binarization algorithm, wherein the binarization algorithm is the same as that in the creation process of the template.
In the picture after the binarization processing, scanning the inside of the picture from four directions of the picture respectively, identifying the position of a first white pixel point in each direction, and determining the boundary of the character to be identified according to the position of the identified white pixel point in each direction; and intercepting the character area to be recognized from the color picture of the character to be recognized according to the determined character boundary.
Converting the intercepted character area to be recognized into a gray map, performing binarization processing on the gray map by adopting a corresponding binarization algorithm, and performing normalization processing on the gray map and the character area to be recognized after the binarization processing according to a set size, wherein the set size is the same as the size set in the template creation process, such as width 24 and height 48, and the binarization algorithm adopted here is also the same as the binarization algorithm adopted in the normalization process in the template creation.
After normalization processing is carried out on the character area to be recognized after binarization, jump of pixel values of pixel points after normalization is recognized, when the pixel values are recognized to jump from 0 to 1 or from 1 to 0, according to the positions of white pixel points during jump, the positions of corresponding pixel points in a character edge information graph are assigned to be 255, and the positions of other pixel points are assigned to be 0.
And identifying the pixel value of each pixel point in the assigned character edge information image, when a pixel point with the pixel value of 255 is identified, calculating the gradient value of the pixel point according to the gray values of the pixel point and the adjacent pixel points in the normalized gray image, and determining the gradient direction of the pixel point according to the calculated gradient value of the pixel point.
According to the determined gradient direction of the pixel point, determining the direction to which the gradient direction belongs in 8 directions equally divided in the range of 0-360 degrees, taking the direction to which the gradient direction belongs as a numerical value corresponding to the position of the pixel point in the edge gradient array of the character to be recognized, and assigning the other positions of the array as-1.
Matching the edge gradient array with each template corresponding to each stored character, and determining the matching distance with each template, wherein when the matching distance is determined, the following formula is adopted:
<math> <mrow> <mi>D</mi> <mo>=</mo> <mfrac> <mrow> <munderover> <mi>&Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mi>H</mi> </munderover> <munderover> <mi>&Sigma;</mi> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mi>W</mi> </munderover> <mi>d</mi> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>)</mo> </mrow> </mrow> <mi>S</mi> </mfrac> </mrow> </math>
wherein, d ( i , j ) = 0 if ( c ( i , j ) = = t ( i , j ) ) 5 if ( c ( i , j ) ! = t ( i , j ) ) , c (i, j) is the ith row and the jth column in the edge gradient array of the character to be recognized, t (i, j) is the ith row and the jth column in the template, H is the height of the template after normalization, W is the width of the template after normalization, and the value of S is determined according to the times which are not equal to-1 in the edge gradient array of the character to be recognized, namely the times and the sum of which are not equal to-1 in each position of the template.
Fig. 4 is a schematic structural diagram of a character recognition apparatus provided in the present invention, the apparatus including:
the normalization module 41 is configured to perform binarization processing on a picture containing information of characters to be recognized, recognize a boundary of the characters to be recognized in the picture after the binarization processing, intercept a region of the characters to be recognized in a sample picture containing the information of the characters to be recognized according to the determined boundary, and perform binarization and normalization processing on the intercepted region of the characters;
an edge information determining module 42, configured to identify a jump of a pixel value in the normalized character region to be identified, assign 255 a value to a position of a corresponding pixel point in a character edge information graph according to a position of a white pixel point during the jump, and assign other values to positions of other pixel points, where the character edge information graph is equal to the normalized character region in size;
a gradient direction determining module 43, configured to identify a pixel value of each pixel in the character edge information graph, calculate a gradient value of the pixel when the pixel value of the pixel in the character edge information graph is identified to be 255, determine an attribution direction, assign a value to a corresponding position in an edge gradient array by using the attribution direction value, and assign a value to another position of the array to be-1;
and the matching identification module 44 is configured to match the edge gradient array with each stored template corresponding to each character, determine a matching distance, and use the character corresponding to the minimum matching distance as an identification result.
The normalization module 41 is further configured to, when a template is created, perform binarization processing on a sample picture containing character information, and identify a boundary of a character in the picture after the binarization processing; according to the determined character boundary, intercepting a character area in a sample picture containing character information, and carrying out binarization and normalization processing on the intercepted character area;
the edge information determining module 42 is further configured to, when creating a template, identify a jump of a pixel value in a normalized character region, assign 255 a value to a position of a corresponding pixel point in a character edge information graph according to a position of a white pixel point in the jump, and assign other values to positions of other pixel points, where the size of the character edge information graph is equal to that of the normalized character region;
the gradient direction determining module 43 is further configured to, when creating the template, identify a pixel value of each pixel point in the character edge information graph, calculate a gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determine an attribution direction, assign a position in the template corresponding to the position of the pixel point as a direction value, and assign other positions as-1.
The normalization module 41 is specifically configured to search the inside of the picture from the four boundaries of the picture after the binarization processing; when a white pixel point in the picture is searched, determining that the white pixel point is positioned at the boundary of the character; and determining the boundary of the character according to the positions of the white pixel points scanned from each boundary direction.
The normalization module 41 is further configured to convert the intercepted character area into a grayscale image and perform normalization processing;
the gradient direction determining module 43 is configured to calculate, at a position corresponding to the pixel point in the normalized gray image, a gradient value of the pixel point according to the following formula:
Gradient=dy/dx
wherein dy is g (i, j +1) -g (i, j-1), dx is g (i +1, j) -g (i-1, j), g (i, j) is the gray value of the corresponding position of the pixel point in the normalized gray image, i represents the row where the pixel point is located, j represents the column where the pixel point is located, and Gradient is the calculated Gradient value of the pixel point;
calculating a gradient direction angle according to the calculated gradient value;
from the gradient direction angle, and 8 directions divided between 0 and 360 degrees, the direction to which the gradient direction angle belongs is determined.
The match identification module 44 is specifically configured toA matching distance is determined, wherein, d ( i , j ) = 0 if ( c ( i , j ) = = t ( i , j ) ) 5 if ( c ( i , j ) ! = t ( i , j ) ) , c (i, j) is the ith row and the jth column in the edge gradient array of the character to be recognized, t (i, j) is the ith row and the jth column in the template, H is the height of the template after normalization, W is the width of the template after normalization, and the value of S is determined according to the times which are not equal to-1 in the edge gradient array of the character to be recognized, namely the times and the sum of which are not equal to-1 in each position of the template.
The invention provides a character recognition method and a device, wherein the method aims at character recognition and template creation to be recognized, normalization processing is carried out, a character edge information graph is determined, the value of each numerical value in an edge gradient array is determined, after the assignment of the corresponding position in the edge gradient array is determined, the matching distance is determined according to the matching between the edge gradient array corresponding to the character to be recognized and each template corresponding to each character, and the character is recognized according to the matching distance. According to the invention, the gradient direction of each pixel point in the character is used as a corresponding numerical value in the edge gradient array, and the gradient direction has strong anti-interference capability, so that the character recognition method has strong robustness, is matched with each template corresponding to each character in the recognition process, and uses the character corresponding to the minimum matching distance as a recognition result according to the matching distance, thereby avoiding the problem of poor robustness of character single template matching and improving the application range of the matching method.
While the foregoing description shows and describes a preferred embodiment of the invention, it is to be understood that the invention is not limited to the form disclosed herein, but is not to be construed as limited to the exclusion of other embodiments, and that it may be used in various other combinations, modifications, and environments and may be modified within the scope of the inventive concepts described herein by those skilled in the relevant art or knowledge. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A method of character recognition, the method comprising:
carrying out binarization processing on a picture containing character information to be recognized, recognizing the boundary of characters in the picture after binarization processing, intercepting a character area to be recognized in a sample picture containing the character information to be recognized according to the determined boundary, and carrying out binarization and normalization processing on the intercepted character area;
in the character area to be identified after normalization processing, jumping of a pixel value is identified, according to the position of a white pixel point during jumping, the position of the corresponding pixel point in a character edge information graph is assigned with 255, and the positions of other pixel points are assigned with other values, wherein the size of the character edge information graph is equal to that of the character area after normalization;
identifying the pixel value of each pixel point in the character edge information graph, calculating the gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determining the direction of ownership, assigning a value to a corresponding position in the edge gradient array by adopting the direction of ownership, and assigning values to other positions of the array to be-1;
matching the edge gradient array with each template corresponding to each stored character, determining a matching distance, and taking the character corresponding to the minimum matching distance as a recognition result;
wherein determining the matching distance comprises:
according to <math> <mrow> <mi>D</mi> <mo>=</mo> <mfrac> <mrow> <munderover> <mi>&Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mi>H</mi> </munderover> <munderover> <mi>&Sigma;</mi> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mi>W</mi> </munderover> <mi>d</mi> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>)</mo> </mrow> </mrow> <mi>S</mi> </mfrac> </mrow> </math> A matching distance is determined, wherein, d ( i , j ) = 0 if ( c ( i , j ) = = t ( i , j ) ) 5 if ( c ( i , j ) ! = t ( i , j ) ) , c (i, j) is the ith row and the jth column in the edge gradient array of the character to be recognized, t (i, j) is the ith row and the jth column in the template, H is the height of the template after normalization, W is the width of the template after normalization, and the value of S is determined according to the times which are not equal to-1 in the edge gradient array of the character to be recognized, namely the times and the sum of which are not equal to-1 in each position of the template.
2. The method of claim 1, wherein creating and saving each template for each character comprises:
carrying out binarization processing on a sample picture containing character information, and identifying the boundary of characters in the picture after binarization processing;
according to the determined character boundary, intercepting a character area in a sample picture containing character information, and carrying out binarization and normalization processing on the intercepted character area;
in the character area after normalization processing, jumping of pixel values is identified, according to the position of a white pixel point during jumping, the position of the corresponding pixel point in a character edge information graph is assigned with 255, and the positions of other pixel points are assigned with other values, wherein the size of the character edge information graph is equal to that of the character area after normalization;
and identifying the pixel value of each pixel point in the character edge information graph, calculating the gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determining the direction of attribution, assigning the position corresponding to the position of the pixel point in the template to be a direction value, and assigning the other positions to be-1.
3. The method as claimed in claim 1 or 2, wherein the identifying the boundaries of the characters in the picture after the binarization processing comprises:
searching the interior of the picture from the four boundaries of the picture after the binarization processing;
when a white pixel point in the picture is searched, determining that the white pixel point is positioned at the boundary of the character;
and determining the boundary of the character according to the positions of the white pixel points scanned from each boundary direction.
4. The method as claimed in claim 1 or 2, wherein after the binarization and normalization processing of the truncated character region, the method further comprises:
converting the intercepted character area into a gray level image, and performing normalization processing;
the calculating the gradient value of the pixel point and determining the home direction angle includes:
and calculating the gradient value of the pixel point according to the following formula at the position corresponding to the pixel point in the normalized gray image:
Gradient=dy/dx
wherein dy is g (i, j +1) -g (i, j-1), dx is g (i +1, j) -g (i-1, j), g (i, j) is the gray value of the corresponding position of the pixel point in the normalized gray image, i represents the row where the pixel point is located, j represents the column where the pixel point is located, and Gradient is the calculated Gradient value of the pixel point;
calculating a gradient direction angle according to the calculated gradient value;
from the gradient direction angle, and 8 directions divided between 0 and 360 degrees, the direction to which the gradient direction angle belongs is determined.
5. An apparatus for character recognition, the apparatus comprising:
the normalization module is used for carrying out binarization processing on the picture containing the information of the characters to be recognized, recognizing the boundary of the characters to be recognized in the picture after the binarization processing, intercepting a character area to be recognized in a sample picture containing the information of the characters to be recognized according to the determined boundary, and carrying out binarization and normalization processing on the intercepted character area;
the edge information determining module is used for identifying the jump of a pixel value in the character area to be identified after normalization processing, assigning 255 values to the positions of corresponding pixel points in a character edge information graph according to the positions of white pixel points during jump, and assigning other values to the positions of other pixel points, wherein the size of the character edge information graph is equal to that of the character area after normalization;
the gradient direction determining module is used for identifying the pixel value of each pixel point in the character edge information graph, calculating the gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determining the home direction, assigning a value to a corresponding position in the edge gradient array by adopting the home direction value, and assigning the value to the other positions of the array to be-1;
the matching identification module is used for matching the edge gradient array with each stored template, determining a matching distance, and taking the character corresponding to the minimum matching distance as an identification result, wherein the step of determining the matching distance comprises the following steps:
according to <math> <mrow> <mi>D</mi> <mo>=</mo> <mfrac> <mrow> <munderover> <mi>&Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mi>H</mi> </munderover> <munderover> <mi>&Sigma;</mi> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mi>W</mi> </munderover> <mi>d</mi> <mrow> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>)</mo> </mrow> </mrow> <mi>S</mi> </mfrac> </mrow> </math> A matching distance is determined, wherein, d ( i , j ) = 0 if ( c ( i , j ) = = t ( i , j ) ) 5 if ( c ( i , j ) ! = t ( i , j ) ) , c (i, j) is the ith row and the jth column in the edge gradient array of the character to be recognized, t (i, j) is the ith row and the jth column in the template, H is the height of the template after normalization, W is the width of the template after normalization, and the value of S is determined according to the times which are not equal to-1 in the edge gradient array of the character to be recognized, namely the times and the sum of which are not equal to-1 in each position of the template.
6. The apparatus according to claim 5, wherein the normalization module is further configured to, when creating the template, perform binarization processing on a sample picture containing character information, and identify boundaries of characters in the picture after the binarization processing; according to the determined character boundary, intercepting a character area in a sample picture containing character information, and carrying out binarization and normalization processing on the intercepted character area;
the edge information determining module is further configured to, when a template is created, identify a jump of a pixel value in a normalized character region, assign 255 a value to a position of a corresponding pixel point in a character edge information graph according to a position of a white pixel point in the jump, and assign other values to positions of other pixel points, where the character edge information graph is equal to the normalized character region in size;
the gradient direction determining module is further configured to, when the template is created, identify a pixel value of each pixel point in the character edge information graph, calculate a gradient value of the pixel point when the pixel value of the pixel point in the character edge information graph is identified to be 255, determine an attribution direction, assign a position in the template corresponding to the position of the pixel point to be a direction value, and assign other positions to be-1.
7. The apparatus according to claim 5 or 6, wherein the normalization module is specifically configured to search the inside of the picture, starting from four boundaries of the binarized picture; when a white pixel point in the picture is searched, determining that the white pixel point is positioned at the boundary of the character; and determining the boundary of the character according to the positions of the white pixel points scanned from each boundary direction.
8. The apparatus of claim 5 or 6, wherein the normalization module is further configured to convert the intercepted character area into a gray-scale image and perform normalization processing;
the gradient direction determining module is configured to calculate, at a position corresponding to the pixel point in the normalized gray image, a gradient value of the pixel point according to the following formula:
Gradient=dy/dx
wherein dy is g (i, j +1) -g (i, j-1), dx is g (i +1, j) -g (i-1, j), g (i, j) is the gray value of the corresponding position of the pixel point in the normalized gray image, i represents the row where the pixel point is located, j represents the column where the pixel point is located, and Gradient is the calculated Gradient value of the pixel point;
calculating a gradient direction angle according to the calculated gradient value;
from the gradient direction angle, and 8 directions divided between 0 and 360 degrees, the direction to which the gradient direction angle belongs is determined.
CN201210177765.3A 2012-05-31 2012-05-31 Character recognition method and device Expired - Fee Related CN102750530B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210177765.3A CN102750530B (en) 2012-05-31 2012-05-31 Character recognition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210177765.3A CN102750530B (en) 2012-05-31 2012-05-31 Character recognition method and device

Publications (2)

Publication Number Publication Date
CN102750530A CN102750530A (en) 2012-10-24
CN102750530B true CN102750530B (en) 2014-11-26

Family

ID=47030696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210177765.3A Expired - Fee Related CN102750530B (en) 2012-05-31 2012-05-31 Character recognition method and device

Country Status (1)

Country Link
CN (1) CN102750530B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281850B (en) * 2013-07-09 2020-01-31 腾讯科技(深圳)有限公司 character area identification method and device
CN108242058A (en) * 2016-12-26 2018-07-03 深圳怡化电脑股份有限公司 Image boundary lookup method and device
CN107239784A (en) * 2017-07-03 2017-10-10 福建中金在线信息科技有限公司 A kind of image identification method, device, electronic equipment and readable storage medium storing program for executing
CN108805115A (en) * 2018-04-24 2018-11-13 五八同城信息技术有限公司 Recognition methods, device, equipment and the storage medium of word in a kind of picture
CN111079735B (en) * 2018-10-22 2023-12-22 莱芜钢铁集团电子有限公司 Casting blank end face character recognition method and device
CN113255674B (en) * 2020-09-14 2024-09-03 深圳怡化时代智能自动化系统有限公司 Character recognition method, character recognition device, electronic equipment and computer readable storage medium
CN113239929A (en) * 2021-04-30 2021-08-10 南京钢铁股份有限公司 Method for identifying numbers in computer display screen
CN113989795B (en) * 2021-12-02 2024-06-21 安徽翼迈科技股份有限公司 Water meter bubble early warning method based on template graph traversal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515325A (en) * 2009-04-08 2009-08-26 北京邮电大学 Character extracting method in digital video based on character segmentation and color cluster
CN101751565A (en) * 2008-12-10 2010-06-23 中国科学院自动化研究所 Method for character identification through fusing binary image and gray level image
CN102147858A (en) * 2011-03-31 2011-08-10 重庆大学 License plate character identification method
CN102426649A (en) * 2011-10-13 2012-04-25 石家庄开发区冀科双实科技有限公司 Simple high-accuracy steel seal digital automatic identification method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751565A (en) * 2008-12-10 2010-06-23 中国科学院自动化研究所 Method for character identification through fusing binary image and gray level image
CN101515325A (en) * 2009-04-08 2009-08-26 北京邮电大学 Character extracting method in digital video based on character segmentation and color cluster
CN102147858A (en) * 2011-03-31 2011-08-10 重庆大学 License plate character identification method
CN102426649A (en) * 2011-10-13 2012-04-25 石家庄开发区冀科双实科技有限公司 Simple high-accuracy steel seal digital automatic identification method

Also Published As

Publication number Publication date
CN102750530A (en) 2012-10-24

Similar Documents

Publication Publication Date Title
CN102750530B (en) Character recognition method and device
Yan et al. Automated asphalt highway pavement crack detection based on deformable single shot multi-box detector under a complex environment
US8170340B2 (en) Device, method and computer program for identifying a traffic sign in an image
CN108073928B (en) License plate recognition method and device
CN101334836B (en) License plate positioning method incorporating color, size and texture characteristic
CN103903005B (en) License plate image identification system and method
Garz et al. Binarization-free text line segmentation for historical documents based on interest point clustering
CN100377167C (en) Two-dimensional code area precisive positioning method for two-dimensional recognition
CN104751187A (en) Automatic meter-reading image recognition method
CN103870803A (en) Vehicle license plate recognition method and system based on coarse positioning and fine positioning fusion
CN105160309A (en) Three-lane detection method based on image morphological segmentation and region growing
CN113158808A (en) Method, medium and equipment for Chinese ancient book character recognition, paragraph grouping and layout reconstruction
CN102243705B (en) Method for positioning license plate based on edge detection
CN105243730A (en) Banknote identification method and system
CN108108734B (en) License plate recognition method and device
CN110956100A (en) High-precision map generation method and device, electronic equipment and storage medium
CN105303153A (en) Vehicle license plate identification method and apparatus
CN106874901B (en) Driving license identification method and device
JPWO2008020544A1 (en) Vehicle detection device, vehicle detection method, and vehicle detection program
CN103593695A (en) Method for positioning DPM two-dimension code area
CN108073925B (en) License plate recognition method and device
CN107766854A (en) It is a kind of to realize that the quick page number knows method for distinguishing based on template matches
CN103489254A (en) Lottery recognition method and lottery recognition system
WO2018042208A1 (en) Street asset mapping
CN109284678A (en) Guideboard method for recognizing semantics and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: LIU ZHONGXUAN TONG HUIYONG

Effective date: 20131121

Owner name: HE JIANGTAO

Free format text: FORMER OWNER: XINZHENG ELECTRONIC TECHNOLOGY (BEIJING) CO., LTD.

Effective date: 20131121

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20131121

Address after: 100085, A, block 6A, block 28, information road, Beijing, Haidian District

Applicant after: He Jiangtao

Applicant after: Liu Zhongxuan

Applicant after: Tong Huiyong

Address before: 100085, room 228, Section 2, building 1, building C, 3rd Street, Haidian District, Beijing

Applicant before: Xinzheng Electronic Technology (Beijing) Co., Ltd.

ASS Succession or assignment of patent right

Free format text: FORMER OWNER: LIU ZHONGXUAN TONG HUIYONG

Effective date: 20140418

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20140418

Address after: 100085, A, block 6A, block 28, information road, Beijing, Haidian District

Applicant after: He Jiangtao

Address before: 100085, A, block 6A, block 28, information road, Beijing, Haidian District

Applicant before: He Jiangtao

Applicant before: Liu Zhongxuan

Applicant before: Tong Huiyong

C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20141126

Termination date: 20190531

CF01 Termination of patent right due to non-payment of annual fee