Image processing method and apparatus

Abstract: The extraction of desired image information from input image information is disclosed, in which the extracted partial image information is recognized. Character outline information is traced, starting from an arbitrary point of the input image information. The start point is moved when the outline reaches the edge of the input image and the outline is traced again from the moved start point. Outline tracing and start position movement are repeated until the character information can be extracted by the outline tracing. When the number of times the start poin has been moved exceeds a predetermined value, the input information is inverted.

Description: The invention relates to image processing method and apparatus which can correctly extract desired information from input image information and can recognize the extracted partial information. A conventional apparatus which can recognize characters from image information is constructed as shown in Fig. 12. Reference numeral 41 denotes a scanner for converting a character image on an object to be read into an analog electric signal; 42 a preparation signal processor to binarize the analog signal and to eliminate the noises from the signal; 43 a character extractor to separate a character train every character; 44 a feature extractor for extracting a feature which is peculiar to the character and for producing a feature vector in accordance with a predetermined algorithm; 45 a recognition dictionary to store statistic amounts (mean value, distribution, and the like) of each character type of the feature vector; 46 a comparator for comparing the feature vector obtained from the input character image and the recognition dictionary, thereby selecting the optimum candidate; 47 a word dictionary to store the results of translations of words; 48 a dictionary retrieval unit to extract the corresponding translated word from the recognized character train with reference to the word dictionary; and 49 a display to display the translated word. The above conventional technique, however, has the following two drawbacks. (1) What are called blank characters which are written in a black background by a white color cannot be recognized. Figs. 7 and 10 show examples of such blank characters. As a conventional technique, there is known a method whereby a ratio of the number of black pixels which occupy in a whole image buffer is counted and when the ratio is equal to or larger than a predetermined value, the characters are determined to be the blank characters and those blank characters are inverted from the white color to the black color and, thereafter, a recognizing process is executed. Such a method, however, has a drawback such that it takes a long time to count the number of black pixels and the whole processing time increases. As shown in an example of Fig. 9, on the other hand, there is a case where when character lines are very thick, those characters are erroneously decided as blank characters. Or, as shown in Fig. 10, there is a case where in spite of the fact that the characters are really blank characters, they cannot be judged to be the blank characters because there are a large number of white pixels. There is, consequently, a drawback such that it is not always possible to correctly judge. (2) As shown in Fig. 11, when a ruled line exists before a character train to be recognized, the characters of "take" cannot be extracted. Hitherto, when the operator tries to extract character information by tracing an outline of the character information by using a certain point of an input image as a start point, so long as a ruled line exists as shown in Fig. 11, the tracing starts from the start point and reaches the edge of the input image and the tracing operation of the outline is also finished at such an edge. Therefore, the outline tracing operation doesn't reach the character train "take" and "take" cannot be extracted as well. Computer Graphics and Image Processing (1973), Volume 2, Pages 39-59, in an article "A Model Building Approach To Property Measurement In Black And White Pictures" by Robert L. Stafford, discloses an image processing method for extracting the image of a character from an input image. The input image is scanned in order to find arrangements of points which are identical to a stored pattern of points. This technique is used to locate the corner points of the images and thereby generate a contour map. SUMMARY OF THE INVENTION According to a first aspect of the present invention, there is provided an image processing method comprising the steps of: providing an input image containing a character to be extracted; and extracting the character from the provided input image, the method being characterized by comprising the steps of: tracing an outline of the character from a first start point of the input image; moving the start point when the outline reaches an edge of the input image without extracting any character information ; a second tracing step of tracing the outline from the moved start point; and repeating said tracing step and said moving step until character information can be extracted in said second tracing step. According to a preferred aspect of the invention, when said tracing step and said moving step are repeated, the number of times the start point is moved is counted, and when the count value (cline) exceeds a predetermined value, the value of the pixels of the image are inverted. The method may include the step of comparing the extracted character with a stored character, and thereby identifying the extracted character. According to a second aspect of the present invention, there is provided an image processing apparatus comprising: input means for inputting an input image containing a character to be extracted; and extracting means for extracting the character from the provided input image, the apparatus being characterized by comprising: tracing means for tracing an outline of the character from a first start point of the input image; means for moving the start point when the outline reaches an edge of the input image without extracting any character information; wherein said tracing means is arranged to trace the outline from the moved start point; and means for repeating said tracing and moving until character information can be extracted. In a preferred aspect of the invention, the apparatus includes means for repeating said tracing and moving, counting means for counting the number of times the start point is moved, and inverting means for inverting the value of the pixels of the image when the count value (cline) exceeds a predetermined value. The apparatus may include means for comparing said extracted character with a stored character, and thereby identifying the extracted character. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing an embodiment; Fig. 2 is an external view of an apparatus of the embodiment; Fig. 3 is a diagram showing a storing method of an image buffer; Fig. 4 is a flowchart showing whole processes; Fig. 5 is a flowchart showing an extracting process; Fig. 6 is a diagram for explaining a character extraction by an outline tracing operation; Fig. 7 shows an example of blank characters; Fig. 8 shows an example of ordinary characters; Fig. 9 shows an example of ordinary characters (bold characters); Fig. 10 shows an example of blank characters; Fig. 11 shows an example of ordinary characters including a ruled line; and Fig. 12 shows an example of a construction of a conventional electronic dictionary of the recognizing type. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 is a block diagram showing an embodiment according to the invention and shows a construction of an electronic dictionary of the recognizing type in which a document on which an English text has been printed is read by a manual reading operation, characters are recognized and a Japanese translation of a word is displayed by searching a dictionary by using the result of the character recognition. In the diagram, reference numeral 1 denotes a scanner to convert image information of an object to be read into an analog signal; 2 a binary converter to convert the analog signal generated from the scanner 1 into the binary digital signal; 3 an encoder which is synchronously rotated when the object is read by a manual scan and which generates a signal synchronized with the manual scan by detecting the rotation of the encoder by a photo interrupter; 4 a reed switch for monitoring a depressing state of a roller to give the rotation to the encoder and for detecting the end of the reading operation; and 10 a central processing unit (CPU) comprising a large scale integrated circuit (LSI) including an interruption input port, an interruption control circuit, clock pulse generator, aninstruction decoder, registers, an ALU, an input port, an output port, and an image input shift register. Reference numeral 11 denotes a random access memory (RAM) having a readable and writable memory section which is assigned to every address. As functions of the memory section, there can be mentioned a memory function to store data, a flag function to store the result of the discrimination, a counting function to store a state by a count value, a register function for temporary storage, and the like. Reference numeral 12 denotes a read only memory (ROM) in which microprograms which are sequentially executed by the CPU 10, a recognition dictionary, an English/Japanese dictionary, and constants which are used in various kinds of discriminations or the like have been encoded and stored. Reference numeral 13 denotes a liquid crystal display driver (LCD driver) for receiving output data and generating a signal to display on a liquid crystal display (LCD) 14; 15 a keyboard; and 16 an external bus line including an external address bus and an external data bus. The addressing of the ROM and RAM, the transmission and reception of data, and the like are executed through the external bus line 16. Fig. 2 is a diagram showing an external view of an apparatus of the embodiment. Reference numeral 21 denotes an upper casing; 22 a lower casing; 23 an input key; 24 a liquid crystal display; 25 a roller to give a rotation to the encoder; 26 a reading unit; 27 a mark for reading; 28 a cavity for a thumb to improve a holding performance. First, image buffers which are provided in the RAM 11 will be described with reference to Fig. 3. A scanner used in the embodiment is a one-dimensional line sensor and reads image data one line by one. The invention can be also applied to a line sensor which can read image data on plural lines. Reference numeral 31 indicates image buffers which are provided in the RAM 11, the x direction is called a column, and the y direction is called a row. The image data of one line which has been read is sequentially stored from the 0th column in the direction from the left to the right. Since the image data has already been binarized by the binary converter 2, reference numeral "1" in the image buffer corresponds to the black pixel and "0" corresponds to the white pixel in the original image. Fig. 4 is a flowchart showing whole processes of the embodiment. The processes are executed under the control of the CPU 10 in accordance with programs stored in the ROM 12. A character image is read from the scanner 1 in step S401. In step S402, what is called a character extraction to determine a rectangular region of each character is executed by the CPU 10. In step S403, a checking process is executed for every rectangular region by the CPU 10. In step S404, the CPU 10 searches the dictionary in the ROM 12 by using the character train obtained. In step S405, the translation results are displayed by the LCD 14. The extracting process in step S402 will now be described in detail in accordance with a flowchart of Fig. 5. Processes in the flowchart of Fig. 5 are executed under the control of the CPU 10 in accordance with the program stored in the ROM 12. In the first step S501, initial values are set into the data in the RAM 11. That is, a value of a variable p to store the x coordinate of the extraction start position, a value of a variable cline indicative of the number of columns replaced to the white pixels, and a value of a flag rflag indicating that the whole image buffers have been inverted are set to "0". The first column of the image buffers is set to the white pixels in order to perform the extraction by the outline tracing. Fig. 6 shows an example of character images stored in the image buffers in the RAM 11. In step S502, a character is extracted by the outline tracing in the direction from a point a 1 at the left edge central position in the image buffer to the right. The pixels are examined from the point a 1 to the right. The outline tracing is executed from a point at a position where the outline tracing first collides with the black pixel. A rectangular region which is given by the minimum value (x 1 , y 1 ) and the maximum value (x 2 , y 2 ) of the outline coordinates obtained by the outline tracing is set to a region of one character. An algorithm of the outline tracing is a well-known technique. In step S502, each time the outline tracing is started, the x coordinate is substituted into p. After the region of one character was derived, the pixels are examined from a position a 2 of the coordinates (x = x 2 , y = (y 1 + y 2 )/2) to the right in order to extract the next character and processes similar to those mentioned above are executed. In case of the blank characters as shown in Fig. 7 or 10 or in the case where a ruled line exists before the word to be read as shown in Fig. 11, the outline tracing position reaches the upper/lower or left/right edge of the image buffer during the outline tracing operation and, after that, the outline tracing cannot be performed. Even in case of ordinary characters as shown in Fig. 8, after all characters were extracted, the outline tracing position finally reaches the right edge of the image buffer, so that a discrimination by the CPU 10 regarding whether the extraction has succeeded or not is executed in step S503. That is, when the outline tracing position reaches the edge after one or more characters were extracted, the outline tracing is returned. When it reaches the edge without extracting any character, the processing routine advances to step S504. In step S504, when the value of the variable cline in the RAM 11 is equal to or less than a predetermined threshold value N, step S505 follows. If it is larger than N, step S509 follows. In step S505, the value p of the x coordinate at which the outline tracing has been started is increased by only a predetermined value d. In step S506, the values of the line of x = p are stored into the line memory buffers set in other addresses different from those of the image buffers in the RAM 11. The line memory buffer can store the data of N lines. In step S507, all of the values of x = p in the image buffers are set to "0". In step S508, the value of cline in the RAM 11 is increased by "1" and, after that, the processing routine is returned to step S502 and the extracting process is again executed. In the case where a ruled line is included as shown in Fig. 7, the processes in steps S505 to S508 for setting all of the values in the image buffers of one line into "0" are executed once so long as the ruled line is a thin line. Those processes are repeated a few times even when such a ruled line is a thick line. Due to this, the outline tracing position can get over the ruled line, so that the word subsequent to the ruled line can be accurately extracted. On the other hand, when cline in the RAM 11 is larger than N in step S504, step S509 follows. When rflag in the RAM 11 is equal to 1, step S510 follows and the data of N lines stored in step S506 is returned into the image buffers and the original image data is reconstructed. In step S511, all of the values in the image buffers are inverted. That is, "0" is inverted into "1" and "1" is inverted into "0". By the above process, the blank characters as shown in Fig. 7 or 10 are also inverted and can be recognized in a manner similar to ordinary characters. To store that the inverting process has been executed, "1" is set into rflag in the RAM 11 in step S512. After that, step S502 follows and the extracting process is again started. In step S512, both of cline and p in the RAM 11 are reset to "0". When rflag in the RAM 11 is equal to 1 in step S509, this means that the inverting process has already been performed once. There is no meaning to again invert. Therefore, the CPU 10 determines that the input image is an image that cannot be recognized. The processing routine is finished. In the embodiment, after the image data was stored into the whole image buffers, the extracting process is started. The extracting process can be also executed in parallel with the transfer of the image data from the scanner. In such a case, when it is assumed that the image data has already been transferred until x= x 1 at a certain time point t, it is necessary to wait for the execution of each process in steps S502, S505, and S511 in the flowchart of Fig. 5 so as not to exceed x = x p . In the embodiment, although the data is transferred from the scanner into the image buffer every line, the data transfer can be also performed every row. In the embodiment, an English word is read and the translated word of Japanese is displayed. However, the kind of language as an object to be read is not limited so long as spaces exist (characters are separately written). The invention also doesn't depend on the recognition algorithm and word extracting algorithm but is also effectively applied to other algorithms.

Claims: An image processing method comprising the steps of: providing an input image containing a character to be extracted (S401); and extracting the character from the provided input image (S402), the method being characterized by comprising the steps of: tracing an outline of the character from a first start point (x 1 , y 1 ) of the input image; moving the start point (x 2 , y 2 ) when the outline reaches an edge of the input image (S505) without extracting any character information; a second tracing step of tracing the outline from the moved start point (x 2 , y 2 ); and repeating said tracing step and said moving step until character information can be extracted in said second tracing step. A method according to claim 1, wherein when said tracing step and said moving step are repeated, the number of times the start point is moved is counted, and when the count value (cline) exceeds a predetermined value (N), the value of the pixels of the image are inverted (S511). A method according to either of the preceding claims including the step of comparing said extracted character with a stored character (S404), and thereby identifying the extracted character (S405). An image processing apparatus comprising: input means (1-3) for inputting an input image containing a character to be extracted (S401); and extracting means (10, 11, 12) for extracting the character from the provided input image (S402), the apparatus being characterized by comprising: tracing means for tracing an outline of the character from a first start point (x 1 , y 1 ) of the input image; means for moving the start point (x 2 , y 2 ) when the outline reaches an edge of the input image (S505) without extracting any character information; wherein said tracing means is arranged to trace the outline from the moved start point (x 2 , y 2 ); and means for repeating said tracing and moving until character information can be extracted. An apparatus according to claim 4, including means for repeating said tracing and moving, counting means (11) for counting the number of times the start point is moved, and inverting means for inverting the value of the pixels of the image when the count value (cline) exceeds a predetermined value (N). An apparatus according to claim 4 or 5, including means (10) for comparing said extracted character with a stored character (S404), and thereby identifying the extracted character (S405).

Inventors: NIKI TORU, NIKI, TORU, NIKI, TORU, C/O CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1992
Main classification: G06K9
IPC codes: G06K9