Character recognition method and apparatus thereof

Abstract: Character recognition method and apparatus according to the present invention comprises the partial pattern dictionary which classifies and registers partial patterns of characters to be recognized in accordance with direction data of strokes and the partial pattern composition dictionary which classifies and registers dictionary characters in accordance with the partial patterns. When a character image to be recognized is inputted, each stroke is converted into direction data. The partial pattern dictionary is searched by using the attained direction data and divides the character image to be recognized into a single or plurality of partial patterns. The partial pattern composition dictionary is searched by using the partial patterns attained in the above-described way. A dictionary character is thus attained as the result of recognition.

Description: The present invention relates to a character recognition method and apparatus and, more particularly, to a character recognition method and apparatus which perform character recognition at real time based on input strokes of a character image. The typical methods for recognizing a character image in a conventional apparatus are as following: (1) Method utilizing the order of making strokes of a character image in writing and its figure; (2) Method utilizing the positional relation of input strokes; and (3) Method analyzing the change of position of a stroke in a time sequence by Fourier transform. In method (1), there is a problem when strokes of the character image to be recognized are inputted in wrong order. To cope with this problem, expected orders of strokes for characters which may be inputted in wrong order are registered in a dictionary, however, it has not been effective so far. In method (2), there is the problem that it is difficult to define the positions of strokes of characters for numerous user. In method (3), there is the problem that a wave is irregularly changed by effects of the order of strokes. Furthermore, in these methods, when a plurality of character images are inputted, it is difficult to segment character images in an input apparatus which does not have a frame to define each of inputted character images. From PROCEEDINGS, TENCON '87 vol. 1/3, 25 August 1987, SEOUL, KOREA, pages 91 - 95, Y. JUANG 'On-line recognition of handwritten Chinese characters: a syntactic-semantic approach' a method of type ( 1) for recognising a character image is known. According to a first aspect of the present invention, there is provided character recognition apparatus comprising: obtaining means for obtaining data for each stroke of a character image to be recognised; determining means for determining stroke numbers for the obtained data; a partial pattern dictionary registering partial patterns of character images and stroke numbers for their component strokes; partial pattern determining means for determining one or more partial patterns; a character composition dictionary registering character images and the or each partial pattern forming each character image; and character recognising means for recognising a character by matching the or each determined partial pattern with the or each partial pattern of the character using said character composition dictionary; and output means for outputting the recognised character; characterised by: said determining means using a stroke dictionary for registering stroke numbers and data for corresponding strokes, the stroke numbers being ordered sequentially by number regardless of the stroke order; and said partial pattern determining means sorting the determined stroke numbers to be ordered sequentially by number regardless of stroke order, and matching the sequence of determined stroke numbers with stroke numbers of said partial dictionary. A second aspect of the invention provides a character recognition method comprising the steps of: obtaining data for each stroke of a character image to be recognised; determining stroke numbers for the obtained data; determining one or more partial patterns; recognising a character by matching the or each determined partial pattern with the or each partial pattern of a character using a character composition dictionary which registers character images and the or each partial pattern forming each character image; and outputting the recognised character; characterised by the steps of: determining the stroke numbers for the obtained data by using a stroke dictionary registering stroke numbers and data for corresponding strokes, the stroke numbers being ordered sequentially by number regardless of the stroke order; and matching the sequence of determined stroke numbers with stroke numbers of a partial pattern dictionary which registers partial patterns of character images and stroke numbers for their component strokes, where the stroke numbers are ordered sequentially by number regardless of the stroke order. Embodiments of the present invention will now be described with reference to the accompanying drawings, in which: Fig. 1 is a block diagram illustrating a functional structure of the present embodiment; Fig. 2 is a diagram illustrating vectors indicating eight stroke directions of the present embodiment; Fig. 3 is a diagram illustrating a process to extract direction vectors of each stroke of the character " " which is an example used as an input for the present embodiment; Fig. 4 is a diagram illustrating the determined direction vectors for each stroke of the character " " which is an example for an input of the present embodiment; Fig. 5 is a diagram illustrating a data structure of a stroke dictionary of the present embodiment; Fig. 6 is a diagram illustrating the result of feature stroke number extraction to " " which is an example for an input of the present embodiment; Fig. 7 is a diagram illustrating a data structure of a partial pattern dictionary of the present embodiment; Fig. 8 is a diagram illustrating a partial pattern composition dictionary of the present embodiment; Fig. 9 is a flowchart illustrating a procedure for a character recognition processing of the present embodiment; Fig. 10 is a flowchart illustrating a procedure for a partial pattern extraction processing in the present embodiment; Fig. 11 is a flowchart illustrating a procedure for extracting a character image to be recognized in the second embodiment; and Fig. 12 is a diagram illustrating a structure of the character recognition apparatus of the first embodiment. [First Embodiment] Fig. 12 is a diagram illustrating a structure of the character recognition apparatus of the present embodiment. In Fig. 12, numeral 100 is a CPU which executes various controls of the character recognition apparatus in accordance with control programs stored in a ROM 101. The control program which is described later is also stored in the ROM 101 and executed under the control of the CPU 100. Numeral 102 is a RAM having areas where data are temporary stored when the CPU 100 executes various controls. A keyboard 103 inputs various commands and data to the CPU 100. Numeral 104 is a digitizer. When a hand-written character image is inputted, strokes of the image are read as a string of coordinates data. Numeral 105 is a display which displays the result of recognition of the hand-written character image inputted from the digitizer 104. Numeral 4 is a stroke dictionary where a feature stroke number and direction data are paired. The feature stroke is data on each of three vectors indicating a direction, which is obtained by dividing a stroke into three, and data on an order that each vector is inputted. The feature stroke number is a number which identifies each feature stroke. The direction data is data expressing an arrangement (combination) of three vectors indicating directions when each stroke is decomposed to three direction vectors (to be described later in Fig. 5). Numeral 6 is a partial pattern dictionary where a partial pattern number and feature stroke data are paired. A partial pattern is a pattern comprising a part of the character image or whole character image which is defined by a single or plurality of feature strokes. A partial pattern number is a unique number which specifies each partial pattern. The feature stroke data is data expressing a partial pattern by feature stroke numbers (to be described later in Fig. 7). Numeral 8 is a pattern composition dictionary which stores a number for specifying a character image (character code) and partial patterns comprising a character image in pair (to be described later in detail along with Fig. 8). The operation of the character recognition apparatus is described along with Figs. 1 and 9. Fig. 1 is a block diagram illustrating a functional structure and Fig. 9 is a flowchart illustrating a procedure for a character recognition processing in the character recognition apparatus of the present embodiment. At step S101, when a character image to be recognized is inputted from a digitizer 104, each stroke of the character image is extracted at step S102. In the stroke input unit 1, while a stroke of a hand-written character image is inputted, sampling of coordinates where the pen point touches the input surface is performed at predetermined interval, and coordinates data is thus obtained for each point. In this way, a set of the coordinates data for the stroke is generated and stored in an area Sn which is reserved in a RAM 102. The set of coordinates data for a single stroke stored in the area Sn is referred to as "stroke data". In this way, the input unit 1 extracts strokes for a single character image which is inputted from the digitizer 104 and transfers to a stroke characterization unit 2. At step S103, the stroke characterization unit 2 divides each stroke, which is expressed by the set of coordinates data, into three parts and each stroke is expressed by three vectors. At step S104, each direction vector is numbered to indicate one of eight directions as shown in Fig. 2. The processing in the stroke input unit 1 and stroke characterization unit 2 (steps S101-S104) are further described along with Figs. 2-4. Fig. 2 is a diagram showing the above-described eight directions which are respectively numbered. Fig. 3(a) is a diagram illustrating the processing for a stroke extraction in the stroke input unit 1 when the character " " is inputted, for an example. The numbers 1 through 9 indicate the order of making strokes, that is, the input order. In the case of " ", the data on nine strokes are extracted and transferred to the stroke characterization unit 2. As shown in Fig. 3(b), the stroke characterization unit 2 divides each stroke into three parts in accordance with the stroke data inputted from the stroke input unit 1 so as to be three vectors. Each vector attained by dividing the stroke is numbered to indicate a direction as shown in Fig. 2. Accordingly, three vector numbers respectively indicating a direction are given to each stroke. Fig. 4 is a table of the direction data which is a set of vector numbers for each stroke. These direction data are outputs of the stroke characterization unit 2. In a stroke classification determining unit 3, the stroke dictionary 4 is searched based on the above direction data which is inputted from the stroke characterization unit 2. The stroke dictionary 4 stores the direction data and feature stroke number in pair. The direction data is converted to the feature stroke number with reference to the stroke dictionary 4 (steps S105, S106, and S107). Fig. 5 illustrates the contents registered in the stroke dictionary 4. The stroke dictionary 4 contains the feature stroke numbers of commonly used kanji (Chinese characters) (170 kinds in this embodiment). In the case where the direction data which are transferred from the stroke characterization unit 2 are not completely matched with the data in the stroke dictionary 4, a feature stroke number having the most similar direction data is determined for the inputted stroke (S108). For example, in the case where one of the three vector numbers (direction) are not matched with the direction data in the stroke dictionary 4, a feature stroke number including a vector number which indicates the closest direction to the inputted data is selected. That is, in Fig. 2, the vector indicated by the direction number 4 is closest to the direction numbers 5 and 3. In a partial pattern determination unit 5 of Fig. 1, a single or a plurality of partial pattern numbers which coincide with the partial patterns registered in the partial pattern dictionary 6 are extracted based on the above feature stroke number (S109). The detail of the processing is described later along with the flowchart of Fig. 10. Fig. 7 is a data structure of the partial pattern dictionary 6. In the present embodiment, a partial pattern number (partial pattern numbers 71) which is comprised of a combination of at most seven feature stroke numbers (feature stroke data 73) can be registered. In Fig. 7, the data on the partial patterns indicated by numeral 72 are added for convenience sake, but are not actually included by the partial pattern dictionary 6. The number of the partial pattern number are arranged in numerical order as 1 ... 32 ... 58 ..., however, the feature stroke data corresponding to these numbers are arranged in the order from the data containing the feature stroke numbers at most. For example, the partial pattern number 1 corresponds to the feature stroke data having seven feature stroke numbers such as 40, 40, ..., 102 and the partial pattern number 58 corresponds to the feature stroke data having four feature stroke numbers such as 40, 66, 85, 102. As shown the feature stroke data 73, the feature stroke numbers included in each partial pattern are registered in an ascending order regardless of the stroke order. For the character image " ", the partial patterns " " and " " (the partial patterns numbers 58 and 32) are extracted by the partial pattern discrimination unit 5 and outputted to the partial pattern composition determining unit 7. In the partial pattern composition determining unit 7, a character code is attained as the result of recognition by searching the partial pattern composition unit 8 with the plurality of partial patterns. Fig. 8 is a diagram illustrating an internal structure of the partial pattern composition dictionary 8. In Fig. 8, each partial pattern and character code are expressed by a character pattern, however, they are actually registered in the partial pattern code and code number. The leading partial patterns 81 includes a partial pattern which is first extracted from the all partial patterns included in the character image to be recognized by the partial pattern determination unit 5. To increase the speed in searching the dictionary and decrease the capacity of the dictionary, partial patterns are classified based on the leading partial pattern in the dictionary. The partial patterns 82 (which are inputted after the leading partial pattern) show a combination of partial patterns which are extracted by the partial pattern determination unit 5. A single character image is comprised of a leading partial pattern (81) and other partial patterns (82). The character code 83 includes a code expressing a pertinent character comprising the above-described partial patterns. As mentioned above, a code is replaced by a character pattern in Fig. 8. In the partial patterns other than the leading partial pattern, a special code which is not used for the partial pattern numbers is given to "NONE". In this case, it is judged that only the leading partial pattern comprises a single character image and a pertinent character code is given. Accordingly, in the partial pattern composition determining unit 7, the leading partial patterns 81 of the partial pattern composition dictionary 8 are searched by using the partial pattern (leading partial pattern) which is first extracted by the partial pattern determination unit 5 (step S110). The partial patterns (82) which are inputted after the leading partial pattern are searched in an area storing partial patterns which can be combined with the leading pattern. In the above-mentioned example of " ", the leading partial pattern is " " which is first extracted by the partial pattern discrimination unit 5. Since the other partial pattern is " ", the character code corresponding to " " is attained in Fig. 8. In this way, the character code of the recognition result to the input stroke can be attained and the character of the result is displayed at the output unit 9. The processing of the operation of the partial pattern determination unit 5 is described in detail along with a flowchart of Fig. 10. At step S1, a series of the all feature stroke numbers of inputted character images which are classified and discriminated by the stroke classification determining unit 3 are stored in a feature stroke storage buffer TS. The feature stroke storage buffer TS is an area reserved in the RAM 102. At step S2, whether or not the total of the feature stroke number m in the TS is larger than 7 is determined. In the case where m > 7, n = 7 is set at step S3. When m < 7, m = n is set at step S4. At step S5, n feature stroke numbers are extracted from the feature stroke storage buffer TS and stored in an area Ln which is reserved in the RAM 102. At step S6, n feature stroke numbers which are set at step S5 are rearranged in numerical order of the values and set in an area L'n which is reserved in the RAM 102. At step S7, the feature stroke data 73 of the partial pattern dictionary 6 and the area L'n are compared. As shown in Fig. 7, since the partial patterns in the partial pattern dictionary 6 are registered in the order from the partial patterns having the feature stroke numbers at most, only the area which stores the partial patterns comprising n feature stroke numbers can be searched. In this way, the comparison is sequentially performed and if a partial pattern which coincides with the input is found, the processing proceeds to step S9 from S8 and the pertinent partial pattern is transferred to the partial pattern composition determining unit 7. In the case where n strokes are compared with the partial pattern including the feature stroke data and a matched partial pattern is not extracted, the processing is proceeds to step S12 from S8. At step S12, n is subtracted by one in order to reduce the number of stroke. If the result n is negative or zero, it is judged that it is impossible to recognize a partial pattern from step S13. In the case where n is positive, the process returns to step S5 and the above-mentioned processing is repeated. Since a matched partial pattern normally exists from n th to first stroke, the process proceeds to step S9 from S8. When the processing at step S9 is completed, n strokes from the beginning from the buffer TS are removed in order to remove the strokes corresponding to a partial pattern which has been already attained at step S10. The processing of the partial pattern discrimination unit 5 is completed when the feature stoke of the TS is all removed. If remains, the process returns to step S2 from step S11 where the above6described processing is repeated. Thus, all feature strokes are extracted from the inputted character image. Accordingly, the partial pattern of the inputted character image is determined by using the partial pattern dictionary 6 and partial pattern composition dictionary 8 and the inputted character image can be recognized stably by determining which partial patterns comprises the inputted character image. Furthermore, since the stroke order in the partial pattern does not have to depend on the order of the input stroke by rearranging the feature stroke numbers in the partial pattern dictionary, the recognition efficiency influenced by changes of the stroke order depending upon a user can be improved. According to the above6mentioned dictionary structure, an inputted character image can be recognized by searching the dictionary in a predetermined area, i.e., in a unit of partial pattern, without searching the all contents of the dictionary, resulting in a high speed character recognition. Even though the kinds of dictionaries are increased, memory size of the dictionary can be reduced in comparison with the conventional recognition method, since the capacity of each dictionary is small. [Second Embodiment] The character recognition apparatus 1 of the first embodiment extracts strokes for a character and performs a character recognition on each character one at a time based on feature of the strokes. The apparatus of the second embodiment differs from that of the first embodiment in segmentation of the characters which are sequentially inputted. The hardware structure of the apparatus in the second embodiment is the same as that of the first embodiment shown in Fig. 12. The functional structure of the apparatus in the second embodiment is also the same as that of the first embodiment shown in Fig. 1. However, the processing in the partial pattern composition determining unit 7 is modified in the second embodiment. The processing of the first embodiment is that the combination of the partial patterns transferred from the partial pattern determination unit 5 and that of the partial pattern composition dictionary 8 are compared and a matched combination is outputted as the result of recognition. While in the second embodiment, the character recognition apparatus which automatically segments inputted characters is provided. The character recognition processing in the partial pattern composition determining unit 7 is described along with a flowchart of Fig. 11. At step S21, all partial pattern numbers which are transferred from the partial pattern determination unit 5 are inputted to a partial pattern composition buffer PS which is an area reserved in the RAM 102. At step S22, the partial pattern number first stored in the buffer PS is extracted. (Suppose that this partial pattern number is "T".) At step S23, the partial pattern number T, as a leading partial pattern, is compared with the data in the partial pattern composition dictionary 8. It is searched so as to coincide the partial patterns in the buffer PS following to the leading pattern whose number is T with the rest of partial patterns (82) inputted after the leading partial pattern in the partial pattern composition dictionary 8 at most. That is, the character code representing the character comprising the partial patterns which are registered in the buffer PS at most is searched. The character code which is searched in this way is outputted to the output unit 9 at step S24. At step S25, the number of the partial pattern numbers which are used at step S24 is detected. If this is N, N partial patterns are removed from the buffer PS in the order of input at step S26. In the buffer PS, a vacancy caused by removing the partial patterns is filled by the following partial patterns. At step S27, it is judged whether or not all partial patterns are removed from the buffer PS, and if removed, the present processing is completed. If the data remains in the buffer PS, the process returns to step S22 where the above-described processing is repeated. According to the above-described processing, an automatic segmentation of the inputted character images is enabled. For example, when " ", " ", and " " are sequentially inputted, the two characters of kanji, " " and " " are recognized by the above-described processing. In the above second embodiment, the apparatus automatically segments the character images, however, segmentation can be easily operated by a user. This can be realized when the arrangement for segmentation which is utilized in a Japanese word processor capable of inputting kana-kanji (Japanese syllabary-Chinese character) is provided, a boundary is indicated, and the search at step S23 is performed while the number of strokes is decreased. Take an example of the inputs " ", " ", and " ". If a segmentation is set to between " " and " ", the two kanji characters, " " and " " are recognized. If a segmentation is set to between " " and " ", the three kanji characters, " ", " ", and " " are recognized. As described above, efficiency of the character recognition is improved regardless of the changes of the input order and the positions of strokes depending on a user by providing the partial pattern composition dictionary of the partial patterns comprising each character. Since the information in the dictionaries is classified in detail and efficiency in condensation of the information is improved, the capacity for the dictionaries is reduced and high speed processing apparatus can be provided at low cast. Furthermore, according to the method and apparatus of the present invention, stable character recognition can be performed regardless of the input order and the relative changes influenced by input strokes, and automatic segmentation can be performed on the sequentially inputted character images. Furthermore, the present invention can be applied to the system comprising either a plurality of units or a single unit. It is needless to say that the present invention can be applied to the case which can be attained by supplying programs which execute the process defined by the present system or invention. As many apparently widely different embodiments of the present invention can be made without departing from the scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims.

Claims: A character recognition apparatus comprising: obtaining means for obtaining data for each stroke of a character image to be recognised; determining means ( 3 ) for determining stroke numbers for the obtained data; a partial pattern dictionary ( 6 ) registering partial patterns of character images and stroke numbers for their component strokes; partial pattern determining means ( 5 ) for determining one or more partial patterns; a character composition dictionary ( 8 ) registering character images and the or each partial pattern forming each character image; and character recognising means ( 7 ) for recognising a character by matching the or each determined partial pattern with the or each partial pattern of the character using said character composition dictionary ( 8 ); and output means ( 9 ) for outputting the recognised character; characterised by: said determining means ( 3 ) using a stroke dictionary ( 4 ) for registering stroke numbers and data for corresponding strokes, the stroke numbers being ordered sequentially by number regardless of the stroke order; and said partial pattern determining means ( 5 ) sorting the determined stroke numbers to be ordered sequentially by number regardless of stroke order, and matching the sequence of determined stroke numbers with stroke numbers of said partial dictionary (6). A character recognition apparatus according to claim 1 wherein said obtaining means (1, 2) is adapted to obtain direction data for each stroke. A character recognition apparatus according to claim 2 wherein said obtaining means (1, 2) comprises input means (1) for inputting stroke data comprising a set of coordinate data for each stroke, and direction determining means (2) for determining the direction data for each set of coordinate data. A character recognition apparatus according to claim 3 wherein said direction determining means (2) is adapted to divide each stroke into a plurality of parts, and to determine the direction of each part to form the direction data, and said stroke dictionary (4) registers stroke numbers and direction data identifying a plurality of directions for the plurality of parts of each stroke. A character recognition apparatus according to claim 4 wherein said direction determining means (2) is adapted to determine the direction of each part of each stroke by comparing the direction of each part to a plurality of labelled reference directions, and assigning the label of the closest reference direction to a part, and said stroke dictionary (4) registers stroke numbers and direction labels for corresponding strokes. A character recognition apparatus according to any preceding claim wherein said character recognising means (7) is adapted to match a first partial pattern determined by said partial pattern determining means (5) with a first partial pattern registered in said character composition dictionary (8), to match any subsequent partial patterns determined by said partial pattern determining means (5) with any partial patterns registered in said character composition dictionary (8) subsequent to the first partial pattern, and to recognise the character having the highest number of partial patterns matching determined partial patterns. A character recognition method comprising the steps of : obtaining data for each stroke of a character image to be recognised; determining stroke numbers for the obtained data; determining one or more partial patterns; recognising a character by matching the or each determined partial pattern with the or each partial pattern of a character using a character composition dictionary ( 8 ) which registers character images and the or each partial pattern forming each character image; and outputting the recognised character; characterised by the steps of: determining the stroke numbers for the obtained data by using a stroke dictionary (4 ) registering stroke numbers and data for corresponding strokes, the stroke numbers being ordered sequentially by number regardless of the stroke order; and matching the sequence of determined stroke numbers with stroke numbers of a partial pattern dictionary ( 6 ) which registers partial patterns of character images and stroke numbers for their component strokes, where the stroke numbers are ordered sequentially by number regardless of the stroke order. A character recognition method according to claim 7 wherein the obtaining step comprises obtaining direction data for each stroke. A character recognition method according to claim 8 wherein the obtaining step comprises the steps of inputting stroke data comprising a set of coordinate data for each stroke and determining the direction data for each set of coordinate data. A character recognition method according to claim 9 wherein the step of determining the direction data comprises the steps of dividing each stroke into a plurality of parts and determining the direction of each part to form the direction data, wherein the stroke dictionary (4) registers stroke numbers and direction data identifying a plurality of directions for the plurality of parts of each stroke. A character recognition method according to claim 10 wherein the step of determining the direction of each part comprises the steps of comparing the direction of each part to a plurality of labelled reference directions and assigning the label of the closest reference direction to a part, wherein the stroke dictionary (4) registers stroke numbers and direction labels for corresponding strokes. A character recognition method according to any one of claims 7 to 11 wherein the step of recognising a character comprises the steps of matching a determined first partial pattern with a first partial pattern registered in said character composition dictionary (8), matching any subsequently determined partial patterns with any partial patterns registered in said character composition dictionary (8) subsequent to the first partial pattern, and recognising the character having the highest number of partial patterns matching determined partial patterns.

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, F02B75