Character recognition apparatus

Abstract: This invention enables easily and fast selection of candidates for an input character image among the character categories by search of a tree-structured dictionary. Each ordinary mode of the tree structure has three branches, that is, two ordinary modes and one reject node, and compares the multivalued feature extracted from the input character image for the node concerned, with a threshold, upper limit and lower limit values. If the feature value is out of the limited range, the search goes down to the reject node at the next level. If not, the search goes down to the right or left node at the next level based on the comparison of the feature value with the threshold value. Reject nodes have no branch. The tree structure has character category infor­ mations as leaves connected to the bottom ordinary nodes and another character category information for all the reject nodes. Search of the dictionary gives one of the character category informations indicating the candidates, which are thereafter tested by detailed matching for outputting recognition result. In particular, this invention can use white pel run length as multivalued features. The white pel run length is defined as the run length of white pels from a point on an edge of the segmentation window to the nearest black pel or edge in a direction. It is easy to construct and optimise the dictionary, since many varieties of white run length are generated from a little sampling data.

Description: Field of the Invention This invention relates to a character recognition apparatus, and more particularly to one that is arranged to recognise characters, particularly printed alphanumeric characters, using a general-purpose personal computer. Prior Art Machine recognition of alphanumeric characters has reached the stage of practical use, and several products are available in the market. However, most of them are dedicated machines that require special hardware and are expensive. These systems are mainly used for special applications in which large amount of documents are continuously read. Applications with office automation equipment incorporated with an Optical Character Recognition (OCR) device will be widely used in the future, which easily read, edit typed or printed alphanumeric documents and then store them in a disk or the like. For such applications, a compact, inexpensive OCR for printed alphanumeric characters is essential. Typical conventional techniques for printed alphanumeric characters are a pattern matching technique where a feature value is extracted from a binary coded character pattern and the character is then selected as the first candidate, whose reference pattern in the recognition dictionary has the nearest feature vector to one of the input character; and a technique for determining a candidate character by using a so-called binary tree dictionary with point sampling. The former is easy in regards to the creation of the recognition dictionary and adaptation, but has a disadvantage in that it has a slower recognition speed because it generally uses complicated feature value and processing procedure to improve the recognition rate. The latter requires a vast amount of statistics and time for creation, and the addition and modification to the dictionary is difficult. Therefore, in the conventional approach, it is difficult to attain sufficient processing speed, easy-to-use dictionary creation feature, and addition and modification feature on a general-purpose personal computer. For detail of the above-mentioned technique using a binary tree dictionary with point sampling, refer to, for example, "A Processor-based OCR System" by R. G. Casey and C. R. Jik, IBM Journal of Research and Development, Vol. 27, No. 4, July, 1983, pp. 386 - 399, or "Decision Tree Design Using Probabilistic Model" by R. G. Casey and G. Magy, IEEE Transaction on Information Theory, Vol. IT-30, No. 1, January, 1984, pp. 93 - 99. Prior art most pertinent to the invention includes Japanese Published Unexamined Patent Application, PUPA 60-61876, 61-75486, and 61-173387. In these specifications, a decision tree for recognising a character or pattern is formed by sequentially performing classification based on multi-value feature, and the candidates are narrowed down by using this tree. However, this technique never describes the use of a reject node. Other related prior art is as follows. JPUPA 57-212589 and 56-35276 disclose to register rejected character patterns and to improve recognition thereafter. JPUPA 58-201184 discloses to classify character patterns by using distance from a predetermined position on the character frame to a position in the character pattern or on the frame in a predetermined direction. Problems to be solved by the Invention In consideration of the above circumstances, the object of the present invention is to provide a character recognition apparatus where a simple recognition dictionary with high reliability can be created in a short period of time without the creation of a complicated recognition dictionary and where characters can be recognised at a high speed and with a high correct answer rate. Means for solving of the Problems This invention provides character recognition apparatus comprising logic for searching a dictionary according to feature values extracted from an input unknown character pattern for determination of one or more candidate character categories for said input unknown character pattern, said dictionary including a tree structure dictionary, at each node of which a threshold value for a non-binary feature value is assigned, and the proceeding direction of each of said nodes is determined depending upon a comparison between the feature value extracted from said input unknown character pattern and the threshold value for the node concerned, characterised by means for assigning an upper limit and a lower limit for the non-binary feature value to at least one of said nodes and means for terminating the search of said tree structure dictionary if the feature value extracted from said input unknown character pattern for said one node is out of the range defined by said lower limit and upper limit. In order to accomplish the above object, according to the present invention, a tree structure dictionary is searched by using multi-value feature value extracted from an unknown input character pattern. Then, an upper or lower limit value is assigned on at least one branch of the tree structure dictionary, and the search of the tree structure dictionary is discontinued when the multi-value feature extracted from an unknown input character patterns for a certain branch exceed the upper or lower limit. Thus, unnecessary searching through the dictionary is avoided. In a particular embodiment, a binary coded character pattern is segmented and normalised in the character buffer, and distances between the four sides of an imaginary character frame and the character pattern or an opposite side (hereinafter called "white run length") are determined. These distances are used as feature values. Further a suitable range is provided for each white run length of each character categories to provide redundancy that adapts for positional variation and variation of samples. Character categories are classified into two classes based on whether or not the white run length for each character category at the same position exceeds a threshold value. Some categories may belong to both classes. In classifying, the position and threshold value of the white run length are determined to provide the separation between two classes with the maximum. A tree structure dictionary is created by repeating a similar operation for each classified class. At each terminal node of the tree structure dictionary, one or more character categories are registered. The reference pattern of each character category registered at the selected terminal node is matched against the input pattern, the likelihood therebetween is determined, and then the character categories are ordered based on the likelihood. According to this configuration, it is possible to create a tree structure recognition dictionary with high reliability from smaller number of samples in a short period of time, and to attain a high recognising speed without sacrificing the recognition rate. Further according to this configuration which combines the narrowing down of candidates by a tree structure dictionary and the final recognition by pattern matching, the addition and modification of character categories of the dictionary through training which are generally weak points of the tree structure dictionary, can be performed with a simple procedure of addition of registered character categories into the terminal nodes or the like. In order that the invention may be fully understood a preferred embodiment will now be described with reference to the drawings, in which: Fig. 1 is a diagram illustrating a tree structure dictionary of an embodiment according to the present invention. Fig. 2 is a block diagram illustrating the embodiment as a whole. Fig. 3 is a flowchart illustrating the procedure of the embodiment. Fig. 4 is a diagram illustrating a white run length which is feature value used in searching the tree structure dictionary of the embodiment. Fig. 5 is a diagram illustrating classification operation in creating the tree structure dictionary of the embodiment. Figs. 6 and 7 are diagrams illustrating how character categories are finally classified. Embodiments Now, the invention is described with an embodiment applied to a document input system with a printed alphanumeric OCR. Fig. 2 shows an entire configuration of the embodiment, in which the system consists of a personal computer 1, a bit map display 2, a scanner 3 and an auxiliary storage 4. A block enclosed in the broken line, which includes a recognising section 5, a post-processing section 6 and a user interface 7, is implemented in software. Fig. 3 shows procedure of the system shown in Fig. 2. In Figs. 2 and 3, when an operator issues a process start command, the user interface 7 first supplies a scan request to the scanner 3. A document 8 is scanned by the scanner 3, and the image of it is supplied to the recognising section 5 (S11). The recognising section 5 segments the image for each character (S12) and then recognises which character category the image segmented for each character is (S13). In step 12, the segmented character is stored, for example, with the centre of the character being in alignment with the centre of the region of 32 x 32 pels. Step 13 is a section to which the invention is directly related, and is described in detail later. The result of the recognition is not necessarily determined to be unique, but several candidates may be output. When the recognition completes for one word, the user interface 7 requests the post-processing section 6 to verify and correct misspelling in the recognition result. The post-processing section 6 executes the verification of spelling of the recognition result supplied from the recognising section 5 by referring to the word dictionary in the auxiliary storage 4, and retrieves an approximately matched word if there is no applicable word in the dictionary (S14). The result of step 14 is displayed on the display 2 through the user interface 7, and the operator performs final recognition and correction (S15). Thus, a coded, correct document is obtained. Now, the recognising section 5 is described in detail. The operation of the recognising section 5 is roughly divided into two steps. In the first step, candidate character categories are narrowed down to one or several character categories by recognition technique with a tree structure recognition dictionary wherein the length of lines drawn from the four sides of a character area to the edge of the character or to the opposite side of the area (white run length) is used as feature values, and wherein candidate character categories are narrowed down by branching to the right or left depending whether or not the white run length exceeds a threshold value. In addition to the threshold value for causing a branch to right or left, each node is defined with maximum and minimum values that the white run length can take. When these values are exceeded, a fault condition is determined to exist, and the recognition processing is discontinued. In the second steps, the reference patterns of the candidate character categories are matched against the input pattern, and then the character category having the shortest distance is determined as the first candidate. Now, more detailed description is given on the creation of a tree structure recognition dictionary, pattern matching, overall process of recognition, and technique for adding and modifying the recognition dictionary. Creation of the tree structure recognition dictionary Referring to Fig. 1, distances from the four sides of an imaginary character frame to the opposite sides or to the character (white run length) are determined for a binary coded character pattern normalised in a character area. The number i of white run lengths Di per character pattern varies according to the size of the character area in which they are stored. Generally, if they are stored in a character area with dimensions of X pels x Y pels, the number of white run lengths is 2 x (X + Y). Now, one white run with a length of Dn is considered. Let dn be an example value of Dn. dn varies according not only to variation in character samples, but also to variation of the position in the character area, at which the character sample is stored after segmentation and normalisation. Thus, dn is a multi-value feature with minimum and maximum values. The method for determining the minimum and the maximum values will be explained with reference to Fig. 4. Referring to Fig. 4, Dn of one character category, and Dn-1 and Dn+1 at each side of Dn are considered. Because multiple samples are prepared for the same character category for absorbing variation in samples, the maximum value dnmax and the minimum value dnmin are determined for white run lengths of 3 x (number of samples) in total, and are selected as the maximum and the minimum values of Dn. On that occasion, the value of white run length Dn is increased by one pel in finding the maximum value, and decreased by one pel in finding the minimum value. That is, dnmax = max[(d n-1 , d n +1, d n+1 ) x number of samples] dnmin = min[(d n-1 , d n -1, d n+1 ) x number of samples] In actual recognition, a variation in the thickness or blur of a character, or positional error in normalising in the character area may arise. However, shifting in the vertical (or horizontal) direction is absorbed by using the white run lengths at each side of Dn, and shifting in the horizontal (or vertical) direction is also absorbed by increasing or decreasing the white run length of Dn. Experiments assured that the above technique is suitable as a method for adding redundancy to the white run length. However, if the size of characters or the resolution of the scanner are significantly different, it is necessary to add more redundancy or reduce it. Distribution of values dn of the white run lengths of various character categories for Dn at the same position in the character area is, for example, shown in Fig. 5. Now, by tentatively setting a threshold value t at the position shown in the figure, all character categories are classified into two classes depending upon whether or not the white run length at the concerned position of each character category exceeds threshold value t. Because the white run length is a multi-value feature rather than binary, the classification is performed according to th following definition: Class C₁ = [ci dnmax > t] Class C₂ = [ci dnmin < t] ci: character category As the above, in a case where the white run length is clearly smaller or larger than t, it is classified into classes C₁ or C₂, respectively. The character category that has a white run length cross over the t line are classified into both of the classes C₁ and C₂. Then, degree of separation between classified classes C₁ and C₂ is defined, and a combination of the position and the threshold value of the white run length which provides the maximum degree of separation is determined. Various types of separation degrees may be used, such as from one that is statistically strict to one that is simplified for reducing the processing. For example, a product of the numbers of elements in respective classes is used as the degree, and defined as follows; V = Ac1 x Ac2 V : degree of separation Ac1 : number of elements in class C₁ Ac2 : number of elements in class C₂ (excluding duplicated character categories) If too much duplication makes the separation between the classes worse, V also becomes smaller. V becomes larger if the numbers of non-duplicated character categories in C₁ and C₂ are substantially equal. In creating the tree structure recognition dictionary, it is desirable to not only improve the degree of separation between classes C₁ and C₂, but to also ensure that separated classes C₁ and C₂ are balanced. Other techniques are reported to create an exact balanced tree. Results of experiments assured that a well balanced dictionary can be created in a short period of time by using the degree of separation of equation (5). As the above, the optimum position and threshold value of the white run length are determined for efficiently dividing all character categories into two classes, including duplicate, and the two classes are then selected as the successors of the root node. Then, similar operation is performed on each of the classes to classify them such as C₁→ [C₁₁, C₁₂] and C₂ → [C₂₁, C₂₂]. Nodes and their successors are sequentially determined to create a tree structured recognition dictionary by repeating this process. For each node a subset of character categories and a combination of the position and the threshold value of the white run length, which optimally divides the subset into two. Finally, the creation of the recognition dictionary terminates at a state either where, as shown in Fig. 6, the class cannot be divided into two any more for any white run length, or where, as shown in Fig. 7, the classes are finely separated from each other for character categories. Referring to Fig. 5 showing the threshold value of the white run length determined for a node by the above process, and the distribution of the values of the white run length for character categories, the minimum white run length value Tmin and the maximum white run length value Tmax are determined for dmin and dmax of all the character categories included in the class shown in the figure. There may be erroneous branching for an input character pattern in recognition, which is different from ones used in creating the dictionary. There may be consequently a case where a character category, which should not reach a node, is branched to that node. Then, the recognition dictionary is structured in, not a binary tree, a ternary tree having the third successor, where if a white run length value exceeds the maximum or falls short of the minimum value defined for each node, branch is made to this reject node in order to discontinue the processing. Thus, each node has, as information for branching the input character category, the maximum and the minimum values that the white run length can take, in addition to the position and the threshold value of the white run length. In actually determining Tmin and Tmax, it is desirable to provide redundancy to prevent the increase of cases in which reject is caused because of erroneous branching. That is: Tmin = min[minimum white run length value of each character category at a node] - α Tmax = max[maximum white run length value of each character category at a node] + α Fig. 1 shows an entire recognition dictionary. At an terminal node one or more character categories are registered. Because duplication is allowed in separating the character categories, same character categories may be duplicated in different terminal nodes. In Fig. 1, circles with diagonal shading indicate normal nodes, while those with R indicate reject nodes. Pattern matching In the recognition process using the tree structure recognition dictionary, more than one character category may be determined as final character candidates. In such a case, the feature value is extracted from the input pattern in respect with the feature vector, and the input pattern and the reference pattern of each candidate character categories which is included in the selected terminal node are matched, and the candidate character categories are ordered according to the matching distances, such as the first candidate, the second candidate, and the like. Various pattern matching techniques have been reported. Any technique can be employed herein. However, the most desirable one is one which is simple to process and which will not deteriorate the recognition speed. For example, a possible technique is one that divides a character pattern storing area into m x n portions in mesh, employs as a feature value a vector of m x n dimensions, each elements of which are the number of black pels in each portion, and selects as the top candidate the character category having the maximum simple likelihood of the feature value vector of the reference pattern with the feature value vector of the input pattern. This simple likelihood is defined as follows: R = I S/∥ I ∥ ∥ S ∥ R : likelihood I : input pattern vector S : reference pattern vector I S : inner product A conventional recognition technique using a tree structure recognition dictionary generally has shortcomings in that ordered multiple candidates cannot be determined, or that there is no measurement for how much likelihood the input pattern has with the top candidate. Such shortcomings can be complemented by combining with the pattern matching technique shown in this example. This is also easily utilised for post-processing such as spell checking. Overall process for recognition Now, the recognition process with the tree structured dictionary and the way in which it is combined with the pattern matching will be described. First, all of unknown input binary coded character patterns are branched at the root of the tree structure dictionary to the left or the right branch depending on whether or not the value of white run length at a particular position exceeds a predetermined threshold value. Sequentially, it is further branched at the branched node according to the value of white run length at a given position, and goes to a successor node. At this moment, if the white run length value exceeds the maximum or falls short of the minimum white value for the white run length, it is rejected. In this manner, the candidate character categories are narrowed down by sequentially repeating the branching, and the processing goes to pattern matching when the terminal node is reached. Since the candidate character categories are narrowed down to one or several categories at the terminal node, it is necessary only to perform matching with the reference patterns of the narrowed-down character categories. According to experiments, the number of character categories registered at the terminal node is five to six categories at the maximum, and two to three types on the average with a tree structure dictionary composed of 81 character categories. Even if the character candidates are narrowed down to one in the recognition technique using a tree structure dictionary, the matching with the pattern matching technique is performed to assure that there is no error caused by incorrect branching. The character category is selected as the top candidate when it has the shortest distance in the pattern matching, and the distance does not exceed the threshold value determined for the distance scale. If there are multiple candidate character categories at the terminal node, they are put in order according to the distance values. Addition and modification of recognition dictionary When new character categories are registered, or where it is intended to relieve erroneous recognition caused by the difference between sample character patterns used in creating the recognition dictionary and the actual input character patterns, addition or modification of the recognition dictionary by adaptation using the input character patterns is required. The addition or modification of the tree structure dictionary is conventionally performed by extension of the decision tree. That is, new branches from terminal or intermediate nodes are provided in order to register new character types or to modify the dictionary. This technique requires a troublesome procedure similar to that used in creating the dictionary, and the size of the tree structure dictionary is significantly increased when addition or modification is repeated. In this embodiment, the addition or modification of the tree structure dictionary is performed by the addition of character categories registered at the terminal nodes. That is, in a case where an input character pattern reaches a terminal node where that character category is not registered, as the result of erroneous branching, the character category is newly registered in a registered character group for pattern matching. This achieves the same effect as the expansion of a tree structure dictionary by making new branches at the terminal nodes, with very easy operations. In addition, although the prior technique creates a recognition tree from multiple samples for taking statistic variation into account, information of at most one sample is usually used for making new branches, so that the added portion of the recognition tree provides unavoidably low reliability. With the technique according to the present invention, the reliability is never deteriorated, because the recognition tree itself is not modified but only character categories to be checked in the following pattern matching are added. To be exact, the method for addition or modification of the recognition dictionary in adaptation using the input pattern is separately applied to the following three cases. Case (1) A case where the character categories registered at the terminal node to which an input character pattern reaches in an actual recognition process do not contain one that corresponds to the input character category. In this case, the input character category is newly added to the character category group at the terminal node. In case where the input character category is of a completely new category that was not encountered in creating the recognition dictionary, it is added not only to the tree structure dictionary, but also to the recognition dictionary for the pattern matching. Case (2) A case where an input character category is erroneously recognised because of poor results of the pattern matching, although the character category group registered at the node contains one that corresponds to the input character category. In this case, modification is made to the recognition dictionary for the pattern matching. Usually, smoothing of a template is for example employed. Case (3) A case where a character pattern is branched to a reject node on the way of the tree structure dictionary search. In this case, a new terminal node is provided for the rejected character patterns, and at this terminal node the rejected character patterns are matched against the reference patterns. Adaptation is performed by newly adding and registering the input character categories to the terminal node for rejection. Effects of the Invention According to the present invention a recognition dictionary of a tree structure is created by using multi-value feature with maximum and minimum values such as a white run length, rather than a binary feature value such as black or white pels, so that the dictionary can be created through very simple operations with fewer samples. In addition, recognition error due to erroneous branching can be detected at the time of searching of the dictionary tree by using a ternary tree instead of a binary tree, to improve the efficiency in the recognition. Furthermore, combination of the recognition technique with the tree structure dictionary and the pattern matching technique provides a feature that the former can efficiently narrow down the candidate character categories, and then the latter can order the candidates. Thus, because high speed and high recognition ratio can be realized, and the processing is simple, a substantially practical system can be implemented on a general purpose personal computer in software only, without using special hardware. In addition, it is easy to improve the recognition ratio through adaptation because addition or modification of the recognition dictionary can be very easily performed.

Claims: Character recognition apparatus comprising logic (1) for searching a dictionary according to feature values extracted from an input unknown character pattern for determination of one or more candidate character categories for said input unknown character pattern, said dictionary including a tree structure dictionary, at each node of which a threshold value (+) for a non-binary feature value is assigned, and the proceeding direction of each of said nodes is determined depending upon a comparison between the feature value extracted from said input unknown character pattern and the threshold value for the node concerned, characterised by means for assigning an upper limit (Tmax) and a lower limit (Tmin) for the non-binary feature value to at least one of said nodes and means for terminating the search of said tree structure dictionary if the feature value extracted from said input unknown character pattern for said one node is out of the from said input unknown character pattern for said said one node is out of the range defined by said lower limit (Tmin) and upper limit (Tmax). A character recognition apparatus as claimed in Claim 1 wherein said feature value is a distance from a predetermined position on a character frame to a position on a character pattern or said character frame in a predetermined direction. A character recognition apparatus as claimed in Claim 1 or 2, wherein predetermined one or more character categories are selected as the candidates in the case where the search of said tree structure dictionary is terminated on the way. A character recognition apparatus claimed in Claim 1 or 2 or 3, wherein the likelihood between the reference pattern of one or each of said candidate character categories and said input unknown character pattern is determined by pattern matching therebetween. A character recognition apparatus as claimed in Claim 4, wherein in the case of a plurality of candidate character categories, the candidate character categories are ranked in order of said likelihood. A character recognition apparatus as claimed in Claim 4 or 5, wherein the addition or modification to said reference patterns for the pattern matching is allowed. A character recognition apparatus as claimed in Claim 1, 2, 3, 4, 5 or 6, wherein the addition or modification to the candidate character categories assigned both at terminal nodes of said tree structure dictionary and for the case where the search of said tree structure dictionary is terminated on the way, is allowed.

Inventors: TAKAHASHI HIROYASU GOH HIGASHI, YAMASHITA AKIO, TAKAHASHI, HIROYASU 303GOH HIGASHI 7TOH GREENHILL, YAMASHITA, AKIO
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1988
Main classification: G06K9
IPC codes: G06K9