Method and apparatus for character recognition

Abstract: This disclosure relates to a character recognition method and apparatus through which highly accurate character recognition is capable of being executed inexpensively and at high speed. Character recognition is raised in speed by executing segmentation of character images from an input image and character recognition from the segmented character images in parallel by separate processors without use being made of a special communication processor. After the character images have been segmented from the input image, the results of segmentation are evaluated and the character images are segmented further based upon the results of evaluation. Methods of evaluation include a method involving finding a standard character size from characters written in character images segmented initially, and adopting the difference between the standard size and the size of each segmented character image, and a method involving quantifying results of character recognition of character images segmented initially, and evaluating the results of quantification.

Description: This invention relates to a method and apparatus for character recognition and, more particularly, to a method and apparatus for character recognition in which characters are recognized upon being segmented from an input image. Conventional methods and apparatus for recognizing characters in input images have various characterizing features. For example, an apparatus which executes segmentation and character recognition from an input image is composed of components that are separated from each other. The results of segmentation are transmitting using communication means and character recognition is executed based upon the communication data. Also, in the procedure for character recognition processing, the conventional character recognition apparatus is structured in such a manner that, characters are segmented from an inputted image one at a time to extract the features, after which each character is subjected to pattern matching with respect to a standard character pattern, which has been prepared in advance, to compute the similarity with the features of a standard character, and the character having the highest degree of similarity is adopted as results of recognition. There are two methods of segmenting characters from an input image. These are (1) a boundary tracing method in which a boundary is traced, and (2) a projection method for obtaining the projection of a character image. An overview of these methods will now be described. (1) The boundary tracing method This method involves tracing a boundary from one pixel on the boundary of a character image. For the sake of explanation, consider a coordinate system in which the upper left end of the input image is the origin, the x axis is directed to the right (the horizontal direction) and the y axis is directed downward (the vertical direction). First, let the starting point be a pixel of a character image of interest whose x and y coordinates are minimum. Next, this starting-point pixel is adopted at the pixel of interest, eight neighboring pixels surrounding this pixel of interest are investigated clockwise in ascending order starting from "1", as shown in Fig. 34, and the pixel of interest is shifted when the pixel of a character is found to be present. At this time the coordinates of this pixel are stored in memory. Though the eight neighboring pixels of this pixel of interest are then investigated, the order in which these eight neighboring pixels are investigated is such that when the present pixel of interest is at the position of "2" or "3" in Fig. 34 as seen from the previous pixel of interest, the investigation starts from "1" in Fig. 34. Further, the investigation starts from "3" when the present pixel of interest is at the position of "4" or "5"; from "5" when the present pixel of interest is at the position of "6" or "7"; and from "7" when the present pixel of interest is at the position of "8" or "1". When tracing thus returns to the starting point, segmentation ends. (2) Projection method This method involves extracting a rectangular area representing a one-line string, and then extracting a rectangular area representing one character. If we take the character string of lateral writing (" " shown in Fig. 35 as an example and take a projection P1 upon a projection plane 801 in the horizontal direction, a rectangular area 803 having a height equivalent to the length (h) of P1 and representing the one-line string will be obtained. Further, when a projection is taken in the vertical direction with regard to the obtained rectangular area 803 representing the one-line string, projections P2 ∼ P7 (each of which is referred to as a "character block") upon a projection plane 802 are obtained. Thus, the characters are segmented. Pattern-recognition processing executed by conventional character recognition apparatus can be summed up generally as shown in the flowchart of Fig. 36. In accordance with the procedure of the flowchart, the processing includes inputting an image original (step S901), segmenting characters from the input image one at a time (step S902), extracting the features of the character (step S903), thereafter computing the similarity with features, obtained in advance, according to category (step S904) and then adopting, as the results of recognition, the character which belongs to the category having the highest degree of similarity (step S905). However, if processing is performed in accordance with the prior art described above, the results of character segmentation are transmitted, using communication means, to the apparatus which executes the character recognition, and therefore it is required that the apparatus incorporate means for managing the results of character segmentation. This is a factor in higher cost. Further, the processing for transmitting the results of character segmentation requires the sequential execution of processing for data formation in accordance with a predetermined format, data storage and calling of data. A problem which arises as a result of this series of processing operations is that the character recognition processing requires a long period of time. Character segmentation in accordance with the aforesaid prior art also involves the problems described below. In case of the character segmentation method which relies upon boundary tracing method, the following problems arises because all of the coordinate values along the boundaries of the image are obtained: (a) There is a great increase in the required storage capacity of the memory which stores the coordinate values. (b) In a case where a character comprises a plurality of isolated strokes (e.g., two strokes if the character is " " and five strokes if the character is " "), decision processing is required to decide which strokes are combined to form one character. (c) In a case where characters composed of one or more strokes are arranged as a sentence, the order demanded by the characters and the arrangement of the characters in the form of the sentence will not always agree. As a result, processing for rearranging the character blocks becomes necessary. The foregoing factors lead to an increase in the memory of the apparatus and an increase in the time needed for character recognition processing.Further, in case of the character segmentation method which relies upon projection, the following problem arises: (d) In a case where there is not a proper amount of space between characters, unlike the ideal case shown in Fig. 35, space cannot be acquired and segmentation cannot be carried out. For example, this will occur if, in a horizontal character string, the left-most end of a character exists on the left side of the right-most end of the immediately preceding character. More specifically, in a case where " ", " " and " " of an input character pattern overlap, as shown in Fig. 37, for example, taking the projection of the image will result in the character pattern " ", which originally is composed of three characters, being segmented as a single character, as indicated by the frame 900 in Fig. 37. Accordingly, a rectangular area requiring further division from the rectangular area which has been segmented once must be judged from the height to width ratio, and character segmenting processing must be applied again to the rectangular area requiring further division. Furthermore, in a case where the characters to undergo segmentation constitute a character string in which the widths of the characters differ greatly from one another, as is illustrated by the English text "HAWAII" in Fig. 38, segmentation based upon an average character width obviously is inappropriate. In addition, if a character string "AWA" in the character string "HAWAII" is segmented uniformly by lines perpendicular to the character string, part of the stroke of "W" will mix in with the character "A" alongside and a single character will not be obtained in correct fashion. In any case, this will lead to incorrect character recognition subsequently. In a case where neighboring characters contact each other, as illustrated in Fig. 39, the two characters will not be separated correctly even if the boundary tracing method is employed. In a case where erroneous character segmentation is performed, the estimated value of similarity will not be very large even for a character whose degree of similarity with a category obtained from the similarity computation is maximum, and the results of recognition will appear doubtful on the basis of experience. This represents erroneous recognition which arises because character recognition processing is executed without correcting the erroneous segmentation. EP-A-0166271 discloses a character recognition apparatus and method for recognizing run-on handwriting by segmenting character image blocks and performing character recognition by comparing extracted features of the segmented character image blocks with information that has been stored in a character dictionary. Where a single stroke of a character is not recognised, a second stroke is then compared with stored character values together with a combination of the first and second strokes. If these are still not recognised, patent recognition on the third stroke, together with a combination of the second and third strokes and the first, second and third strokes is performed. Accordingly, an object of the present invention is to provide a character recognition method in which character recognition can be executed at high speed. According to a first aspect of the present invention, there is provided a character recognition method comprising: an input step of inputting an image original; a segmentation step of segmenting character image blocks, which are written in said image original input in said input step; and a recognition step of performing character recognition by comparing extracted features of the segmented character image blocks with information that has been stored in a prescribed character dictionary, and obtaining a degree of similarity; characterised by further comprising: a setting step of setting identification information indicating whether or not each of the segmented character image blocks requires resegmentation based on the degree of similarity; a generation step of generating, for a group of consecutive segmented character image blocks that require resegmentation based on the identification information, a plurality of new character image blocks by using all possible consecutive combinations of the segmented character image blocks in the group that begin with a first segmented character image block in the group, subject to the condition that each new character image block has a width which is within a predetermined value; a repetition control step of repeatedly returning to said recognition step so as to perform character recognition on the plurality of new character image blocks; and an output step of outputting a recognition result of the new character image block having the highest degree of similarity among the plurality of new character image blocks which have been generated in said generation step and subjected to character recognition in said recognition step, as a recognition result for a resegmented image block. According to a second aspect of the present invention, there is provided a character recognition apparatus comprising: input means for inputting an image original; segmentation means for segmenting character image blocks which are written in the image original input by said input means; recognition means for performing character recognition by comparing extracted features of said segmented character image blocks with information that has been stored in a prescribed character dictionary, and obtaining a degree of similarity; characterised by further comprising: setting means for setting identification information indicating whether or not each of the segmented character image blocks requires resegmentation based on the degree of similarity; generation means for generating, for a group of consecutive segmented character image blocks that, based on the identification information, require resegmentation, a plurality of new character image blocks by using all possible consecutive combinations of the segmented character image blocks in the group that begin with a first segmented character image block in the group, subject to the condition that each new character image block has a width which is within a predetermined value; control means for controlling said recognition means for performing character recognition on the plurality of new character image blocks; and output means for outputting a recognition result of the new character image block having the highest degree of similarity among the plurality of new character image blocks which have been generated by said generation means and subjected to character recognition by said recognition means, as a recognition result for a resegmented image block. Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof. The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate an embodiment of the invention and, together with the description, serve to explain the principles of the invention. Fig. 1 is a diagram illustrating the construction of a character recognition apparatus used in a first comparative example; Fig. 2 is a block diagram showing the detailed construction of both a CPU board and character recognition board incorporated in the apparatus shown in Fig. 1; Fig. 3 is a flowchart showing the general features of character recognition processing in accordance with the first comparative example; Fig. 4 is a flowchart showing character recognition processing executed on the side of the CPU board; Fig. 5 is a flowchart showing interrupt processing of the a CPU 11 on the side of the CPU board; Fig. 6 is a flowchart showing character recognition processing by a CPU 21 on the side of the character recognition board; Figs. 7A and 7B are processing time charts for a case where character recognition is executed by transferring a segmented character image to the character recognition board one character at a time; Figs. 8A and 8B are processing time charts for a case where character recognition is executed by transferring a segmented character image to the character recognition board one line at a time; Fig. 9 is a block diagram illustrating the construction of a character recognition apparatus in accordance with a second comparative example of the present invention; Fig. 10 is a flowchart showing the general features of character recognition processing in accordance with the second comparative example; Fig. 11 is a flowchart showing character segmentation processing by projection; Fig. 12 is a flowchart showing character segmentation processing by boundary tracing; Figs. 13A, 13B and 13C are diagrams for describing character segmentation by boundary tracing; Fig. 14 is a flowchart showing character segmentation processing by boundary tracing in accordance with a third comparative example; Fig. 15 is a diagram for describing character segmentation by boundary tracing in accordance with the third comparative example; Fig. 16 is a block diagram illustrating the construction of a character recognition apparatus in accordance with an embodiment of the present invention; Fig. 17 is a flowchart showing character recognition processing in which re-execution of character segmentation executed by the character recognition apparatus of Fig. 16 is possible; Fig. 18 is a diagram showing the manner in which a projection is taken in the horizontal direction of laterally written characters; Fig. 19 is a diagram showing the manner in which a projection is taken in the vertical direction of laterally written characters; Figs. 20A, 20B, 20C, 20D and 20E are diagrams for describing character segmentation; Fig. 34 is a diagram for describing character segmentation by the boundary tracing method in accordance with the prior art; Fig. 35 is a diagram for describing character segmentation by the projection method in accordance with the prior art; Fig. 36 is a flowchart showing character recognition processing according to the prior art; and Figs. 37, 38 and 39 are diagrams showing examples of input character patterns that can cause erroneous recognition. A preferred embodiment of the present invention will now be described in detail in accordance with the accompanying drawings. Described below is an embodiment of a character recognition apparatus which eliminates erroneous recognition by solving the problems pointed out in the prior art, and which executes character recognition processing inexpensively and at high speed. [First comparative example (Figs. 1 - 8)] Fig. 1 is a diagram showing the external appearance of a character recognition apparatus in accordance with a first comparative example. As shown in Fig. 1, the apparatus includes a CRT 1 for displaying the results of character recognition as well as various messages relating to character recognition processing, a main unit 2 in which there is installed a CPU board for performing processing such as character segmentation from an inputted image original, a keyboard (KB) 3 for inputting various instructions and the like concerning character recognition processing, a character recognition board 4 on which circuitry for executing character recognition with regard to a segmented character is mounted, a scanner 5 for reading in an image original in which characters are written, a pointing device 6 which, like the keyboard 3, is for inputting various instructions and the like relating to character recognition processing, and a floppy disk driver (FDD) 7. The character recognition board 4 is used by being installed in the main unit 2. The characterized feature of the present apparatus resides in the fact that the CPU board for executing such processing as character segmentation from the image original is installed in the main unit 2 together with the character recognition board 4, these are interconnected via a high-speed CPU bus (not shown), and character recognition processing is executed while the two boards cooperate with each other. Fig. 2 is a block diagram showing the detailed construction of both the CPU board installed in the main unit 2 and the character recognition board 4. In Fig. 2, numeral 8 denotes a CPU board which includes a CPU 11 for performing processing and control other than that for character recognition in the character recognition apparatus, a ROM (read-only memory) 12 for storing programs executed by the CPU 11, a RAM (random-access memory) 13 for storing text images and the like processed by the character recognition apparatus, and a DMA controller 14 for controlling data transfer from a scanner 5 or an auxiliary storage unit such as the floppy disk drive (FDD) in order that the data may be processed in the CPU 11. Numeral 15 denotes a communication buffer which buffers data transmitted to and received from the character recognition board 4. The character recognition board 4 includes a special-purpose character recognition CPU 21 for controlling overall identification computation and recognition processing, a ROM 22 in which the character recognition program is stored, a RAM 23 used as a working area for character recognition processing executed by the CPU 21, a feature extraction unit 24 for extracting feature quantities from a character image stored in the communication buffer 15, a general classifier 25 for narrowing down candidate characters by performing distance computation between a feature vector given by the CPU 21 and previously learned data, a dictionary for general classification 26 which stores previously learned data, and a dictionary for detailed classification 27 which stores learned data for more detailed distance computation with regard to candidate characters obtained by the general classifier 25. In the arrangement described above, the CPU 11 and special-purpose character recognition CPU 21 communicate by generating interrupts in each other. The CPU 11 generates a pattern-recognition-request interrupt in the CPU 21, and the CPU 21 generates an identification-completion interrupt as well as an image-data-transfer request interrupt in the CPU 11. Fig. 3 is a general flowchart showing the general features of character recognition processing executed by the character recognition apparatus according to the present example. In accordance with the flowchart of Fig. 3, the CPU 11 inputs an image at step S1 and executes character segmentation processing at step S2. Next, at step S3, processing for feature extraction is executed by the feature extraction unit 24 and special-purpose character recognition CPU 21 based upon data sent via the communication buffer 15. This is followed by step S4, at which identification processing is executed by the general classifier 25 and special-purpose character recognition CPU 21. Thereafter, the data which is the result of character recognition is sent to the CPU board 8 via the communication buffer 15, and the CPU 11 executes post-processing and processing for outputting results at steps S5 and S6, respectively. Next, the processing executed by the CPU 11 and the CPU 21 will be described with reference to the flowcharts shown in Figs. 4 ∼ 6 and the time chart of processing shown in Fig. 7. In order to simplify the description, it will be assumed that a plurality of lines (n lines) of characters hand-written in a single document are inputted as a text image. (1) Processing executed by CPU 11 (Figs. 4 and 5) Fig. 4 is a flowchart showing the principal processing executed by the CPU 11, and Fig. 5 is a flowchart showing interrupt processing. Steps in the flowchart of Fig. 4 identical with those described in Fig. 3 are designated by like step numbers. At step S1 in Fig. 4, a text image to undergo character recognition is read in from the auxiliary storage unit such as the scanner 5 or floppy-disk drive (FDD) 7 via the DMA controller 4 and is transferred to the RAM 13. This is followed by step S20, at which the CPU 11 subjects the image stored in RAM 13 to line segmentation, and then by step S21, at which the CPU 11 performs segmentation of a first character from the first segmented line. The timing of this operation corresponds to t = t 11 in the time chart shown in Fig. 7. When segmentation of the first character of the first line ends, processing proceeds to step S22, at which the character image of the first character of the segmented first line is transferred to the communication buffer 15, and then to step S23, at which the CPU 11 issues a pattern-recognition request instruction to the CPU 21. The timing of this operation corresponds to t = T 11 in the time chart shown in Fig. 7. After issuance of this instruction, the CPU 21 generates an interrupt in the CPU 11 asynchronously with respect to the processing executed by the CPU 11. Next, it is examined at step S24 whether character segmentation has ended for all lines. If it is determined here that character segmentation has ended for all lines, processing proceeds to step S5. The timing of this operation corresponds to t = t nm in the time chart shown in Fig. 7. Post-processing is executed at step S5, and the results of recognition are displayed on the CRT 1 at step S6. If it is determined at step S24 that character segmentation has not ended for all lines, then processing proceeds to step S25, at which segmentation of the next character is performed. The data indicative of the results of this character segmentation is stored in the RAM 13. Next, it is examined at step S26 whether a "mask" has been applied in such a manner that a response will not be made to the interrupt from the CPU 21. In a case where the mask has been applied, character segmentation processing will not be completed even if a segmented-image data-transfer request is issued by the CPU 21. There will be no character image that can be transferred, and the transfer request signal will be ignored. If the mask has been applied, processing proceeds to step S27, at which the mask is removed, and processing then returns to step S24. If the mask has not been applied, then processing returns directly to step S24. Interrupt processing will now be described. The interrupt processing is generated asynchronously with respect to the above-described processing executed by the CPU 11 after the character image of the first character of the first line is transferred to the character recognition board on the side of CPU 21. This interrupt processing is generated in the CPU 11 taking as an opportunity the image-data transfer-request instruction or a character-recognition completion notice from the CPU 21. When the interrupt is generated, it is examined at step S31 (Fig. 5) whether the interrupt issued by the CPU 21 is the image-data transfer-request instruction or the character-recognition completion notice. An interrupt of this kind is generated at t = t int1 , t = t int2 or t = t int3 , etc., in the time chart of Fig. 7. If the interrupt is the character-recognition completion notice, then processing proceeds to step S32, at which the results of recognition are accepted from the character recognition board 4 via the communication buffer 15. The interrupt is then canceled. If the interrupt is the image-data transfer-request instruction, on the other hand, processing proceeds to step S33. It is examined at step S33 whether the character segmentation executed by the CPU 11 has already ended for all lines and whether transfer of the character image has been completed. If it is determined that character segmentation and transfer of the character image have been completed, then an instruction to this effect is ignored and interrupt processing is terminated. The timing of this operation corresponds to time t = t intn in accordance with the time chart shown in Fig. 7. If it is determined that character segmentation and transfer of the character image have not been completed, then processing proceeds to step S34. At step S34, the character image of the next segmented character stored in the RAM 13 is transferred to the communication buffer 15. This is followed by step S35, at which the pattern-recognition request instruction is issued to the CPU 21. The timing of this operation corresponds to t = T 12 or t = T13 etc., for example, in the time chart of Fig. 7. Next, at step S36, it is examined whether the next segmented character image for transfer has been stored in the RAM 13. If it is determined that this character image has been stored in the RAM 13, then interrupt processing is terminated. On the other hand, if it is determined that the next segmented character image for transfer has not yet been stored in the RAM 13, then processing proceeds to step S37. At this step, the image-data transfer-request instruction from the CPU 21 is judged to be fast in comparison with the speed of character segmentation processing executed by the CPU 11, an interrupt is received from the CPU 21, a mask is applied in such a manner that the image-data transfer-request instruction will not be accepted, and interrupt processing is then terminated. In the case of this embodiment, it is assumed that the CPU 11 ignores and does not respond to an image-data transfer-request instruction that follows the application of the mask. As a result, the transfer of the segmented character image is performed by a response to an interrupt which follows the removal of the mask, and therefore an adjustment is made so as to balance the character segmentation processing speed and the character recognition speed. (2) Processing executed by CPU 21 (Fig. 6) The processing executed by CPU 21 mounted on the character recognition board 4 will now be described with reference to the flowchart shown in Fig. 6. The processing executed by the character recognition board 4 is started by the pattern-recognition request instruction from the CPU 11. In other words, at step S41 processing initially is in a state awaiting the recognition request instruction from the CPU 11 and proceeds to step S42 at the moment this request instruction is received. At step S42, the segmented character image transferred to the communication buffer 15 by the CPU 11 is received, the features of this character image are extracted using the feature extraction unit 24, and the obtained information is stored in the RAM 23 as a feature vector. A plurality of buffers (two or more) for storing feature vectors are available in the RAM 23, and the design is such that a data inconsistency will not occur when there is a conflict between access from the CPU 21 and access from the general classifier 25. Each buffer is provided with a flag [IFLGi, i = 1, N (N≥2)]. Depending upon the value of the flag, it can be determined whether general classification processing based upon the feature vector stored in the buffer has been completed, whether the processing is in progress or whether the processing has not yet been executed. When a new feature vector has been stored in the buffer, the value of the flag is set by the CPU 21. When the general classification processing by the general classifier 25 has started or ended, the value of the flag is rewritten by the general classifier 25. When feature extraction ends, the processing proceeds to step S43, at which an interrupt is generated in the CPU 11 and an image-data transfer-request instruction is issued in order to request the next character image. At the same time, the general classifier 25 is instructed at step S44 to perform matching between the obtained feature vector and the data stored in the dictionary for general classification 26. Thereafter, the CPU 21 waits at step S45 for the pattern-recognition request instruction from the CPU 11 and a notification of completion of general classification processing from the general classifier 25. If the notification of completion of general classification processing is received, then processing proceeds to step S52, at which a final candidate character is determined by executing detailed identification processing with regard to candidate characters (which may be one or two or more in number) for which there is a possibility of being the result of character recognition extracted by the general classification processing. Next, processing proceeds to step S53, at which it is confirmed that the immediately preceding interrupt processing operation on the side of CPU 11 has ended. Next, at step S54, the result of character recognition is outputted to the communication buffer 15, and then an interrupt is generated in the CPU 11 and the character-recognition completion notice is issued at step S55. Thereafter, the processing proceeds to step S56, where it is examined whether there is an instruction in waiting. If it is determined that there is an instruction in waiting, then processing returns to step S45; otherwise, processing is terminated. In the actual operation of the apparatus, the system prepares for the next character recognition operation and the state awaiting an instruction at step S41 is attained even if there is no instruction in waiting, so long as the power supply is not turned off. If the pattern-recognition request instruction is received at step S45, then processing proceeds to step S46, at which feature extraction is executed with regard to the segmented character image transferred from the CPU 11, just as at step S42. An interrupt is then generated in the CPU 11 at step S47 and the CPU 11 examines whether a mask has been applied. If the CPU 11 confirms that the mask has been applied, processing waits until the mask has been removed. If the CPU 11 confirms that the mask has not been applied, on the other hand, processing proceeds directly to step S48 and the image-data transfer-request instruction is issued in order to request the next character image. Next, at step S49, the flag in the buffer of RAM 23 which stores the feature vector is investigated and it is examined whether the general classifier 25 is executing processing. If it is determined that processing is in progress, then the completion of general classification processing is awaited. When this has been completed, processing proceeds to step S50, at which general classification processing base upon a new feature vector is requested of the general classifier 25, as at step S44. This is followed by step S51, at which it is examined, based upon the flag of the buffer in RAM 23 in which the feature vector is stored, whether there is data for which general classification processing has ended. If it is determined that there is data for which this processing has been completed, then processing proceeds to step S52; otherwise, processing returns to step S45. Thus, in accordance with this example, the CPU 11 and the CPU 21 independently execute character segmentation processing and character recognition processing asynchronously and in parallel fashion. As a result, character recognition can be executed efficiently and at high speed. Furthermore, since the data necessary for these two processing operations is transmitted and received by interrupts, a special-purpose processor for communication is not required. This makes it possible to reduce the overall cost of the apparatus. In the processing set forth above, the segmented character images are transferred from the CPU 11 to the side of the character recognition board 4 in units of one character each. However, this does not impose a limitation upon the invention. For example, the segmented character images can be transferred in units of one line each. In such case, the processing operations executed by the CPU 11, CPU 21 and general classifier 25 are related in the manner illustrated in the time chart of Fig. 8. The processing shown in Fig. 8 is premised on the fact that the RAM 23 is furnished with a buffer which stores feature vectors corresponding to characters of at least one line. On the premise of the foregoing, the CPU 11, following the completion of character segmentation of the first line at time t = t 1 , transfers the first line of segmented character images to the communication buffer 15 at time t = T 1 and issues a pattern-recognition request instruction in accordance with the time chart shown in Fig. 8. The CPU 21 receives the character images and requests the general classifier 25 to perform general classification processing after feature extraction of the first character of the received image ends (time t = T 1 '). During the dead time up until the end of general classification processing, the CPU 21 executes feature extraction of the character images from the second character onward and stores the feature vectors in the vacant buffer of RAM 23. Thereafter, the CPU 21 executes character-image feature extraction, general classification and detailed identification, while searching the values of the flag (IFLGi) provided in the buffer of RAM 23, in such a manner that the processing waiting time of the CPU 21 is minimized, and while performing monitoring in such a manner that unnecessary blank space does not develop in the buffer of RAM 23. At the moment (time t = T 2 ) extraction of features of all character images of one line ends, an image-data transfer-request instruction is issued to the CPU 11. In response, the CPU 11 transfers the next one line of character images to the communication buffer 15 and simultaneously issues the pattern-recognition request instruction at time t=T 3 . Until the pattern-recognition request instruction is received, general classification processing and detailed identification processing are executed by the character recognition board 4 using the unprocessed feature vectors left in the RAM 23. When the CPU 21 receives the pattern-recognition request instruction, feature vectors are extracted successively one character at a time with regard to the next line of character images so as to minimize the processing waiting time of the CPU, and these vectors are stored in the buffer of the RAM 23. (For example, in order to make optimum use of the CPU resource, the CPU utilization time is assigned at a ratio of 2:1:1 with regard to feature extraction, general classification and detailed identification, respectively, until vacant buffer space in the RAM 23 is eliminated). When character recognition of the first line ends as a virtue of the foregoing processing (time t = T 4 ), the result of one line of character recognition is outputted to the communication buffer 15, an interrupt is generated in the CPU 11 and the character-recognition completion notice is issued. [Second comparative example (Figs. 9 - 13)] Processing will now be described in which character segmentation is executed more accurately also with regard to character images of a variety of handwriting inputs. In this embodiment also, a character recognition apparatus having the construction described in connection with Fig. 1 can be used. However, a character recognition apparatus having a simpler construction of the kind shown in Fig. 9 shall be used in order to simplify the description of portions not central to character segmentation processing, which is the focus of the description. Fig. 9 is a block diagram showing the construction of the character recognition apparatus representing a typical embodiment of the present example. As shown in Fig. 9, the apparatus includes a CPU 101 for inputting an image, executing processing such as segmentation of a character image and controlling the overall apparatus, a keyboard (KB) 102 for inputting characters and making revisions, a pointing device (PD) 103 such as a mouse, a ROM 104 for storing programs executed by the CPU 101, a RAM 105 for storing character images, results of character segmentation and results of recognition, a similarity computing unit 106 for computing similarity with each character concerning segmented character images, an image scanner (SCAN) 107 for reading images, an interface (I/F) 108 of the image scanner, and a display 109 for displaying results of character recognition. Processing for segmenting a character image executed by the character recognition apparatus constructed as set forth above will now be described with reference to the flowcharts shown in Figs. 10 ∼ 12. An example will be considered in which recognition is applied to laterally written text, such as a Japanese sentence, in which a circumscribed rectangle of a character image of each character constituting the sentence approximates a square and the character pitch is fixed. At step S101 in Fig. 10, a primary segmentation is performed, in which use is made of the projection method. The details of primary segmentation processing will be described with reference to the flowchart shown in Fig. 11. As in the example of the prior art described above, first a rectangular area representing a one-line string is segmented at step S201, then a character block is segmented at step S202. Next, maximum character height within the line is found at step S203, and this height is represented by "maxh". At step S204, it is examined whether a character block approximates a rectangular area one side of which has the length "maxh". If it is determined that the character block approximates a rectangular area one side of which has the length "maxh", then processing proceeds to step S205, where this character block is determined to be a character block of a standard size. On the other hand, if it is not determined that the character block approximates a rectangular area one side of which has the length "maxh", then processing proceeds to step S206. Here it is examined whether the result of combining this character block with a neighboring character block results in a rectangular area one side of which has the length "maxh". If it is determined that a rectangular area one side of which approximates the length "maxh" has been formed by the combination with the neighboring character block, then processing proceeds to step S207, where the combined block is adopted as being the character block of the standard size. On the other hand, if it is determined that a rectangular area one side of which approximates "maxh" has not been formed by the combination with the neighboring character block, then processing proceeds to step S208. Finally, at step S208, the average width of the character of the standard size is computed and this is adopted as the width of the standard character. At step S102 in Fig. 10, the value of the width of each character block is extracted in order to determine whether the characters segmented at step S101 include any that are doubtful. Then, at step S103, the width (W i : i = 1, n) of each character block and the standard character width (SW) are compared. If it is determined that the value of Wi is sufficiently large in comparison with the value of SW, then it is judged that re-execution of character segmentation is necessary and the processing proceeds to step S104 so that secondary segmentation may be carried out. Secondary segmentation employs the boundary tracing method. If it is determined that the values of W i and SW are not much different, then it is judged that re-execution of character segmentation is unnecessary and processing is terminated. The details of secondary segmentation processing at step S104 will be described with reference to the flowchart of Fig. 12 and the input character string (" " in this example) shown in Fig. 13. In Fig. 13, numeral 201 denotes the standard character width (SW), 202 ∼ 204 denote re-segmented blocks, and B1 ∼ B7 represent character strokes. First, at step S301 in Fig. 12, all of the character strokes present in the re-segmented block 202 of Fig. 13A are obtained by the boundary tracing method described in the example of the prior art. The character strokes (CS) obtained by this method are B1 ∼ B7. It is examined at step S302 whether there are two or more character strokes in the re-segmented block 202. If the answer is YES, then processing proceeds to step S303. Processing is terminated if there is only one character stroke CS. At step S303, a character stroke (B2) whose right end is at a location offset by the length of the standard character width (SW) from the left end of the re-segmented block 202 is found. Next, at step S304, is judged that one character is formed in combination with a character stroke (B1) whose right end is located to the left of the character stroke (B2) found at step S303. Next, at step S305, character segmentation processing is executed again in the re-segmented block 203 [Fig. 13B] from which the character strokes (B1 and B2) judged at step S304 to have formed one character are excluded. At this time, the left end of the re-segmented block 203 is taken as being the left end of the leftmost character stroke (B4) among the character strokes remaining (B3 ∼ B7). Next, at step S306, it is again examined whether the width of the re-segmented block 203 is sufficiently larger than the standard width (SW) 201. If it is determined that the width of the re-segmented block 203 is sufficiently large in comparison with SW, then processing returns to step S302 and segmentation processing is executed again. On the other hand, if it is determined that the width of the re-segmented block 203 is not sufficiently large in comparison with SW, then processing is terminated. By executing the foregoing processing, it is judged that the character string " " shown in Fig.13A is one in which the single character " " is formed by B1 and B2, the single character " " is formed by B3 and B4, and the single character " " is formed by B5 through B7. Thus, in accordance with this example, ordinary character segmentation is executed by the projection method, and the boundary tracing method is applied only to portions in which character segmentation is doubtful. This makes highly accurate character segmentation possible even with regard to text in which kerning is present. Even in a case where it becomes necessary to utilize the boundary tracing method, only the left-right positional relationship of the characters need be taken into consideration with regard to judging the strokes constituting the characters. As a result, processing following stroke extraction is reduced and overall processing speed is raised. [Third comparative example.(Figs. 14, 15)] Another example of secondary segmentation processing set forth in the second example will be described with reference to the flowchart of Fig. 14 and the input character string of Fig. 15. In Fig. 15, numeral 201 denotes the standard character width (SW), and 202 denotes a re-segmented character block. In order to specify the positions of pixels forming a character, an orthogonal coordinate system is considered in which the upper left end of the re-segmented block 202 is taken as the origin, the x axis is taken in the horizontal direction and the y axis is taken in the vertical direction. This example uses the character recognition apparatus described in the second example, and therefore a description of the apparatus will not be repeated. In addition, the other steps in the character recognition processing operation are identical with those of the second example and need not be described again. First, at step S401 in Fig. 14, a point offset to the right of the upper left end of the re-segmented block 202 by the standard width (SW) 201 is obtained, and this point is represented by P 1 [x P1 (= SW), y P1 (= 0)]. This is adopted as the starting point of boundary tracing and P1 represents a tracing point. Next, it is examined at step S402 whether P1 has reached the lower end of the re-segmented block 202 (that is, whether it has reached the end point of character segmentation). If it is determined here that P1 has reached the lower end of the re-segmented block 202, processing is terminated. If it is determined that P1 has not yet reached the lower end of the re-segmented block 202, then processing proceeds to step S403. It is examined at step S403 whether the pixel at P1 is a pixel constituting a character image. If it is determined here that the pixel at P1 is a pixel constituting a character image, then processing proceeds to step S405; otherwise, processing proceeds to step S404, the position of P1 is shifted vertically downward by one pixel and processing returns to step S402. At step S405, the pixel forming the character image detected at step S403 is stored as P2 (x P2 , y P2 ). Here P2 represents a point at which the pixel forming the character image has been detected, namely the boundary-tracing starting point of an actual character stroke. This is followed by step S406, at which boundary tracing described in the example of the prior art is performed from the location of point P2. From this location, the value of P1 changes along the boundary of the character stroke. In accordance with the description in the example of the prior art, the boundary is searched in the clockwise direction from the point of interest. Tracing is carried out in the manner indicated by the dashed line 251 in Fig. 15. Since the original objective of this embodiment is efficient segmentation processing, the arrangement is such that the boundary tracing processing is provided with a fixed limit, wherein tracing is not carried out when the limit is exceeded. In the case of this embodiment, the limit value is that at which the x coordinate (x P1 ) of P1 becomes equal to the x coordinate of the right end of the re-segmented block 202 (i.e., that at which P1 reaches the right end of the re-segmented block 202). Alternatively, the limit value is that at which the x coordinate (x P1 ) of P1 becomes ±SW/2 from the x coordinate (x P2 ) of P2. It is examined at step S407 whether P1 has exceeded the limit value of boundary tracing. If the answer is YES, then processing proceeds to step S408 and tracing is performed again from P2 in the counter-clockwise direction. If it is determined that the limit value has not been exceeded, processing proceeds to step S411 and it is examined whether the x coordinate (x P1 ) of P1 has become equal to the x coordinate (x P2 ) of P2. If x P1 ≠ x P2 holds, processing proceeds to step S413 and tracing is continued. If x P1 = x P2 holds, processing returns to step S402. It is again determined at step S409 whether P1 has exceeded the limit value of boundary tracing. If it is determined that the limit value has been exceeded, then processing proceeds to step S410, it is judged that segmentation processing cannot be performed and processing is suspended. If it is judged that the limit value has not been exceeded, on the other hand, then processing proceeds to step S412, at which it is determined whether the x coordinate (x P1 ) of P 1 is equal to the x coordinated (x P2 ) of P 2 . If x P1 ≠ x P2 holds, then processing proceeds to step S414 and tracing is continued. If x P1 = x P2 holds, then processing returns to step S402. By executing the foregoing processing, a character segmentation line of the kind shown at 252 in Fig. 15 is finally obtained. Thus, in accordance with this example, not only is the zigzag segmentation line 252 in Fig. 15 obtained but it is also possible to hold boundary tracing to the minimum so that tracing processing can be held to the minimum. The foregoing example is described with reference to a method using boundary tracing and projection as the segmentation method. However, this does not impose a limitation upon the present invention. In addition, the present invention is not limited to the foregoing embodiment also with respect to the prescribed form of a document, such as the way in which the document is constructed. Further, though the foregoing example has been described for a case in which segmentation processing is performed by the CPU 101, this does not impose a limitation upon the invention. For example, it is possible to use an apparatus having a processor dedicated to execution of segmentation processing, such as an apparatus having the construction described in the first embodiment. [First Embodiment (Figs. 16 ∼ 20)] Processing will now be described in which misrecognition arising from character segmentation is corrected again automatically even when a series of recognition processing operations has been completed. The character recognition operation used in this embodiment is of substantially the same construction as that of the apparatus used in the second and third comparative examples, and therefore the same elements are designated by like reference characters and need not be described again. <Description of elements specific to this embodiment (Fig. 16)> Fig. 16 is a block diagram showing the construction of a character recognition apparatus used in this embodiment. The apparatus includes a segmentation unit 110 for segmenting characters from a character image one character at a time. The RAM 105 has a character-image storage area 111 for storing a character image read by the image scanner 107, a segmentation-information storage area 112 for storing the output of the character segmentation unit 110, and a recognition-result storage unit 113 for storing the output of the similarity computing unit 106. <Description of character recognition processing (Figs. 17 ∼ 19)> Character recognition processing executed using the character recognition apparatus having the construction set forth above will now be described with reference to the flowchart of Fig. 17. First, at step S501, the character image is inputted from the image scanner 107 and stored in the character-image storage area 111. Next, at step S502, the segmentation unit 110 segments characters from the stored character image one character at a time. Though there is no particular limitation upon the method of segmentation, the method of taking projections of character images is used in this embodiment. Fig. 18 is a diagram showing the manner in which segmentation is executed in accordance with the projection method. In Fig. 18, numeral 301 denotes an input text image, and 302 designates a projection plane. The projection is taken in the horizontal direction if the inputted image original is a laterally written document and in the vertical direction if the inputted image original is a vertically written document. In the case of Fig. 18, the document is laterally written and therefore projections 304 are taken for character images 303 to obtain rectangular areas 305 representing one-line character strings. Fig. 19 is a diagram showing the manner in which projections in the vertical direction are taken with respect to the rectangular area 305 obtained. When a projection in the horizontal direction has been obtained, the projection plane is then rotated by 90° and a projection is taken, whereupon character rectangles 351 are obtained and characters are segmented one character at a time. The result of this segmentation is outputted to the segmentation-information storage area 112. The features are extracted from the character images of the character rectangles 351 at step S503, and a similarity computation is performed by the similarity computing unit 106 at step S504 using the features extracted. The results of computation are outputted to the recognition-result storage area 113. The output information contains n-number of computed values and character codes from categories having high degrees of similarity, by way of example. The processing of steps S501 ∼ S504 is in accordance with the prior art. The number of times the series of processing operations of steps S502 ∼ S504 has been executed is determined at step S505. If the series of processing operations has just begun, then processing proceeds to step S506. If the operations have been executed two or more times, processing proceeds to step S507. A character-image block which will undergo segmentation again is selected at step S506. This selection is assumed to be a case in which the computed value of a category for which the maximum similarity has been obtained is less than a predetermined threshold value (TH). With regard to a selected character-image block, a re-segmentation status flag (ISFLG) managed by the CPU 101 is set to "1" (the ON state). At step S507, the segmentation status flag (ISFLG) of a character which has undergone re-segmentation is investigated and the flag (ISFLG) is set to "0" with regard to a character whose similarity value is sufficiently greater than the predetermined threshold value (TH) and which need not undergo segmentation again. The segmentation status flag (ISFLG) is a flag set for each segmented character and is stored in the segmentation-information storage area 112 of RAM 105. It is examined at step S508 whether there is a character for which the status flag (ISFLG) is in the ON state. If a character whose flag is in the ON state exists, then processing returns to step S502 and this character is subjected to segmentation again. If a character whose flag is in the ON state does not exist, processing proceeds to step S509, the result is displayed on the display 109 and processing is terminated. <Specific example of character recognition processing (Fig. 20)> The foregoing processing will be described in detail by imagining a case in which the character images shown in Fig. 20 are inputted. The characters shown in Fig. 20A are assumed to be the input image characters. In the initial segmentation, first projections are taken from the input character images as described in step S502, whereby there are obtained six image blocks 401 ∼ 406, as illustrated in Fig. 20B. Next, by taking a standard character width, described below, as a reference, image blocks of comparatively small width (blocks 401, 402, 403) are joined, so that four image blocks 405, 406, 407 are obtained, as shown in Fig. 20C. Here the standard character width is taken to be the average value of the widths of character rectangles having a width that is close to the height of the rectangular area 305 representing a one-line string. Next, after the processing of steps S503 ∼ S505 is executed, a character image block to undergo re-segmentation is selected at step S506. Here it is assumed that the character-segmentation status flags (ISFLG) of the character image blocks 407 and 408 shown in Fig. 20C are ON. In segmentation from the second onward at step S502, only a character image block whose status flag (ISFLG) is ON is subjected to processing. In the second segmentation operation, first the connection between the leading block and following blocks of continuous re-segmented image blocks is investigated. In the case of Fig. 20B, the character image blocks 401 ∼ 404 are continuous blocks, and it is confirmed whether the leading block 401 is connected to the blocks 402 ∼ 404. However, the width of connected character image blocks is set so as to fall within a fixed multiple of the character width, and the number of combinations is limited. As a result, it is assumed that there are three combinations, namely block 401 alone, the combination of blocks 401 and 402, and the combination of blocks 401, 402 and 403. The processing of steps S503 ∼ S505 is executed with regard to these combined character images. Finally, at step S507, the combination having the highest degree of similarity and a value sufficiently larger than the predetermined threshold value (TH) is adopted as the result of segmentation. Here it is assumed that solely the character image block 401 satisfies these conditions and therefore the segmentation status flag (ISFLG) of the character image block 401 is turned OFF. At this point in time, segmentation takes on the state shown in Fig. 20D. In the third segmentation operation, the connection between the character image block 402 and the other blocks (here 403 and 404) is investigated. If, when the character image blocks 402 and 403 are connected in the third trial, it is judged that the degree of similarity is maximum and the predetermined threshold value (TH) is sufficiently exceeded, the two blocks are connected to form one character image block 409 and the segmentation status flag (ISFLG) for this block is turned OFF. In the fourth and final segmentation, the character image block 404 remains so that the processing of steps S502 ∼ S505 is applied to this block. At step S507, the status flag (ISFLG) is turned off. By virtue of the foregoing processing, character image blocks 401, 409, 404 ∼ 406 subdivided in the manner shown in Fig. 20E are obtained. If characters for which the flag (ISFLG) has been turned ON at step S506 are not subdivided into a plurality of character image blocks by execution of the next segmentation processing cycle and there are no other image blocks present in the neighboring portion, then it is judged that segmentation processing at step S506 in the ensuing loop is not erroneous and the status flag (ISFLG) is turned OFF so that re-segmentation will not be performed. Therefore, in accordance with this embodiment, first the input image is subjected to overall segmentation, features are extracted, similarity is computed, portions which require re-segmentation are determined based upon the results of similarity computation, and segmentation, feature extraction and similarity computation are subsequently repeated. As a result, even if a series of recognition processing operations has been completed, misrecognition arising from character segmentation can be corrected. The device for inputting character images is not limited to the image scanner 107. If an external storage device is connected, then image data obtained by other means can be stored in this external storage device temporarily and then inputted from this device. The present invention can be applied to a system constituted by a plurality of devices or to an apparatus comprising a single device. Furthermore, it goes without saying that the invention is applicable also to a case where the object of the invention is attained by supplying a program to a system or apparatus. 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 method comprising: an input step (S501) of inputting an image original; a segmentation step (S502) of segmenting character image blocks (401-406), which are written in said image original input in said input step; and a recognition step (S504) of performing character recognition by comparing extracted features of the segmented character image blocks (401-406) with information that has been stored in a prescribed character dictionary, and obtaining a degree of similarity; characterised by further comprising: a setting step (S506) of setting identification information indicating whether or not each of the segmented character image blocks requires resegmentation based on the degree of similarity; a generation step of generating, for a group of consecutive segmented character image blocks (401-404) that require resegmentation based on the identification information, a plurality of new character image blocks (407, 408; 401-404; 401, 409, 404) by using all possible consecutive combinations of the segmented character image blocks in the group that begin with a first segmented character image block in the group, subject to the condition that each new character image block has a width which is within a predetermined value; a repetition control step (S508) of repeatedly returning to said recognition step (S504) so as to perform character recognition on the plurality of new character image blocks; and an output step (S509) of outputting a recognition result of the new character image block (401, 409, 404) having the highest degree of similarity among the plurality of new character image blocks which have been generated in said generation step and subjected to character recognition in said recognition step, as a recognition result for a resegmented image block. A method according to claim 1 in which processing by said recognition means is executed each time character image blocks written in the image original are segmented at a predetermined length at a time. A method according to claim 1 in which processing by said recognition means is executed each time character image blocks written in the image original (301) are segmented one character at a time. A character recognition apparatus comprising: input means (107) for inputting an image original; segmentation means (110) for segmenting character image blocks (401-406) which are written in the image original input by said input means (107); recognition means (106) for performing character recognition by comparing extracted features of said segmented character image blocks (401-406) with information that has been stored in a prescribed character dictionary, and obtaining a degree of similarity; characterised by further comprising: setting means for setting identification information indicating whether or not each of the segmented character image blocks requires resegmentation based on the degree of similarity; generation means for generating, for a group of consecutive segmented character image blocks (401-404) that, based on the identification information, require resegmentation, a plurality of new character image blocks (407, 408; 401-404) by using all possible consecutive combinations of the segmented character image blocks in the group that begin with a first segmented character image block in the group, subject to the condition that each new character image block has a width which is within a predetermined value; control means (101) for controlling said recognition means (106) for performing character recognition on the plurality of new character image blocks; and output means (109) for outputting a recognition result of the new character image block (401, 409, 404) having the highest degree of similarity among the plurality of new character image blocks which have been generated by said generation means and subjected to character recognition by said recognition means, as a recognition result for a resegmented image block. The apparatus according to claim 4, wherein said recognition means (106) is arranged to execute processing each time character image blocks written in the image original are segmented at a predetermined length at a time. The apparatus according to claim 4, wherein said recognition means (106) is arranged to execute processing each time character image blocks written in the image original (301) are segmented one character at a time. The apparatus according to any one of claims 4 to 6, wherein said input means includes a scanner (107) for scanning the image original (301). A computer product programmed with machine readable instructions for performing a method according to any one of claims 1 to 3.

Inventors: IKEDA HIROAKI, TANAKA TETSUOMI, UENO SHUGORO, IKEDA, HIROAKI, TANAKA, TETSUOMI, UENO, SHUGORO
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1992
Main classification: G06K9
IPC codes: G06K9