DISCRIMINATOR BETWEEN HANDWRITTEN AND MACHINE-PRINTED CHARACTERS

Abstract: A video image of a region including characters recorded on a document is converted into electric signals (j). From the electric signals, unit signals (a - i) are picked up, corresponding to subregions obtained by dividing the image region. Horizontal, vertical and slanted stroke components,(k, l, m) included in each of the subregions are detected from the unit signals by a pattern detector (2). The detected numbers of the horizontal, vertical and slanted stroke components (k, l, m) are counted by counters (3, 4, 5). The ratio (q) of the counted numbers of the slanted stroke component (p) to the total of the horizontal, vertical and slanted stroke components (n + r + p) is calculated by a circuit (b). The characters on the document are judged as handwritten and as machine-printed when the ratio (q) is above and not above a predetermined threshold respectively. The threshold is prefer­ ably set at 0.2.

Description: BACKGROUND OF THE INVENTION The present invention relates to a discriminator for discriminating between handwritten and machine-printed characters recorded on a document such as mail. A ZIP code written on the mail is recognized with an optical character reader (OCR). The numerals of such ZIP code are usually handwritten or machine-printed. For recognizing the machine-printed character, the similarity of their overall shapes is used for the judgment criterion. On the other hand, the similarity of the handwritten character is determined on the basis of the feature of "unit line" such as horizontal, vertical or slanted lines. The slanted lines include lines with the right or left end up, and springing up at the end. For effective recognition, there have been provided two OCR's for the respective handwritten and machine-printed character recognitions. However, if no technique is used for descriminating between the two, handwritten characters are often processed with the OCR for machine-printed characters, resulting in erroneous recognition. If it is known before the recognition with OCR whether the characters are machine-printed or handwritten, such erroneous recognition can be avoided, thereby to increase the processing speed. US-A 4 516 262 discloses apparatus which discriminates between discrete machine-printed and handwritten characters (such a kana or kanji characters) by analysis of the number of strokes making up a character and of three ratios of different kinds of strokes to one another. The object of the present invention is to provide a discriminator between handwritten and machine-printed characters which is simpler than the known apparatus. Another object is to provide a method capable of handling handwritten characters which are linked together (e.g. as in Figure 3 below). The discriminator according to the invention is defined in claim 1. The invention further provides a method of discriminating between handwritten and machine-printed characters, as defined in claim 4. The threshold used to discriminate in the discriminator and in the method is preferably 0.2. Other objects and features of the present invention will be clarified from the following description when taken in conjunction with the drawings. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram illustrating the horizontal, vertical and slanted arrangements of stroke pixel signals for use in a preferred embodiment of the present invention; FIG. 2 is a block diagram illustrating the embodiment of the invention; FIG. 3 is a diagram illustrating an example of handwritten English letters used for testing the benefits of the invention; FIG. 4 is a diagram illustrating an example of stroke components used in FIG. 4; and FIG. 5 is a diagram for describing the situations of the shifting of a subregion in a region to be recognized. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS In the present invention, the character portion on the document is divided into a plurality of small subregions (unit regions) by optically scanning the portion. It is to be assumed here that the character is comprised of horizontal, vertical and slanted strokes (lines). Unit region video signals are obtained with the optical scanner unit region by unit region. The discrimination of the handwritten character from the machine-printed character is performed by detecting that the occurrence ratio of the slanted stroke (line) component to the total of horizontal, vertical and slanted stroke components is above a predetermined level. This criterion has been experimentally testified. The unit region may contain, as illustrated in FIG. 1, 3 × 3 or 9 pixels. In FIG. 1, A and B represent horizontal, C and D; vertical, and E, F, G and H; slanted stroke components. A predetermined region including characters on the document is scanned with known optical scanner so as to obtain video signals, each comprising pixel signals of binary values "1" and "0". Referring to FIG. 2, in a preferred embodiment of the invention, a pixel signal j is stored in a shift register (memory) 1. By structuring a suitable shift register, it is made possible to store signals a to i , each corresponding to one of the pixel signals of a unit region in FIG. 1, in specified areas as shown in FIG. 2. The pixel signals a to i for the unit region are supplied to a pattern detecting circuit 2. The circuit 2 compares the arrangement of "1" values (black circles in FIG. 1) in each of the pixel signals a to i with the pattern arrangement A to H in FIG. 1, and generates identity signals k , ℓ and m if the pixel arrangement coincide with the horizontal stroke components of A and B, the vertical stroke components of C and D and the slanted stroke components of E to H in FIG. 1, respectively. The next unit region to be scanned (the unit region either vertically or horizontally shifted) is processed in the same manner, and all the remaining unit regions of the whole region to be scanned on the document are similarly processed. The identity signals k , ℓ and m are supplied to a horizontal component counter 3, a vertical component counter 4 and a slanted component counter 5, respectively. The counters 3, 4 and 5 count the number of the generation of the identity signals k , ℓ and m and generates the counted number signals n , r and p , respectively. A discriminating circuit 6 calculates the ratio R of the counted number of slanted strokes P to the total counted number of horizontal, vertical and slanted strokes (n + r + p) in accordance with Equation (1). The discriminating circuit 6 recognizes the characters recorded on the document as "handwritten characters" when the ratio R is above a predetermined threshold (which may be, for instance, 0.2), or machine-printed when it is not. FIG. 3 illustrates an example of handwritten characters used for discrimination in the experiment based on the present invention. The character region scanned is the "Philad" portion of "Philadelphia", and consists of 37 × 128 pixels. In FIG. 3, small points with equal intervals arranged in horizontal and vertical directions represent the center positions of the pixels. The patterns of the horizontal, vertical and slanted stroke components used in the experiment are illustrated in FIG. 4. The components are classified into a total of eight patterns #1 through #8. The patterns #1 and #5 represent vertical stroke components and are denoted by v ○, #2 and #6; slanted stroke components with the right end down and #4 and #8; slanted stroke components with the right end up, all denoted by s ○, and #3 and #7; horizontal stroke components, denoted by h ○. In FIG. 4, a black circle represents "1", a blank circle; "0"; and a dash "-"; a part irrelevant to stroke identification whether a black or a blank circle. In this embodiment, as stated above, horizontal, vertical and 45° slanted stroke components are used. Since the deviation of the character alignment on the documents is usually ±30° at most, it does not significantly affect the accuracy of discrimination in accordance with the present invention. Here, the patterns #9 through #12 are included in slanted stroke components. Referring back to FIG. 3, the object region is scanned with a scanning line of about 0.25 mm in width, for example, first in the vertical direction from the top left corner, then again in the vertical direction shifted by 0.25 mm (one scanning line's width) from the first vertical scanned line, and so on till the scanning reaches the bottom right corner. The signals obtained by vertical scanning are sampled with clocks of a predetermined frequency, which is determined by the scanning speed, to obtain pixel signals at 0.25 mm intervals in the vertical direction. The sampled signals are compared with the predetermined threshold, and converted into binary pixel signals of "1" or "0". Thus obtained pixel signals constitute the signal j of 37 × 128. The shift register 1 shown in FIG. 2 comprises three rows of unit shift registers each having 37 stages. Data are inputted from the top, and shifted successively downward and from the bottom of a row to the top of the next row. The pixel signal j is inputted from the top left of the shift register 1, and successively shifted in response to clocks of a predetermined frequency. At a certain time point, as illustrated in FIG. 1, signals a through i of a unit region are stored in the shift register 1. Each of these signals a through i constitutes a unit pattern comprising 3 × 3 pixels, and is supplied to the pattern detecting circuit 2. The circuit 2 detects the presence of the horizontal, vertical or slanted stroke component. Incidentally, if the shift register 1 is suitably structured, it will also be possible to successively extract unit patterns shifted by a one-pixel equivalent each in the horizontal and vertical directions. This shifted extraction by one-pixel brings about the effect of the reducing the scanning intervals in the vertical and horizontal directions. Thus, in vertically shifting from one unit pattern to the next in the arrangement illustrated in FIG. 5, the first unit pattern to be extracted would consist of the pixel components of H1 in the horizontal and of V1 in the vertical direction, followed by the second consisting of those of H1 again in the horizontal and of V2 in the vertical direction and then by the third consisting still of H1 in the horizontal and of V3 in the vertical direction. Horizontal shifting of the unit pattern to be extracted would take place, with the V1 range of pixel components in the vertical direction kept unchanged, from the first unit pattern of V1 by H1 to V1 by H2 and then to V1 by H3. The unit pattern signals a through j extracted from the shift register 1 in this manner are, as stated above, subjected to determination of the presence or absence of horizontal, vertical and slanted stroke components by the pattern detecting circuit 2. The resultant identify signals k , ℓ and m for horizontal, vertical and slanted stroke components are supplied to the counters 3, 4 and 5, respectively. In the object region of FIG. 3 is shown one example each of a vertical stroke v ○, a horizontal stroke h ○ and a slanted stroke s ○. In the figure, w ○ denotes a subregion where no lines are present (all pixel signals are "0"; corresponding to the pattern #13 in FIG. 4), and b ○ ; a subregion where all pixel signals are "1" (corresponding to the pattern #14 in FIG. 4). The numbers of the counted stroke components are obtained in this experiment as shown below: v = 109, v/(v + s + h) = 0.38 s = 79, s/(v + s + h) = 0.28 h = 96, h/(v + s + h) = 0.14 b = 92 w = 2392 In this case, since the value of R in Equation (1) is 0.28, the characters are recognized as handwritten characters. The results of various experiments indicate that the threshold for recognizing the given characters as hand-written ones should be desirably not less than 0.2 (20%). In the experiment, English characters of handwritten on the mails of 400 and of machine-printed on the mails of 400 were discriminated with a threshold R of 0.20, and the correct discrimination ratio was over 95%, demonstrating the effectiveness of the present invention.

Claims: A discriminator between handwritten and machine-printed characters, including means for picking up in the form of electric signals a video image of a region including characters recorded on a document, and discriminating means (1 - 6) for discriminating the characters as hand-written ones and machine-printed ones, characterized in that said discriminating means comprise means (1) for successively extracting from said electric signals unit pattern signal sets ( a - i ), each set corresponding to a sub-region of said region, the unit pattern signal sets ( a - i ) being so extracted that they pertain to a succession of progressively shifted sub-regions, each of which involves part of the previous sub-region in the succession of sub-regions, means (2) for detecting horizontal stroke, vertical stroke and slanted stroke components included in each of the extracted unit pattern signal sets, horizontal, vertical and slanted stroke counters (3, 4, 5) for counting the numbers of detections of the horizontal, vertical and slanted stroke components respectively, means (6) for calculating the ratio R of the output of the slanted stroke counter (5) to the sum of the outputs of all of the horizontal, vertical and slanted stroke counters (3, 4, 5), and means (6) for discriminating the characters as handwritten ones and machine-printed ones if the ratio R is respectively above and not above a predetermined threshold. A discriminator according to claim 1, characterized in that the threshold is 0.2. A discriminator according to claim 1, characterized in that each unit pattern signal set consists of signals ( a - i ) for a total of nine pixels arranged in three rows and three columns. A method of discriminating between handwritten characters and machine-printed characters by analysis of electric signals representing a video image of a predetermined region containing characters on a document, characterized by the steps of successively extracting from said electric signals unit pattern signal sets ( a - i ), each set corresponding to a sub-region of said region, the unit pattern signal sets ( a - i ) being so extracted that they pertain to a succession of progressively shifted sub-regions, detecting horizontal stroke, vertical stroke and slanted stroke components included in each of the extracted unit pattern signal sets, counting the numbers of detections of the horizontal, vertical and slanted stroke components respectively, calculating the ratio R of the counted number of slanted stroke components to the sum of the counted numbers of all of the horizontal, vertical and slanted stroke components, and discriminating the characters as handwritten ones and machine-printed ones if the ratio R is respectively above and not above a predetermined threshold.

Inventors: KASUYA, SHIGENOBU, UMEDA, TETSUO
Applicants: NEC CORPORATION
Application year: 1988
Main classification: G06K9
IPC codes: G06K9