Method and apparatus for automatic language determination

Abstract: An automatic language determining apparatus automatically determines the particular Asian language of the text image of a document when the gross script-type is known to be, or is determined to be, an Asian script-type. A connected component generating means (28) generates connected components from the pixels comprising the text image. A character cell generating means generates a character cell surrounding at least one connected component. An optical density determining means determines the optical density, in absolute numbers or percentage of pixels, of the pixels within each character cell. A script feature determining means first generates a histogram, then converts, by linear discriminate analysis, the histogram to a point in a new coordinate space. A language determining means (36) compares the determined point of the text portion in the new coordinate space to predetermined regimes in the new coordinate space corresponding to at least one Asian language to determine the particular Asian language of the text image.

Description: The present invention relates to a system for determining a language of a script-type text portion according to the preamble part of claim 1 and a method of automatically determining a language of a text portion according to the preamble part of claim 10. Such a system and method are described in JP 5040846. This document teaches a discrimination method to shorten time required for Japanese/European language discrimination processing. After binarizing a document image, the number of black runs in a row or column direction of the document is determined to measure a line density and the Japanese/European language discrimination is performed based on the statistical features of the measured line density. Optical character recognition and the use of optical character recognition to convert scanned image data into text data suitable for use in a digital computer is well known. In addition, methods for converting scanned image data into text data and the types of errors such methods generate are well known. However, the proper selection of the character recognition method is highly dependent upon the script (alphabet or ideogram) used in the document. Further, the selection of a proper method for error correction is highly dependent upon the language of the document. Conventionally, the methods for optical character recognition and for error correction in optical character recognition systems have been provided on the assumption that the script and language used in the document is the usual script and language of the country in which the system is being used. That is, in the United States, conventional optical character recognition systems would assume that the document is in English and uses Roman script, while in Japan, an applicable character recognition system would be implemented assuming that the language is Japanese and uses the Japanese scripts. Alternately, an optical character recognition system can be implemented with the character recognition and error resolution methods for a plurality of languages. However, it has heretofore not been possible to have the optical character recognition system automatically determine the script type and/or language of the document. Rather, as each document is provided to the optical character recognition system, some indication of the particular language and script of the document must be given to the optical character recognition system. This has been accomplished by either having the operator input data concerning the language and script of the document to the optical character recognition system, or by having the document provided with special markings which indicate the language and script of the document. It is the object of the invention to provide a method and a system having improved automated language recognition capabilities. This object is solved by the system of claim 1 and the method of claim 10. Preferred embodiments are the subject matter of the dependent claims. The invention will be described further, by way of examples, with reference to the accompanying drawings, in which: Figure 1 shows a block diagram of an optical character recognition system; Figure 2 shows a document having three sample text portions, one each of Korean (Hangul), Chinese, and Japanese scripts; Figure 3 shows the text portions of Figure 2 with character cells around the connected components; Figure 4 shows a sample of Japanese text and the resulting optical density function; Figure 5 shows a histogram of the optical densities of Korean, Chinese and Japanese texts; Figure 6 shows a Linear Descriminant Analysis conversion of Figure 5; and Figure 7 a flow chart of the Asian language determination method of the present invention. As shown in Figure 1, a optical character recognition system of the present invention comprises a scanner 110 having a charge coupled device (CCD) or the like. The scanner 110 scans a document 100 having an image 102 (a sample image 102 comprising three text strings of unknown script and language is shown in Fig. 2), and outputs a digital data signal representative of the location and image density of a plurality of pixels comprising the image 102 of the original document 100. This digital data signal is sent to a memory 112, where it is stored temporarily or indefinitely. The digital data signal, when output from the memory 112, is input to a general purpose digital computer 114. Once input to computer 114, the digital data signal is first cleaned up by removing any non-text portions of the image 102, leaving a text portion 104. Further, any scanner artefacts of the digital data signal, such as skew or the like, are corrected for. The cleaned up digital data signal is then restored to the memory 112 or stored in a memory of the computer 114. Alternatively, the scanner can provide some of the preprocessing, such as removal of scanner artefacts. As shown in Figure 1, the general purpose digital computer 114 of the present invention comprises a memory 22 for storing a control program, an input/output circuit 24 for inputting the digital data signal from the memory 112 and for outputting a signal representative of the determined script type of the image 102. The general purpose computer 114 also comprises an image RAM 26 for storing the digital data signal, a connected component generating means 28 for generating connected components from the digital data signal; bounding box generating means 30 for determining the coordinates of the bounding box and the pixels of the digitized image within the bounding box for each of the connected components; character cell generating means or spatial feature determining means 32 for generating character cells comprising one or more connected components; feature determining means 34 for determining the distribution of one or more types of predetermined features for each of the bounding boxes; and a script or language determining means 36 for determining the script-type of the document. The memory 22 for storing the control program may comprise either a ROM 22a or a RAM 22b. In operation, the document 100 containing the image 102, as shown in Figure 1, is placed into and scanned by the scanner 110 to generate a serial or parallel digital data signal. The digital data signal comprises a plurality of signal portions, each portion representative of a corresponding pixel of the original image 102. Each pixel of the image 102 has a location in the image 102 and an image density. Accordingly, each signal portion of the digital data signal includes data representative of the location and image density of the corresponding pixel. The digital data signal output by the scanner 110 is then stored in the memory 112. The memory 112 may comprise a RAM, a flash memory, a disk memory or the like. Regardless of the type of memory 112, the digital data signal is stored in the memory 112 in response to the location and image density data within each signal portion. Of course, it is understood that the digital data signal can be directly input to the general purpose digital computer 114, rather than into the intermediate memory 112. Alternately, the memory 112 can be incorporated into the general purpose digital computer 114. In any case, it is understood that the memory 112 is used to provide long-term storage of the image 102. Once the operator has completed inputting documents into the scanner 110 or the system otherwise determines that the digital data signal representative of the image 102 should be converted to text data, the digital data signal representative of the image 102 is output from the memory 112 to the general purpose computer 114. It is of course understood that a special purpose digital computer or hardwired logic circuit can be used in place of the general purpose digital computer 114. The digital image data signal stored in the memory 112 is output to the general purpose computer 114, where it is input through the input/output means 24 to an image memory 26. In a first preferred embodiment of the present invention, when the gross script-type is known to be Asian, the feature determining means 34 is set to a preselected feature for distinguishing between Korean, Chinese and Japanese language documents. Of course, it is understood that if the gross script-type of the text portion is not identified or known to be an Asian script type, the method and apparatus for determining the gross script classification, as described in a co-pending European patent application, filed concurrently herewith, and based on US 5,444,797 can be used. Once the digital data signal has been completely stored in the image memory 26, the digital data signal is then made available to the connected component generating means 28. The connected component generating means 28 divides the digital data signal representative of the text portion 104 of the image 102 into a plurality of connected components, each connected component comprising one or more signal portions. Each connected component comprises signal portions corresponding to those pixels of the original image 102 which have a certain minimum image density and form a continuous path. Each script character generally corresponds to one connected component, as in the "F" of "Fuji" or more than one connected component, as in the "j" or "i" in "Fuji". Once the connected component generating means 28 generates the plurality of connected components for the text portion 104 from the digital data signal, the digital data signal corresponding to the text portion 104 and the list of connected components generated by the connected component generating means 28 is stored to the image memory 26 and output to the bounding box generating means 30. The bounding box generating means 30 redivides the digital data signal representative of the text portion 104 into a plurality of bounding boxes, each bounding box containing one connected component and zero, one or more signal portions of the digital data signal corresponding to pixel locations adjacent to the pixels comprising the connected component. The dimensions of each bounding box are determined by the location data of the leftmost, rightmost, uppermost and bottommost signal portions comprising the corresponding connected component. Accordingly, the signal portions within the bounding box are those comprising the connected component and those signal portions having a location data placing them within the boundaries of the bounding box, regardless of their image density data. Once the list of bounding boxes and the signal portions comprising each bounding box has been generated by the bounding box generating means 30, the list of bounding boxes and the corresponding signal portions is stored to the image memory 26 and output to the spatial feature determining means 32. The spatial feature determining means 32 determines the lines, words and/or character cells of the text portion using any one of a variety of methods. One such method is described in a co-pending European patent application, filed concurrently herewith, and based on US Serial No. 5,444,797. In the first preferred embodiment, the optical density script feature is used by the feature determining means 34 to distinguish between Korean, Chinese and Japanese language documents. Figure 2 shows three samples of Asian language texts comprising the text portion 104 of image 102 of document 100. The connected component generating means 28 determines each connected component for the text portion 104. The bounding box generating means 30 then determines the bounding boxes for each connected component. The spatial feature determining means 32 then determines the character cells as shown in Fig. 3. Of course, if any of these operations have already been completed during a previous gross script classification operation or character cell generating operation on the text portion 104, it would not be necessary to repeat them. In any case, in the first preferred embodiment of the present invention, the feature determining means 34 is set up to determine the optical density, or total number of pixels having an image density greater than a predetermined value, of each character cell. Figure 4 shows another sample of Japanese language text, and the optical density of the character cells due to the at least one connected component within each character cell against the location data for each character cell. The list of character cells and the corresponding list of image density values are output from the feature determining means 34 to the language determining means 36. In the first preferred embodiment, the language determining means 36 first generates a histogram of the optical densities of the character cells of the text portion 104 like the ones shown in Figure 5. It should be noted that the horizontal extent of the intercharacter spaces (i.e, those locations where the optical density function drops to zero) is not included in the histogram of Fig. 5. In the histograms of Figure 5, the optical density range is shown on the X-axis and the total or cumulative horizontal extent of the character cells containing the values of the optical density is shown on the y-axis. As shown in Figure 5, the generalized histograms for Korean, Chinese and Japanese language texts are easily distinguished. Because the method and apparatus of the present invention are statistically based, they are very robust and can withstand even a very poorly printed and/or scanned document. That is, it is not necessary for the digital data signal or the connected components generated from the digital data signal to perfectly represent every character of the document. Rather, the present invention is able to withstand such common scanning errors such as splitting a single connected component character into two or more connected components or merging two or more separate connected components into a single connected component. However, it would be difficult to compare the histograms of the generalized Asian language texts with the histogram of the text portion 104 of image 102 to determine the particular language of the text portion. Accordingly, the normalized three generalized histograms are converted by linear discriminant analysis (LDA) to a new coordinate space. In the new coordinate space, the variables have equal variance and are uncorrelated. As shown in Figure 6, the new coordinate space has three non-overlapping regions corresponding to each of the three histograms of the generalized Korean, Chinese and Japanese language texts. The language determining means 36 converts the histogram of the text portion 104 of image 102 by LDA to a point in the new coordinate space. The Asian language corresponding to the generalized-language region of the new coordinate space, into which the point falls or is closest to, is determined as the particular Asian language for the text portion 104. Once the language determining means 36 has determined the particular Asian language for the text portion 104 of image 102, the results of the language determining means 36 can be directly output to an optical character recognition means for selecting the optimal optical character recognition algorithms or training sets for the script and the language determined by the apparatus and method of the present invention. Alternately, the results, along with the text portion 104, can be stored in memory 112 for delayed processing. A simplified flowchart of the operation of the script determining system set forth above is shown in Figure 7. In step S100, the system starts, and the document is scanned in step S110 to generate the digital data signal. The digital image data signal is then cleaned-up by applying any desired preprocessing algorithms to the digital image data signal in step S120. In step 130, the connected components of the digital image data signal are identified and in step S140, the bounding boxes for each of the determined connected components are determined. In step S150, the character cells of the text portion 104 are generated. In step S160, the script feature to be determined is selected. In the preferred embodiment, the preferred feature is the optical density of the character cells. In step S170, the optical density of each character cell is determined. Then, in step S180, a histogram of the distribution of determined or located features (the total or cumulative horizontal extent of the optical densities of the character cells in the preferred embodiment) for the text portion 104 is generated. In step S190, the determined histogram converted by LDA to a location on the new coordinate space. In step S200, the location of the text portion 104 is compared with the regions in the new coordinate space corresponding to generalized text portions of a plurality of different Asian languages to determine the particular Asian language of the text portion 104. In step S210, the Asian language corresponding to the region which is closest to the point is selected as the language of the text portion 104. Finally, in step S220, the particular Asian language of the text portion 104 is output and the system stops in step S230.

Claims: A system for determining a language of a script-type text portion (104) of an image of a document (100), the system comprising: input means (24) for inputting a digital data signal representative of the script text portion, the digital data signal comprising a plurality of signal portions, each signal portion corresponding to one of a plurality of pixels, the system characterized in that : connected component determining means (28) for dividing the digital data signal into at least one connected component comprising one or more signal portions; feature determining means (34) for determining script features corresponding to at least one preselected type of script feature in at least one connected component, wherein script features include an optical density of character cells; and language determining means (36) for comparing a distribution of the located script features with at least one predetermined script feature distribution of a plurality of languages and for determining the language of the script text portion based on the comparison. A system of claim 1, wherein the feature determination means comprises bounding box generating means (30) for generating, for each at least one connected component, a bounding box comprising the plurality of signal portions for each said connected component; and character cell determining means (32) for generating a plurality of character cells, each character cell comprising at least one connected component. A system as claimed in claim 2, wherein the feature determining means (34) further comprises optical density determining means for determining optical densities of the plurality of character cells. A system as claimed in claim 3, wherein the optical density corresponding to each character cell of the plurality of character cells is normalized to an area of said character cell. A system as claimed in claim 3 or claim 4, wherein the language determining means comprises means (36) for generating a histogram corresponding to the optical densities of the plurality of character cells. A system as claimed in claim 5, wherein the language determining means further comprises linear discriminant analysis (LDA) generating means for converting, by linear discriminant analysis, the histogram to point in a new coordinate space, comparing means for comparing the point with a plurality of predetermined regimes in the new coordinate space, and output means for outputting a determined language for the text portion in response to the comparison. A system as claimed in claim 1, including a scanner (110) for scanning the document (100) and outputting the digital data signal representative of the image on the document, the digital data signal comprising a plurality of signal portions, each signal portion comprising data representative of a corresponding one of a plurality of pixels of the image; a memory (112) for storing the digital data signal; and a controller for determining the Asian language of the text portion (104) of the image, comprising the connected component generating means (28) for determining at least one connected component from the plurality of signal portions; the feature determining means (34) for determining script features, corresponding to at least one predetermined type of script feature, for each at least one connected component; feature distribution determining means for determining a distribution of the determined script features; comparison means for comparing the determined feature distribution to predetermined feature distributions of at least one Asian language; and output means for outputting a signal representative indicative of a determined language of the script text portion. A system as claimed in claim 7, wherein the feature determining means comprises: a character cell determining means (32) for determining a plurality of character cells, each one of the plurality of character cells comprising at least one connected component. A system as claimed in claim 8, wherein the feature determining means (34) further comprises feature selecting means for selecting at least one script feature to be determined. A method of automatically determining a language of a text portion (104) of a document (100), the method characterized in that : determining at least one connected component by dividing the digital data signal into the at least one connected component comprising one or more signal portions; determining script features of the script text portion based on the at least one connected component corresponding to at least one preselected type of script feature, wherein script features include an optical density of character cells; determining a distribution corresponding to each at least one preselected type of script feature for the located script features; comparing the feature distribution of the located script features with at least one predetermined feature distribution for at least one language; and determining the language based on the comparison of the comparing step.

Inventors: SPITZ A LAWRENCE, SPITZ, A. LAWRENCE
Applicants: FUJI XEROX CO LTD, XEROX CORP, FUJI XEROX CO., LTD., XEROX CORPORATION
Application year: 1994
Main classification: G06F17
IPC codes: G06K9, G06F17