Method of and apparatus for separating image regions

Abstract: A method of and an apparatus for correctly cutting an unidentified read composite character image into separate and discrete character images, suitable for use in recognizing characters the images of which have wrongly been joined to each other to form a composite image when read from an original. For the purpose of correctly determining the position where the composite image is to be cut into separate character images, the apparatus has a configuration tracing device for detecting coordinate information concerning the configuration of an image of interest in an image information input from an original; a distance computing device for computing, on the basis of the coordinate information obtained by the configuration tracing device, the distances between the ends of the configuration of the configuration traced by the configuration tracing device as measured in the direction perpendicular to the train of characters, for successive points along a line parallel to the train of characters; and a separation position determining device for determining, on the basis of the distance information obtained by the distance computing device, a position where the image is to be cut into separate images.

Description: The present inention relates to a method of and an apparatus for separating adjoining image regions. In recent years, apparatuses have been proposed which are capable of optically and directly inputting character information by using optical means such as image scanners. Such apparatuses are very useful as they enable entry of character information from hand-written or printed or typed characters. In use of these apparatuses, however, recognition of discrete characters is often hampered by the fact that the optically read images of two or more successive characters on the original undesirably form a continuous image pattern composed of the character images adjoining and connected cach other, due to various reasons such as a practical limit in the resolution of the image scanner, stains on the original document, and so forth. Methods have been proposed to separate such adjoining images or patterns into discrete character images to enable correct character recognition, among which is most popular a method which utilizes a histogram of projection of the image in the direction of train (the direction of the line of writing) of the characters. This known character separation method will be described with reference to Figs. 7 and 8. It is assumed here that characters "a" and "c" on an original were optically read and that a composite image composed of images of the characters "a" and "c" adjoining each other has been obtained as shown in Fig. 7. When the height-to-length ratio of an envelope rectangle 201 of this composite image is equal to or below a certain value, i.e., when this composite image is horizontally very much elongated, the image is determined as being a composite image composed of images of successive characters adjoining each other and, hence, a demand arises for separation of this composite image into images of the discrete characters "a" and "c". To cope with this demand, a region 202 in which the separation is to be done is determined on the basis of the information concerning the envelope rectangle 201, and black pixels forming this composite image are projected on the X-axis of a coordinate so that a histogram 203 indicative of the frequencies of appearance of black pixels along the train of characters is obtained as shown in Fig. 8. Then, an X coordinate X c , which is within the above-mentioned region 202 and which has a histogram value d(x) not greater than a predetermined threshold d 0 , is determined as shown in Fig. 8. When there are a plurality of such X coordinates Xc, the mean value of these coordinates is determined as the coordinate Xc. The composite image is then "cut" into separate character images at the portion thereof corresponding to the X coordinate Xc. Thus, when the height-to-length ratio is equal to or below a predetermined value, the read composite image is determined as being a combination of images of successive characters, and the region 202 within which the composite character is to be cut is set on the basis of the configuration of the composite image. Then, the composite image is cut into discrete character images at a portion thereof where the frequency of occurrence of black pixels is highest within the set region, i.e., at the portion where the degree of bond between a plurality of groups of pixels is weakest. This known method, however, suffers from the disadvantage that the separation of character images is often hampered by influence of noise, due to the fact that the position where the composite image is "cut" is determined on the basis of the black pixel histogram. For instance, a histogram as shown in Fig. 10 is obtained when a stain on the original sheet is optically read to form an image 204 shown in Fig. 9 or when characters on the line which is immediately preceding the line which is being read extend for enough down on the scanned manuscript, etc., to have happened to be read concurrently. The image 204 of the stain increases the number of black pixels on the X-coordinate Xc to a value greater than the threshold value d o . In other words, there is no X-coordinate where the projection of the black pixels is equal to or below the threshold value d o (see Fig. 10). As a consequence, the composite image composed of images of characters adjoining each other cannot be correctly cut into discrete character images, making it impossible to recognize these characters. An article on Pattern Recognition vol. 19, No. 1, 1986, Elmsford, NY US pages 1-12, M. Shridhar & A. Badreldin "Recognition of isolated and simply connected handwritten numerals" discloses a procedure for separating connected numerals. Accordingly, a concern of the present invention is to provide a method of and an apparatus for separating image regions which enable composite image region to be cut into separate or discrete image regions corresponding to, for example, separate or discrete characters, thereby overcoming the above-described problems of the prior art. In accordance with a first aspect of the present invention, there is provided an image separation apparatus as set out in claim 1. According to a second aspect of the invention, there is provided an image separation method as set out in claim 7. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram of a character recognition apparatus constructed in accordance with the present invention; Fig. 2 is a flow chart showing character separation process performed in a first embodiment of the present invention; Fig. 3 is an illustration of a composite image in which images of two characters adjoin each other; Fig. 4(A) is an illustration of configuration of the composite image defined by coordinates of upper and lower ends of the composite image; Fig. 4(B) is an illustration of distribution of the difference between the upper and lower end coordinates; Fig. 5 is a flow chart showing a character separation process employed in a second embodiment of the present invention; Fig. 6 is a flow chart showing a character separation process employed in a third embodiment of the present invention; Figs. 7 to 10 are illustrations of the outline of a conventional character separation process; and Fig. 11 is an illustration of the principle of operation of the second embodiment of the invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS The invention will be described in more detail with reference to the drawings. Referring to Fig. 1, a character recognition apparatus embodying the present invention has a main unit 100 which includes: a CPU 1 for controlling the operation of the whole apparatus; a ROM 2 storing programs of operations which are to be performed by the CPU 1 and which are shown in the flowcharts of Figs. 2,5 and 6; a RAM 3 which serves as a work area for the CPU 1; an image reader 4 which reads the image of an original; and an image memory 5 which develops the read image. The apparatus also has a recognition unit 5 for recognizing pattern of image of a character which has been cut from the image data developed in the image memory 6, a dictionary unit 7 to which the recognition unit 6 refers during recognition processing, and an output unit through which the result of the recognition is output. The flow of a process performed by the character recognition apparatus will be described with reference to Fig. 2. An original image has been read by the image reader 4 and developed as a binary image in the image memory 5. In Step S1, the developed image is received from the image memory 5. In Step S2, configuration (contour) of the character is traced by a known method which is typically a method consisting of tracing of pixels in one-by-one fashion. Fig. 3 shows the configuration determined by tracing. The tracing is commenced at a point 101 and, after determining the configuration 103, terminates at the point 101. In this embodiment, it is not necessary to extract the inner contour 104 of the image. It will be seen that Fig. 4(A) shows the outer configuration of the characters alone. In Step S3, a rectangle 102 enveloping the image is determined on the basis of the configuration information obtained in Step S2. Step S4 determines the height-to-length ratio R of the envelope rectangle 102 and determines whether the ratio R is equal to or smaller than a predetermined threshold value R 0 , i.e., whether the image is horizontally elongated to such an extent as to suggest that the image is a composite image composed of two or more character images adjoining and connected to each other. Thus, R > R 0 suggests that the image represents a single character. When this condition is met, the process proceeds to Step S5 which delivers the image data to the recognition unit 6 without conducting character separation. Conversely, R ≦ R 0 suggests that the read image is a composite image composed of images of a plurality of characters adjoining each other. In this case, the process proceeds to Step S6 in which an operation is executed to determine the region within which the separation, i.e., cutting of the image into discrete character images, is to be conducted. Fig. 3 illustrates the method for determining the region in which the separation is to be done. In this Figure, axis X of the abscissa corresponds to the direction of the train of the characters. The X-coordinate value 0 coincides with the left end of the envelope rectangle. The X-coordinates X 1 and X 2 of the region 105 where the separation is to be conducted are determined so to meet the following conditions: X c = W/2 X 1 = X c - α X 2 = X c + α α = γ·h where W and h respectively represent the width (or length) and the height of the envelope rectangle, while γ is a predetermined constant. As will be seen from Fig. 4(A), the configuration 103 of the image is determined by two configuration lines: namely, an upper configuration line y 2 and a lower configuration line y 1 which are spaced from each other in the direction perpendicular to the character train. In Step S7, these configuration lines y 2 and y 1 (termed upper and lower ends in Fig. 3) are determined in terms of the X-coordinates, as two functions, y 2 (x) and y 1 (x). In Step S8, the difference S(x) between the upper and lower configuration lines is determined as follows along the X-axis: S(x) = y 2 (x) - y 1 (x) In Step S9, the value S(x) of the difference at each X-coordinate falling within the range 105 of separation (see Fig. 3) is compared with a predetermined threshold S 0 . The X-coordinate corresponding to any difference value S(x) which meets the condition of S(x) < S 0 is determined as the X-coordinate X c where the cutting or separation is to be performed. When a plurality of X-coordinate values meet the above-mentioned condition, the mean value of these X-coordinate is used as the X-coordinate X c at which the image is to be cut. Fig. 4(B) shows the histogram of the difference value S(x). The cutting or separation is not possible when there is no X-coordinate which meets the condition of S(x) < S 0 . In such a case, the process proceeds to Step S 10 which delivers the whole image in question to the recognition unit 6, or a suitable sub-routine is commenced to treat this image as an image which cannot be identified. When the X-coordinate X c at which the image is to be cut is determined, the process proceeds to Step S11 in which all the pixels on the X-coordinate X c are turned into the white state so as to cut the image into an image of a first character on the left of the X-coordinate X c and an image of a second character which is on the right of the X-coordinate X c . These discrete characters, obtained through the separation process as explained, are delivered one by one to the recognition unit 6 in Step S12. A second embodiment will be described with reference to a flow chart shown in Fig. 5. In this embodiment, the coordinates of the upper and lower ends, i.e., the upper and lower configuration lines, of the image are determined simultaneously in the course of determination of the configuration line. A sufficiently small value is set as the upper end coordinate y 2 (x) for all characters. Similarly, sufficiently large characters are set as the lower end coordinate y 1 (x) for all characters. The X coordinate x varies from 0 to 1, 1 to 2 and finally to W which corresponds to the width or length of the rectangle, i.e., the X-coordinate of the right end of the rectangle. In Step S22, the value y of the x,y coordinates of each pixel on the traced profile line of the character is compared with the above-mentioned coordinates y 2 (x) and y 1 (x) which have been stored. If the condition y > y 2 (x) is met, the coordinate value y 2 (x) is updated by being replaced by the value y. Similarly, the coordinate value y 1 (x) is updated by being replaced by y when the condition y < y 1 (x) is met. Consequently, all the values y 1 (x) and y 2 (x) for each X-coordinate x have been obtained when the trace of the configuration line is finished. This process will be explained in more detail with reference to Fig. 11. During tracing of the configuration 50 of a character image, more than 2 points, e.g., four points A 1 to A 4 as illustrated in Fig. 11, appear for a given X-coordinate. In this embodiment, the coordinates of the points A 1 and A 4 are regarded as being the coordinates of the upper and lower ends, whereby a pattern 51 as shown in Fig. 11 is obtained. To this end, as explained before, the value y of the coordinates x, y of each of the pixels successively detected on the configuration line during the tracing is compared with any upper end coordinate y 2 (x) which has been previously obtained on the same X-coordinate x and, when the condition y > y 2 (x) is met, the value of the upper end coordinate y 2 (x) is replaced by the value y. Consequently, the value y of the coordinates of the point A 1 is adopted as the upper end coordinate y 2 (x) for the above-mentioned X-coordinate x. The lower end coordinate y 1 (x) also is determined by the same principle as described above. In the second embodiment, steps S23 onwards are the same as those in the first embodiment, so that description of these steps is omitted. In a third embodiment of the invention, the position where the composite image is to be cut is determined by varying the threshold value S 0 of the difference value S(x). The third embodiment employs a process which is shown by a flow chart in Fig. 6. More specifically, this flowchart shows only steps corresponding to Steps S9 to S12 in the first embodiment shown in Fig. 2. Other portions of the process are not described because they are materially identical to those of the first embodiment. In the first embodiment described above, a simple sign indicative of impossibility of character separation is given when there is no X-coordinate which meets the condition S(x) ≦ S 0 . In contrast, in the third embodiment, the separating operation is conducted repeatedly after varying the threshold value S 0 and the width X c ± α of the region where the image is to be cut. In Step S 41, the control variable i is set to 1. In Step S 42, the threshold value S 0 and the threshold factor α are respectively set to S i and α i . In the illustrated embodiment, the control variable i is changed as i = 1, 2 and 3 and a plurality of combinations of thresholds (S 1 , α 1 ), (S 2 , α 2 ) and (S 3 , α 3 ) are determined in advance of the processing, under the conditions S 1 < S 2 < S 3 and α 1 > α 2 > α 3 . In Step S43, a search is made for any X-coordinate x which falls within the range between X 1 and X 2 determined as below and which satisfies the condition of S(x) ≦ S i . Such X-coordinate x, if any, is used as the X-coordinate X c where the image is to be cut. The process then proceeds to Step S44 in which the image is cut into two portions which are each images of two discrete characters. The separated character images are then subjected to recognition operation, executed in Step S45. If there is no X-coordinate meeting the above-mentioned conditions, the process proceeds to Step S46 in which the variable i is incremented by one for each of the thresholds S 0 and α. In Step S47, the value of the variable i is examined. When the value is greater than 3 (i > 3), the process proceeds to Step S48, in which the image in question is delivered to the recognition unit 6 without being cut. However, when the value of the variable i is not greater than 3 (i ≦ 3), the process returns to Step S42 to repeat the described operation. In the third embodiment, therefore, a search is made first over a wider region for a bond between two character images and, when no such bond is found, the search is conducted again over narrower region. When such a bond is detected in the narrowed region of the search, character separation is conducted at the position of such a bond even when the bond is rather strong. In the first to third embodiments described hereinbefore, characters in an original text read by an image reader 4 are recognized and the results of the recognition are output to a suitable external device. Such a way of use of the recognition result is only illustrative. That is, the results of recognition may be sent to a display device for displaying the recognized characters or to a device which can process the words composed of the recognized characters. It will also be clear that the invention can be applied as well to the case where the characters are arrayed in vertical trains, although recognition of characters forming horizontal trains has been specifically described. The apparatus of the invention, when applied to vertical trains of characters, is designed to determine the position of separation on the basis of distributions of the greatest and smallest coordinate values X along an axis Y which is parallel to the direction of the vertical trains of the characters. Again, it will be understood that the invention is not limited to use with black characters on a white ground, but is applicable to any digitized input character data distinguishable in color or gradation from the background. As will be understood from the foregoing description, according to the present invention, the determination of the position where an unidentified image is to be cut is conducted on the basis of the distribution of the distances between the upper and lower ends of the configuration line, in contrast to the conventional technique which simply relies upon the frequency of appearance of black pixels. It is, therefore, possible to exclude any black pixel or pixels which are not connected to the continuous traced configuration line and which are generated as a result of, for example, presence of a stain on the original or erroneous reading of an adjacent line. Thus, the present invention greatly enhances the credibility and reliability of separation of character images, by virtue of elimination of noises caused by presence of a stain on the original or erroneous reading of an adjacent line and, hence, remarkably improves the ability to recognize and identify read characters.

Claims: An image separation apparatus for separating characters adjoining each other, comprising: detecting means (CPU1, 5) for detecting coordinate information concerning the upper contour (y 2 ) and the lower contour (y 1 ) of a character image of interest in image information input from an original; characterised in that said apparatus further comprises: distance computing means for computing, on the basis of the coordinate information obtained by said detecting means: distance information (s(x)) relating to the distance between each point on the upper contour (y 2 ) and a corresponding point on the lower contour (y 1 ) as measured in a direction perpendicular to the train of characters represented by the image information; comparison means for comparing the distance information (s(x)) with a predetermined threshold value (s0); and separation position determining means for determining on the basis of the results of said comparison a position (X c ) where the character image of interest is to be cut into separate character images. Apparatus according to claim 1, further comprising means for determining, on the basis of the height-to-length ratio of an envelope rectangle (102) around the character image of interest, whether the character image of interest is to be cut into separate character images, said distance computing means being activated only when said determining means has determined that the character image of interest is to be cut into separate images. Apparatus according to claim 1, further comprising region computing means for computing, on the basis of the height-to-length ratio of an envelope rectangle around the character image of interest, a region (x 1 -x 2 ) in which the cutting of the image of interest into separate images is to be conducted, said separation position determining means determining the position within the region computed by said region computing means. Apparatus according to claim 1, wherein said separation position determining means determines, as the position where the image of interest is to be cut, a position where the distance information (s(x)) as computed by said distance computing means is equal to or smaller than said predetermined threshold value. Apparatus according to claim 4, wherein, when no distance information computed by said distance computing means is equal to or below the predetermined threshold value, said separation position determining means again conducts the position determining operation after varying the predetermined threshold value. Apparatus according to any one of the preceding claims, wherein said apparatus further comprises an image reader for inputting an image of said original as the image information. An image separation method for separating characters adjoining each other, comprising the steps of: detecting (s2) coordinate information concerning the upper contour (y 2 ) and the lower contour (y 1 ) of a character image of interest in image information input from an original; characterised by computing (s8) the distance (s(x)) between each point on the upper contour (y 2 ) and a corresponding point on the lower contour (y 1 ) as measured in a direction perpendicular to the train of characters represented by the image information; comparing (s9) the computed distances (s(x)) with a predetermined threshold value (s0); and determining on the basis of the results of said comparison a position (x c ) where the character image of interest is to be cut into separate character images. A method according to claim 7, further comprising the step of computing (s6), on the basis of the height-to-length ratio of an envelope rectangle (102) around the character image of interest, a region (x 1 -x 2 ) in which the cutting of the character image of interest into separate images is to be conducted, wherein said step of determining the position where the image is to be cut is conducted to determine the position within the region computed in said region computing step (s6). A method according to claim 7 or 8, wherein the position where the image of interest is to be cut is determined as a position where the distance as computed in the step of computing distances is equal to or smaller than said predetermined threshold value (s0). A method according to any one of claims 7 to 9, wherein when no distance computed in said step of computing distances is equal to or below the threshold value, said step for detecting the position where the image of interest is to be cut is conducted again after the threshold value has been varied. A method according to any one of claims 7 to 10, wherein the character image is a binary image.

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