Character recognition method & apparatus

Abstract: A character recognition apparatus and method for recognizing an unknown character by comparing strokes of the input character with stroke information stored in a dictionary. Each stroke of the input character is classified into one of plural categories according to stroke direction. The classified input strokes are rearranged into groups of strokes having the same classification. The degree of analogy between rearranged input strokes and stroke information stored in the dictionary for each group of similarly classified stroke group is calculated based on stroke length, and a maximum analogous element for each input stroke according to the calculated degree of analogy is detected. The detected maximum analogous elements are summed together, and the character whose sum is maximum is output as the identity of the unknown input character.

Description: This invention relates to a character recognition method and apparatus for recognizing an unknown input character by comparing input strokes of the input character with strokes of dictionary data. Character recognition methods are multistep processes for comparing an unknown character pattern to standard character patterns stored in a collated dictionary. First, one of the standard patterns which has the same number of strokes as the unknown character pattern is selected. Then, the degree of analogy between each stroke of the unknown character pattern and each stroke of the selected standard pattern is calculated, for example, by evaluating normalized positional coordinates of the start point and the end point of each stroke. Then, an analogy matrix whose elements comprise the calculated degrees of analogy is obtained. The maximum value in each column of the analogy matrix is detected, and the rows of the analogy matrix are then inspected to determine whether or not there is only a single maximum matrix element in each row. If the result of the determination is positive, the maximum matrix elements in all the rows are added and the sum is stored as a first result of addition. If the result of the determination is negative, a small matrix is formed by extracting rows from the analogy matrix where two or more maximum matrix elements are present. Elements from the small matrix are selected such that only one element is selected from each row of the small matrix. The above-described maximum matrix elements are again selected from all the rows and columns of the analogy matrix except those elements constituting the small matrix, and the maximum of all the rows are added to the above-described selected small-matrix elements. The sum is stored as a second result of addition. The above action is repeated for all the standard patterns. All of the first and second results of addition are inspected to determine which one is the maximum, and standard-pattern information corresponding to the maximum is output as the identity of the unknown character. In the above-described conventional approach, however, since all strokes of an unknown character are compared with all strokes of many standard patterns, a large amount of calculation is required for calculating the matrices of analogy between strokes. Moreover, since matrices of analogy between strokes are obtained for all of the standard character patterns which have the same number of strokes as an unknown character pattern (for example, if a character is input, all characters having eight strokes, such as , and the like), a large amount of calculation is required, and much time is needed for a recognition operation. And, even though the standard character patterns that are compared to the unknown character pattern are limited to those standard character patterns having the same number of strokes, the number of compared character patterns is still rather large. Accordingly, unknown character patterns are mis-identified frequently. An article by M. Nakagawa et al entitled "On-line recognition of handwritten Japanese characters in JOLIS-1" (Proceedings of Pattern Recognition 1982, pages 776-779) discloses a character recognition method in which input characters are compared to dictionary characters which have the same number of strokes in order to recognise input characters. An article by Y. Juang entitled "On-line recognition of handwritten Chinese characters: A syntactic-semantic approach" (Proceedings of TENCON '87, Vol 1/3, 25 August 1987, Seoul, Korea, pages 91-95) discloses a recognition method in which strokes of input characters are classified into categories and the input character is preclassified according to the number of structural radicals and the number of strokes. According to one aspect, the present invention provides a character recognition apparatus for recognising an input character by comparing strokes of the input character with stroke information stored in a dictionary, said apparatus comprising: input-stroke classification means for classifying each stroke of an input character into one of a plurality of different categories; rearrangement means for rearranging classified input strokes into groups of strokes which have the same category; dictionary means for storing standard-stroke data in units of one character; detection means for calculating, for each unit of standard-stroke data stored in said dictionary means having the same number of strokes in each category as the input character, a degree of similarity between the input strokes rearranged by said rearrangement means and the stroke information stored in said dictionary for each group of strokes classified into the same category, and for detecting a maximum similar element for each input stroke according to the calculated degree of similarity; adding means for adding, for each of the units of stored standard-stroke data having the same number of strokes in each category as the input character, the similarity values of the maximum similar elements detected by said detection means; and output means for outputting a character whose sum of similarity values of maximum similar elements is maximum. According to a second aspect, the present invention provides a character recognition method for recognising an input character by comparing strokes of the input character with stroke information stored in a dictionary in units of one character, said method comprising the steps of: classifying each stroke of an input character into one of a plurality of different categories; rearranging the classified input strokes into groups of strokes which have the same category; for each unit of standard-stroke data stored in said dictionary having the same number of strokes in each category as the input character, calculating a degree of similarity between the input strokes rearranged by said rearranging step and the stroke information stored in said dictionary for each group of strokes classified into the same category, and detecting a maximum similar element for each input stroke according to the degree of similarity; for each of the units of stored standard stroke data having the same number of strokes in each category as the input character, adding the similarity values of the maximum similar elements detected by said detecting step; and outputting a character whose sum of similarity values of maximum similar elements is maximum. Embodiments of the present invention will now be described with reference to the accompanying drawings, in which: FIG. 1 is a block diagram showing the functional configuration of a character recognition apparatus according to a first embodiment of the present invention; FIG. 2 is a block diagram showing the schematic configuration of the character recognition apparatus of the first embodiment; FIG. 3 is a diagram illustrating vectors in eight directions as an example of stroke vectors classified by an input-stroke classification unit; FIG. 4 is a diagram illustrating a directional vector obtained by connecting the start point and the end point of an input stroke; FIG. 5 is a diagram showing the structure of stroke data stored in the dictionary 15 shown in FIGS. 1 and 2; FIG. 6 is a diagram illustrating input strokes when a character is input by hand writing; FIG. 7 is a diagram illustrating a matrix of analogy between strokes of directional vector 2 when the character shown in FIG. 6 is input; FIG. 8 is a flowchart showing processing procedure of matching between input strokes and one-character strokes stored in a dictionary; and FIGS. 9(a) and 9(b) are diagrams showing examples of input strokes in a second embodiment of the present invention. First Embodiment FIG. 1 is a block diagram showing the functional configuration of a character recognition apparatus according to a first embodiment of the present invention. In FIG. 1, stroke input unit 11, comprising a conventional digitizer or the like, inputs input strokes in the form of coordinate data. Input-stroke classification unit 12 classifies the input strokes input from stroke input unit 11 into nine classifications, i.e., eight vectors and a point, according to the length and direction of a directional vector obtained by connecting the start point and the end point of each of the input strokes. Input-stroke rearrangement unit 13 rearranges the input strokes classified by input-stroke classification unit 12 for each group of the same classification, such as stroke data of classification 1, stroke data of classification 2, and the like, in accordance with the classification performed by the input-stroke classification unit 12 irrespective of the input sequence of the strokes. Maximum-analogous-element detection unit 14 calculates the degree of analogy between each of the input strokes and a standard stroke stored in dictionary 15, forms an analogy matrix using the calculated degrees of analogy, and detects the maximum analogous element in each column of the matrix of analogy between strokes of the same classification. Dictionary 15 arranges standard-stroke data in units of a character for strokes of the same classification in accordance with the above-described classification of strokes. Maximum-analogous-element determination unit 16 determines whether or not the maximum analogous element detected by maximum-analogous-element detection unit 14 is unique in each row. If the result of the determination is negative, an element selected from among a plurality of analogous elements present in the row according to the sequence of the data stored in dictionary 15 is made to be the maximum analogous element in the row. Recognition-result output unit 17 adds the maximum analogous elements for each character detected by comparison with dictionary 15, and outputs the character pattern stored in dictionary 15 for which the result of the addition has the maximum value as the result of recognition. FIG. 2 is a block diagram showing the schematic configuration of the character recognition apparatus of the present embodiment. In FIG. 2, coordinate input unit 31, comprising a conventional digitizer or the like, inputs input strokes in the form of coordinate data. When input of one character has been completed, coordinate data for the character are transmitted to control unit 32 in the sequence of input. Control unit 32 comprises CPU (central processing unit) 33 for executing processing, ROM (read-only memory) 34 for storing the dictionary (having the structure of dictionary data shown in FIG. 5 (to be described later)), and for storing processing procedure 34a (the flowchart shown in FIG. 8 (to be described later)) and the like, and a RAM (random access memory) 35 for storing input stroke data and the like. CPU 33 processes input strokes in accordance with processing procedure 34a stored in the ROM 34, recognizes the hand-written input character by comparing the character's strokes with standard strokes in dictionary 15 stored in ROM 34, and outputs a character code which is the result of the recognition. FIG. 3 is a diagram illustrating vectors in eight directions as an example of classification of stroke vectors classified by the input-stroke classification unit 12 shown in FIG. 1. FIG. 4 is a diagram illustrating a directional vector obtained by connecting the start point and the end point of an input stroke. When a stroke indicated by a solid line, having point A as the start point and point B as the end point, is input, a broken line connecting points A and B is considered to be the directional vector of the stroke.Referring to FIG. 3, this stroke equals the stroke of directional vector 3. If the length of the stroke from point A to point B is less than a predetermined length, as in the case of a voiced sound signal in a Japanese character, directional vector 9 is assigned for the stroke since the direction of the stroke is unstable. FIG. 5 is a diagram showing the structure of stroke data stored in the dictionary 15. In FIG. 5, the structure of data for one character of the dictionary 15 stored within ROM 34 is illustrated. At the head, character code 51 which represents the identity of the character is present. Next, normalized relative positional coordinate data 52 of the start point and the end point of stroke data of the character classified as directional vector 1 are stored. A directional-vector end code is stored at the end of each of the stroke data classified as directional vector 1. Stroke data classified as directional vector 2 are stored from the next address. In the same manner, vector data are sequentially stored until directional vector 9. Thus, the data for each of the strokes are grouped by directional vectors such that the stroke data for directional vector 1 is grouped together, the stroke data for directional vector 2 is grouped together, etc. The end of the data of the character is indicated by character-data end code 54. FIG. 6 is a diagram illustrating an example of input strokes when a character is input by hand writing. A numeral indicated at the side of each stroke represents the sequence of input of the stroke (the sequence of hand writing). FIG. 7 is a diagram illustrating a matrix of analogy 60, in the direction of directional vector 2, between strokes of an unknown character, here the character shown in FIG. 6 and strokes of a standard pattern in the character dictionary. is input. Numerals 1, 3, 4, 7 and 8 correspond to the stroke numbering shown in FIG. 6 and indicate the sequence of hand writing at the input operation. Numerals 21, 22, 23, 24 and 25 correspond to stroke numbering of the standard pattern, for example, numeral 21 indicates the 1st data of directional vector 2. The symbolO represents the maximum analogous element detected in the direction of the column of the matrix. The symbol x represents the maximum analogous element selected by maximum-analogous-element determination unit 16 shown in FIG. 1. FIG. 8 is a flowchart showing a processing procedure of matching between input strokes and strokes of one character in dictionary 15. An explanation will now be provided of the processing procedure of the present embodiment with reference to the flowchart shown in FIG. 8. In step S81, classification processing of input strokes is performed. As shown in FIGS. 3 and 4, input strokes are classified into eight directions according to the direction of the directional vector connecting the start point and the end point of an input stroke. When the size of an input stroke is small compared with the size of the entire character and is less than a predetermined value, that is, the input stroke comprises a point or the like, the input stroke is classified as the ninth directional vector. The process then proceeds to step S82. In step S82, the input strokes are rearranged into groups such that each stroke in a group has the same classification. That is, irrespective of the order in which the strokes were input the input strokes are rearranged in the order of directional vectors. For example, the pattern shown in FIG. 6 is input in the sequence of numerals indicated at the sides of respective strokes. If these strokes are classified in step S81, strokes 1, 2, 3, 4, 5, 6, 7 and 8 are classified as directional vectors 2, 4, 2, 2, 4, 3, 2 and 2, respectively. The strokes are sequentially arranged from strokes of directional vector 1. In the pattern shown in FIG. 6, no stroke is classified as directional vector 1. Strokes 1, 3, 4, 7 and 8 are classified as directional vector 2, strokes 2 and 5 are classified as directional vector 4, and stroke 5 is classified as directional vector 4. The strokes are rearranged in accordance with those classifications within each classification, the strokes are ordered in accordance with their location in the x-y plane. For example, in the case of directional vector 2, strokes of the same directional vector are rearranged in the sequence of the y coordinate shown in FIG. 6, i.e., in the sequence of strokes 1, 3, 4, 7 and 8. In the case of directional vector 4, strokes are arranged in the sequence of the x coordinate shown in FIG. 6, i.e., in the sequence of strokes 2 and 5. After rearrangement, the arrangement of strokes is the same as the arrangement of stroke data of a standard character pattern within dictionary 15 shown in FIG. 5. In step S83, standard patterns in the dictionary data having the same classified numbers of input strokes are retrieved. That is, in the pattern shown in FIG. 6, no stroke is classified as directional vector 1, five strokes are classified as directional vector 2, one stroke is classified as directional vector 3, two strokes are classified as directional vector 4, and no stroke is classified as directional vectors 5, 6, 7, 8 and 9. Characters having the same classified numbers of strokes stored in dictionary 15 are retrieved. That is, character patterns, in which the number of stroke of directional vector 1 is zero, the number of strokes of directional vector 2 is five, the number of stroke of directional vector 3 is one, the number of strokes of directional vector 4 is two, and the numbers of strokes of directional vectors 5, 6, 7 and 8 are zero, are retrieved. In steps after step S84, matching processing between the input pattern and the character patterns (standard patterns) of dictionary 15 retrieved in step S83 is performed to obtain the result of recognition. In step S84, processing of detecting the maximum analogous element in each column of the matrix of analogy between strokes is performed for each of the input strokes and strokes of a character pattern of dictionary 15 of the same classification (the same directional vector). That is, the matrix of analogy between strokes of directional vector 2 of the pattern shown in FIG. 6 is formed as shown at 60 in FIG. 7. In this matrix, the maximum analogous element in the degree of analogy between strokes (evaluated, for example, by normalized positional coordinates of the start point and the end point of each stroke) is detected in each column (in the vertical direction). Thus, strokes having the high degree of analogy are detected as indicated by ○ in FIG. 7. Such processing is also performed for each of the directional vectors, namely, directional vectors 3 and 4 in this example. The above-described processing is performed for all character data of dictionary 15 retrieved in step S83, and a recognition operation is performed according to the result of the processing. That is, in step S85, it is determined whether or not the number of maximum analogous elements detected in respective columns in step S84 is unique in each row. If the result of the determination is affirmative, the process proceeds to step S87, where processing of adding the maximum analogous elements is performed. If the result of the determination in step S85 is negative, the process proceeds to step S86, where processing of selecting only one maximum analogous element in each row is performed. That is, when the maximum analogous element indicated by "○" has been detected in each column (in the vertical direction) as shown in FIG. 7, it is checked whether or not only one maximum analogous element indicated by "○" is present in each row. In the case of FIG. 7, only one maximum analogous element is present for input vectors 1, 3 and 4, but two maximum analogous elements are present for input vector 7, and no maximum analogous element is present for input vector 8. Hence, the process proceeds to step S86. In step S86, the process of selecting the maximum analogous element in a row where two or more maximum analogous elements are present according to the sequence of data of dictionary 15 is performed. Such a case seldom occurs if a character is input in a correct form. However, if the pattern shown in FIG. 6 is input, since strokes 7 and 8 are present at substantially the same position, two strokes representing lower lateral lines of the character of the dictionary may coincide. As described above, in order to recognize a character, each input stroke must be in the relationship of one-to-one correspondence with respect to each stroke of the character stored in the dictionary. Hence, portions where one-to-one correspondence is not realized (for example, input strokes 7 and 8 and dictionary strokes 24 and 25 in FIG. 7) are extracted, and rearrangement is performed so as to provide one-to-one correspondence. Since the classified input strokes and the strokes stored in dictionary 15 are arranged according to the same method, correspondence between strokes may be performed in the sequence of storage. That is, in the case of FIG. 7, rearrangement is performed so that stroke 7 corresponds to stroke 24, and stroke 8 corresponds to stroke 25. The result of the correspondence is indicated by x in FIG. 7. In step S87, processing of adding the maximum analogous elements is performed. The maximum analogous elements between all the input strokes and the dictionary strokes obtained in steps S84, S85 and S86 are added. The result of the addition is made to be the degree of coincidence between the input character and the character pattern of the dictionary. The processing from step S84 to step S87 is performed for all the character patterns retrieved in step S83, and the character pattern having the highest degree of coincidence (for which the result of the addition has the largest value) is made to be the result of recognition. Second Embodiment In the above-described first embodiment, the input-stroke classification unit classifies input strokes according to the directional vector connecting the start point and the end point of an input stroke. However, classification may also be performed according to a directional vector obtained by connecting the start point, the middle point and the end point of an input stroke. As shown in FIGS. 9(a) and 9(b), when strokes indicated by solid lines AB and CD are input, the first embodiment classifies the two strokes as the strokes of the same kind, namely directional vector 3, since a stroke is classified according to the directional vector connecting the start point and the end point of the stroke. However, if a stroke is classified according to a directional vector connecting the start point, the middle point and the end point of the stroke, the stroke AB shown in FIG. 9(a) is classified as directional vector 33 comprising A'BB, and the stroke CD shown in FIG. 9(b) is classified as directional vector 24 comprising CD'D. That is, the two strokes are classified as different strokes. While the number of the kinds of classified strokes increases, the number of character patterns retrieved in retrieval of dictionary data (step S83 shown in FIG. 8) decreases. Hence, it is possible to output the result of recognition which is more precise than in the first embodiment. As explained above, according to the above-described embodiments, by classifying input strokes, rearranging the input strokes into groups having the same classification, and detecting the maximum analogous element in a matrix of analogy between input strokes and dictionary strokes of the same classification, it is possible to reduce the amount of calculation of the matrix of analogy between strokes, and therefore to reduce the time for recognition. In addition, since the number of character patterns of a dictionary to be matched with the input character is limited by classifying input strokes, it is also possible to shorten the time for recognition, and to reduce misrecognition. Moreover, since processing is performed irrespective of the sequence of input strokes of a character to be recognized, the character can be input in a degree sequence of strokes or no sequence of strokes, such as when the unknown character is scanned in or received by facsimile transmission. The present invention may be applied to a system comprising a plurality of units, or to an apparatus comprising a single unit. Furthermore, the present invention may, of course, be applied to a case in which the object of the invention can be achieved by supplying a system or an apparatus with programs for executing a process defined by the invention.

Claims: A character recognition apparatus for recognising an input character by comparing strokes of the input character with stroke information stored in a dictionary, said apparatus comprising: input-stroke classification means (12) for classifying each stroke of an input character into one of a plurality of different categories; rearrangement means (13) for rearranging classified input strokes into groups of strokes which have the same category; dictionary means (15) for storing standard-stroke data in units of one character; detection means (14) for calculating, for each unit of standard-stroke data stored in said dictionary means (15) having the same number of strokes in each category as the input character, a degree of similarity between the input strokes rearranged by said rearrangement means and the stroke information stored in said dictionary for each group of strokes classified into the same category, and for detecting a maximum similar element for each input stroke according to the calculated degree of similarity; adding means (16) for adding, for each of the units of stored standard-stroke data having the same number of strokes in each category as the input character, the similarity values of the maximum similar elements detected by said detection means; and output means (17) for outputting a character whose sum of similarity values of maximum similar elements is maximum. A character recognition apparatus according to claim 1, wherein said input-stroke classification means (12) is adapted to classify each stroke based on stroke direction. A character recognition apparatus according to claim 1 or claim 2, further comprising stroke length determining means for determining the stroke length of each stroke of the input character, and wherein said detection means is adapted to calculate the degree of similarity based on the stroke length. A character recognition apparatus according to claim 1 or claim 2, wherein said detection means (14) is adapted to calculate the degree of similarity between the input strokes rearranged by said rearrangement means (13) and the stroke information in said dictionary means (15) for each similarly classified stroke group, to form a similarity matrix comprising the calculated degrees of similarity as elements thereof, to detect a maximum matrix element in each column or in each row of the similarity matrix, and to make the detected maximum matrix elements as the maximum similar elements. A character recognition apparatus according to any preceding claim, wherein said dictionary means (15) has a data structure in which dictionary-stroke information of respective dictionary character patterns are arranged into groups of strokes which have said same category. A character recognition method for recognising an input character by comparing strokes of the input character with stroke information stored in a dictionary in units of one character, said method comprising the steps of: classifying each stroke of an input character into one of a plurality of different categories; rearranging the classified input strokes into groups of strokes which have the same category; for each unit of standard-stroke data stored in said dictionary having the same number of strokes in each category as the input character, calculating a degree of similarity between the input strokes rearranged by said rearranging step and the stroke information stored in said dictionary for each group of strokes classified into the same category, and detecting a maximum similar element for each input stroke according to the degree of similarity; for each of the units of stored standard stroke data having the same number of strokes in each category as the input character, adding the similarity values of the maximum similar elements detected by said detecting step; and outputting a character whose sum of similarity values of maximum similar elements is maximum. A character recognition method according to claim 6, wherein said input-stroke classification step classifies each stroke based on stroke direction. A character recognition method according to claim 6 or claim 7, further comprising the step of determining the stroke length of each stroke of the input character, and wherein said detection step calculates the degree of similarity based on the stroke length. A character recognition method according to claim 6 or claim 7, wherein said detecting step includes the steps of calculating the degree of similarity between the input strokes rearranged by said rearranging step and stroke information stored in said dictionary for each similarly classified stroke group, forming a similarity matrix comprising calculated degrees of similarity as elements thereof, detecting a maximum matrix element in each column or in each row of the similarity matrix, and making the detected maximum matrix elements as the maximum similar elements. A character recognition method according to any one of claims 6 to 9, wherein the dictionary has a data structure in which dictionary-stroke information of respective dictionary character patterns are arranged into groups of strokes which have said same category. A character recognition method according to any one of claims 6 to 10, wherein the steps are executed by a program stored in a computer readable memory.

Inventors: ARAI TSUNEKAZU, MATSUBAYASHI KAZUHIRO, MORI SHIGEKI, SAKAGUCHI KATSUHIKO, ARAI, TSUNEKAZU, MATSUBAYASHI, KAZUHIRO, MORI, SHIGEKI, SAKAGUCHI, KATSUHIKO, ARAI, TSUNEKAZU, C/O CANON KABUSHIKI KAISHA, MATSUBAYASHI, KAZUHIRO, C/O CANON KABUSHIKI KAISHA, MORI, SHIGEKI, C/O CANON KABUSHIKI KAISHA, SAKAGUCHI, KATSUHIKO, C/O CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1992
Main classification: G06K9
IPC codes: G06K9