Image processing apparatus and method

Abstract: In an image processing apparatus and method, such a problem that the user must wait for a long time until region separation processing is completed is solved. A binary-coding unit performs binary coding of a luminance component of input color-image data. An encoding unit performs arithmetic encoding of the binary image data, and another encoding unit performs block encoding of the color-image data, and codes obtained from the two encoding units are stored in different storage units. A predetermined pair of codes read from the storage unit are decoded by decoding units. A region discrimination unit discriminates image regions of decoded binary image data, and outputs data of charcter-line-drawing regions. A color-gradation-image extraction unit extracts data of color-gradation-image regions from decoded color-image data.

Description: This invention relates to an image processing apparatus and method, and more particularly, to an image processing apparatus and method for encoding color-image data in order to record it on a recording medium. Recently, it has become easy to store high-definition color-image data due to increases in the capacity of storage devices International standardization of encoding methods for various kinds of images has also progressed. So-called JBIG (Joint Bi-level Image Experts Group) method and JPEG (Joint Photographic Experts Group) method are encoding methods which have recently been standardized in the ISO (International Organization for Standardization). The JBIG method is an encoding method in which information of binary image data is perfectly preserved using a method called a dynamic arithmetic encoding method. Hence, image compression can be performed without degrading characters, line drawings and the like. However, this method is not suitable for compression of data of a gradation image, such as a color natural image or the like because this is a method for binary image data. On the other hand, the JPEG method is an irreversible encoding method for a color natural image. Hence, although degradation is less pronounced even if data of a gradation image, such as a photograph or the like, is encoded with a high compression ratio, peculiar degradation called mosquito noise occurs around characters and fine lines when encoding data thereof. That is, the standardization of JBIG and JPEG has been done assuming that data of a document is encoded according to the JBIG method, and data of a color natural image is encoded according to the JPEG method. There exists a color image called a color document which includes a color photograph and characters. The assignee of the present application has proposed, in U.S. patent application Serial No. 357,380 (filed December 16, 1994), a method as shown in FIG. 9 as a method for encoding data of such a color document. In this proposal, character-image regions and color-gradation-image regions of a color document, whose data is to be encoded, are separated from each other. A color image in the character-image region is subjected to JBIG encoding by being converted into binary values comprising black and white, and the color-gradation-image region is subjected to JPEG encoding. A second method for encoding data of a color document may be considered in which data of a character image is stored by being converted into character codes using an OCR (optical character recognition) technique. The above-described conventional approaches, however, have the following problem, namely the processing time which is required for separating regions of a color document. When storing data of a color document in a storage device by encoding it for each region, the user must wait for a long time until the processing is terminated. In the method using the OCR technique, processing for recognizing characters is needed, thereby further increasing the processing time. The present invention has been made in consideration of the above-described problems. Japanese Patent Abstract No JP-A-4326668 discloses a colour picture processing method in which input image data is quantized, the quantized image data stored in memory and an image region is discriminated using the quantized image data. An embodiment of the present invention provides an image processing apparatus in which regions are separated at a high speed and such a problem that the user must wait for a long time until region separation processing requiring a relatively long time is terminated is solved. According to one aspect, the present invention provides an image processing apparatus as set out in claim 1. According to a second aspect, the present invention relates to an image processing method as set out in claim 10. Advantages and features of the present invention will become more apparent from the following detailed description of the preferred embodiments taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram illustrating the configuration of an image processing apparatus according to a first embodiment of the present invention; FIGS. 2(a) and 2(b) are diagrams illustrating character image extraction processing in the first embodiment; FIGS. 3(a) and 3(b) are diagrams illustrating an example of discrimation of character-image portions in the first embodiment; FIG. 4 is a diagram illustrating a format of information relating to image regions discrimated in the first embodiment; FIG. 5 is a diagram illustrating a second embodiment of the present invention in which the present invention is applied to a general-purpose computer, such as a personal computer, a work station or the like; FIGS. 6 and 7 are flowcharts illustrating image processing procesures in the second embodiment. FIG. 8 is a diagram illustrating a modification of the embodiments in which a character image region is encoded as an image; FIG. 9 is a diagram illustrating a method of encoding a color document; and FIG. 10 is a diagram illustrating a modification of the embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will now be described in detail with reference to the drawings. First Embodiment FIG. 1 is a block diagram illustrating the configuration of an image processing apparatusa according to a first embodiment of the present invention. In FIG. 1, an image reading unit 1 reads an image of an original, and outputs, for example, a 24-bit RGB full-color image data. In the present embodiment, a 400-dpi (dots per inch) image scanner generating data comprising 8 bits for each of R, G and B signals is used. A color-space conversion unit 2 converts the RGB image data input from the image reading unit 1 into luminance data or lightness data and color data (for example, image data comprising 8 bits for each of Y, Cb and Cr signals. This conversion is performed according to the following expressions: Y = 0.299R + 0.587G + 0.114B Cb = 0.564(B - Y) + 128 Cr = 0.713(R - Y) + 128. A binary-coding unit 3 receives a Y (luminance) component from among the YCbCr image data output from the color-space conversion unit 2, and outputs binary image data obtained by performing simple binary coding of the received value with a predetermined threshold. A binary encoding unit 4 performs binary encoding of binary image data input from the binary-coding unit 3 according to the JBIG encoding method, and the obtained image data is stored in a storage unit 5. Any method may also be used as the encoding method of the binary encoding unit 4 provided that an entropy encoding method using arithmetic encoding, such as the JBIG encoding method or the like, is adopted. A multivalue encoding unit 8 receives the YCbCr image data output from the color-space conversion unit 2, and encodes the data according to a multivalue block encoding method using, for example, 8 x 8 DCT (discrete cosign transform) (orthogonal transformation), such as the JPEG encoding method or the like. The encoded image data is stored in a storage unit 9. As described above, in the present embodiment, a color image is represented by code data obtained by two kinds of encoding methods, i.e., code data obtained by performing arithmetic encoding of binary-coded data of a luminance component, and code data obtained by performing block-encoding of color-image data. The two kinds of code data are stored in the storage units 5 and 9, and are controlled as image data of the image. This encoding processing is a series of sequential processing in which an image is processed from above to below. Hence, it is also possible to consecutively process a plurality of images, and to store code data for each of the images in the storage units 5 and 9. Although in the foregoing description, the storage unit 5 for storing code data of binary-image data and the storage unit 9 for storing code data of color-image data are separately provided, the two storage units may be combined into a single storage unit. For example, a predetermined region of a storage unit, such as a RAM, a hard disk or the like, may be used as the storage unit 5, and another predetermined region may be used as the storage unit 9. The capacity of the storage units 5 and 9 equals at least a capacity capable of storing code data of a color image. Data of a desired image from among one or a plurality of images stored in the storage units 5 and 9 is converted into character data and color-gradation-image data according to the following processing. A decoding unit 6 decodes the code data subjected to arithmetic encoding read from the storage unit 5 and outputs binary image data. This decoding processing is, of course, processing which is inverse to the processing of the binary encoding unit 4. A region discrimination unit 7 executes character-image extraction processing as shown in FIGS. 2(a) and 2(b) for the binary image data input from the decoding unit 6. FIG. 2(a) illustrates a decoded binary image. In FIG. 2(a), reference numeral 101 represents a character-image region, and reference numeral 102 represents a color-gradation-image region. These two regions can be separated because they have different properties. That is, the character-image region has the following characteristics: (1) The area of each group comprising connected pixels is small. (2) The groups of pixels are arranged in a horizontal direction (in the case of a horizontally-written document) or in a vertical direction (in the case of a vertically-written document). (3) The area of black pixels is smaller than the area of white pixels. FIGS. 3(a) and 3(b) illustrate an example of discrimination of a character-image portion utilizing the above-described characteristics. FIG. 3(a) illustrates a case of an image of horizontallly-written characters (in this example, " ···"), in which processing of interpolating a space between pixels constituting each character is performed. For example, when processing of replacing white pixels by black pixels if a space between black pixels is equal to or less than n pixels (n being a small number) is performed, an image, in which groups of black pixels including respective characters are aligned in a horizontal direction, is obtained, as shown in FIG. 3(b). A region 103 can be discriminated as a character-image region due to the aligned groups of black pixels. A character region can be cut as a rectangular region by performing such processing. As shown in FIG. 2(b), the character-image region 101 shown in FIG. 2(a) can be discriminated as rectangular regions 101a, 101b and 101c. Furthermore, by taking into consideration the size of each group of black pixels, in the case of FIG. 2(b), it is possible to recognize a region 101a as a caption-character region, and to recognize regions 101b and 101c as sentence regions. On the other hand, the color-gradation-image region subjected to binary-coding processing has the following characteristics. (1) The area of each group comprising connected pixels is large. (2) The number of fine lines is small. (3) There is little difference between the area of white pixels and the area of black pixels. In the case of FIG. 2(a), the area of each group of black pixels in the color-gradation-image region 102 subjected to binary-coding processing is large. For example, an image of a mountain, a cloud or the like can be easily discriminated because the area of connected black pixels or white pixels is large. Such a portion can be recognized as a rectangular region as represented by reference numeral 102a in FIG. 2(b). As described above, the region discrimination unit 7 discriminates between character-image regions and color-gradation-image regions from image data obtained by performing binary-coding processing of data of a color image, and transmits the attribute of each discriminated rectangular region, the address of the upper left portion of the region, and the size of the region in the x direction and the y direction to a color-gradation-image extraction unit 11 (to be described later in detail) as data having a format as shown in FIG. 4. On the other hand, binary-image data discriminated to be in the character-image regions is sectioned for each rectangular region and is transmitted to a character recognition unit 12 (to be described later in detail). Referring again to FIG. 1, a decoding unit 10 decodes data subjected to block encoding read from the storage unit 9, and outputs color-image data. This decoding processing is, of course, processing which is inverse to the processing of the multivalue encoding unit 8. A color-gradation-image extraction unit 11 extracts data of color-gradation-image regions from the decoded color-image data by referring to the result of the discrimination by the region discrimination unit 7, and stores the extracted color-gradation-image data in a storage unit 13 together with the color-gradation-image-region information shown in FIG. 4. The color-gradation-image data output from the color-gradation-image extraction unit 11 may also be stored in the storage unit 13 by being compressed again by performing block-encoding processing or the like. In such color-gradation-image extraction processing, it is not always necessary to decode code data into original-image data. It is also possible to extract data of color-gradation-image regions by sectioning the result of discrimination of the region discrimination unit 7 into rectangles, for example, in units of 8 x 8 pixels (in units of the block size of block codes) utilizing a property of block codes. A character recognition unit 12 recognizes each character from binary image data input by being sectioned into each rectangular region, and converts the recognized character into a code corresponding thereto. The converted character code is stored in the storage unit 13 together with the character-image-region information shown in FIG. 4 and information indicating the position of the character within the corresponding rectanguler region, as well as attribute information indicating the size and the kind of the character, and the like whenever necessary. It is also possible to store character codes output from the character recognition unit 12 in the storage unit 13 by being compressed, for example, according to Huffman encoding, LZ encoding or the like. As described above, in the present embodiment, a color image is represented by two kinds of data, i.e., color-gradation-image data, and character codes coresponding to characters within character-image regions. These two kinds of data are stored in the storage unit 13, and are controlled as data of an image. As described above, these two kinds of data include region information and the like. If, for example, a large-capacity magnetic storage device (a hard-disk device, a magnetooptical-disk device or the like) is used as the storage unit 13, data of a large number of color images, such as color documents or the like, can be stored. According to the present embodiment, the following functions can be obtained. (1) Data of the entire input color image is stored in a storage unit by encoding the data in the form of a binary image data of a luminance component and in the form of color-image data. Hence, for example, the user can arrange such that region separation processing and character recognition processing requiring a relatively long processing time are executed while the user performs an operation using another apparatus or takes a rest, thereby preventing the problem of waiting for a long time until the processing is completed. (2) Since a color image is represented by character codes and color-gradation-image data and the obtained data are separately stored, a character image portion is replaced by character codes, which can be easily reedited using wordprocessor software or the like. (3) Since a color-gradation-image data obtained by removing character-image data from color-image data is encoded, the compression efficiency can be improved. (4) Since regions are separated based on the result of discrimination of regions in the form of binary-image data, the discrimination processing can be performed at a high speed. Second Embodiment A description will now be provided of an image processing apparatus according to a second embodiment of the present invention. In the second embodiment, components which are substantially the same as those in the first embodiment are indicated by the same reference numerals, and a description thereof will be omitted. FIG. 5 is a diagram illustrating the case of the second embodiment in which the present invention is applied to a general-purpose computer, such as a personal computer, a work station or the like. In FIG. 5, a scanner 20 reads a full-color image. Reference numeral 30 represents a general-purpose computer. Reference numeral 40 represents a magnetic storage device, such as a hard-disk device, a magnetooptical-disk device or the like. The computer 30 does not require particular hardware. FIGS. 6 and 7 are flowcharts illustrating image processing procedures in the second embodiment, which are executed according to software operating in the computer 30. Such software is stored in the magnetic storage device or the like incorporated in the computer 30. In FIG. 6, in step S1, the computer 30 reads a color image using the scanner 20. In step S2, the color space of the read full-color image data is converted from an RGB color space into a YCbCr color space. In step S3, block encoding, according to the JPEG encoding method or the like, is sequentially peformed for the YCbCr data, and the resultant data is stored in the magnetic storage device 40. In step S4, Y data representing a luminance component is sequentially subjected to binary coding, and the resultant data is stored in the magnetic storage device 40. In step S5, it is determined if processing for image data of the one image has been completed. The processing from step S2 to step S4 is repeated until the processing for the image data is completed. Upon completion of processing of data of the one image, in step S6, binary image data is read from the magnetic storage device 40, and is subjected to arithmetic encoding according to the JBIG encoding method or the like. In step S7, it is determined if processing for binary image data of the one image has been completed. The processing of step S6 is repeated until the processing for the image data is completed. Upon completion of processing of binary image data for the one image, in step S8, it is determined if all images have been read. The processing from step S1 to step S7 is repeated until all image are read. According to the above-described processing, a color image is represented by two code data, i.e., code data obtained by performing arithmetic encoding of binary-coded luminance-component data, and code data obtained by performing block encoding of color-image data. The computer 30 stores these two kinds of code data in the magnetic storage device 40 as image data of the one image and controls the stored data. By consecutively performing the above-described processing, it is possible to store image data of a plurality of color images in the magnetic storage device 40 in a short time, and to execute the following processing shown in FIG. 7 while the user performs an operation using another apparatus or takes a rest. In FIG. 7, in step S11, the computer 30 decodes data subjected to arithmetic encoding stored in the magnetic storage device 40 to restore a binary image. In step S12, image regions in the restored binary image are discriminated to separate character-image regions and color-gradation-image regions from each other. In step S13, characters in the character-image regions separated in step S13 are recognized and encoded. In step S14, data subjected to block encoding stored in the magnetic storage device 40 is decoded to restore color-image data. In step S15, color-gradation-image regions are extracted from the restored color-image data based on the result of the discrimination of image regions. In step S16, color-gradation-image data extracted in step S15 is again subjected to block encoding. In step S17, codes of characters in the character-image regions and the encoded color-gradation-image data are stored in the magnetic storage device 40. As described in the first embodiment, these two kinds of data include region information and the like. In step S18, it is determined if processing of all image has been completed. The processing from step S11 to step S18 is repeated until processing of all image is completed. As described above, according to the second embodiment, the same functions as in the first embodiment can be obtained. Furthermore, by separating data of a color image into character codes and color-gradation-image data and storing the separated data in a magnetic storage device, for example, it is possible to retrieve a string of specific characters using character codes, or to separately utilize character codes or color-gradation-image data. In addition, since only color gradation image can be displayed, image retrieval can be performed at a high speed. Modifications Although in the above-described embodiments, characters in character-imager regions are recognized and encoded, the characters may also be encoded as images and stored in the storage unit. That is, as shown in FIG. 8, a color-gradation-image region 102a is subjected to JPEG encoding, and binary image data in remaining regions after replacing the region 102a with white pixels, i.e., character-image regions, is subjected to JBIG encoding. Such an approach is effective, for example, when the recognition rate of characters is low, for example, due to inferior quality of the read image, or when the read image cannot be encoded into character codes because the image includes line drawings comprising graphs, tables or the like. Furthermore, it is also possible to determine whether each character-image region is to be encoded into character codes or subjected to JBIG encoding. Hence, an image can be more effectively separated into regions such that a region having a small character size and therefore a low character recognition rate is subjected to JBIG encoding, and a region having a sufficiently large character size and therefore a high character recognition rate is encoded into character codes, and the obtained data can be stored. As shown in FIG. 10, a system may be provided in which data of an image subjected to color image reading is stored as data of a black-and-white image. In FIG. 10, a luminance conversion unit 102 converts RGB data into luminance data Y, and supplies the data to a binary-coding unit 3 and a halftone-processing unit 103. The binary-coding unit 3 performs binary-coding processing with a single threshold which can easily extract data of a character/line drawing image. The halftone-processing unit 103 performs binary-coding processing which is suitable for a halftone image, such as a dither method, an error diffusion method, an average-density preservation method, or the like. Components from an encoding unit 4 to a region discrimination unit 7 and a character recognition unit 12 are the same as those in the first embodiment. An encoding unit 104 performs encoding according to a lossless encoding method, such as the JBIG method or the like. A storage unit 9 stores code data from the encoding unit 104 for a time period necessary for recognition by the region recognition unit 7 and for recognition by the character recognition unit 12. Character codes output from the character recognition unit 12 and code data from the storage unit 9 are stored in a storage unit 13 so as to correspond to each other. According to the modification shown in FIG. 10, since information relating to characters which have not been recognized as characters due to errors in the character recognition unit 12 remains in the form of information from the halftone-processing unit 103, missing in characters can be prevented when reproducing information stored in the storage unit 13. In the above-described modification, the encoding unit 4 and the decoding unit 6 are not always necessary. Instead of using these units, uncompressed image data may be stored in the storage unit 5. Although in the foregoing embodiments, a description has been provided of a case in which image data in an RGB color space is converted into image data in a YCbCr color space, the color space into which the image data is converted is not limited to the above-described color space. For example, the image data may be converted into a color space including a luminance component, such as a YIQ color space, an L*u*v* color space, an L*a*b* color space or the like. Furthermore, image data of a color space including a luminance component may be directly input to an output terminal of the color-space conversion unit 2. A character-image region is not always expressed in binary values, but may, for example, be expressed in three values or four values provided that the number of values is less than the number of bits. Character data is not always encoded by the JBIG method, but any other entropy encoding method, such as MH (modified Huffman), MR (modified read), MMR (modified modified read) or the like, may also be used. Image data is not always encoded by the JPEG method, but any other block encoding method, such as vector quatization or the like, may also be used. The present invention may be applied to a system comprising a plurality of apparatuses, such as a scanner, a host computer, a magnetooptical-disk device and the like, or to an apparatus comprising a single unit, such as a copier or the like. The present invention may, of course, be applied to a case in which the object of the invention is achieved by supplying a system or an apparatus with programs stored in a storage medium, such as a floppy disk or the like. As described above, according to the present invention, the speed of region separation is increased, and the problem that the user must wait for a long time until region separation processing and the like requiring a relatively long time are completed is solved. The individual components designated by blocks in the drawings are all well known in the image processing apparatus and method arts and their specific construction and operation are not critical to the operation or the best mode for carrying out the invention.

Claims: An image processing apparatus comprising: means (1, 4) for the input of image data ; quantizing means (3) for quantizing the input image data and outputting quantized image data; first encoding means (4) for encoding the quantized image data output from said quantizing means and generating encoded data; and storage means (5) for storing the encoded data; and decoding means (6) for decoding the encoded data stored in the storage means; characterized by discriminating means (7) for discriminating a character region from the quantized image data decoded by said decoding means, and character recognition means (12) for performing character recognition on the or each discriminated character region. Apparatus according to claim 1 and including second encoding means (8) for encoding the input image data in parallel with the first encoding means (4) and in a different manner; means (9) for storing the image data encoded by said second encoding means; and second decoding means (10) for decoding the contents of said second storage means, and means (13) for storing either the output of the character recognition means or the output of said second decoding means in accordance with the output of said discriminating means. Apparatus according to claim 2, wherein the second encoding means (8) is adapted to encode the input image data at the same time as the first encoding means encode the quantized data. Apparatus according to claim 2 or claim 3, wherein the quantizing means is adapted to binarise the input image data. Apparatus according to claim 4, wherein said discriminating means extracts character/line-drawing regions from the binarised image data decoded by the first mentioned decoding means. Apparatus according to any one of the preceding claims wherein the image to be processed is a colour image and the first encoding means operates on the luminance component of the image data generated from the colour image. Apparatus according to any one of the preceding claims, wherein said first storage means (5) is adapted to store first encoded data corresponding to at least one picture. Apparatus according to any one of the preceding claims, wherein said first encoding means (4) encodes said image data by using an entropy encoding method. An image processing apparatus according to claim 2 or any one of claims 3 to 8 when dependent on claim 2, wherein said second encoding means (8) encodes said input image data by using DCT conversion. An image processing method comprising the steps of: quantizing input image data and outputting quantized image data; a first step of encoding the quantized image data output in said quantizing step and generating encoded data; and storing the encoded data in storage means; decoding the encoded data stored in the storage means; characterized by discriminating a character region from the quantized image data decoded in said decoding step, and performing character recognition on the discriminated character region. A method according to claim 10, including a second step of encoding the input image data in parallel with the first encoding step using a different encoding system, storing the image data encoded in the second step; decoding the stored image data which was encoded in the second encoding step using second encoding means and selecting between the discriminated character region and the output of the second decoding means in accordance with the output of the discriminating step. A method according to claim 11, wherein the first and second encoding steps take place simultaneously. A method according to claim 11 or claim 12, wherein the first encoding of the image data generates binary data, and the second encoding step uses DCT conversion. A method according to any one of claims 11 to 13, in which the image being processed is a colour image wherein the first encoding of the image data comprises encoding the luminance component of the image data generated from the colour image.

Inventors: YOSHIDA TADASHI, YOSHIDA, TADASHI, YOSHIDA, TADASHI, C/O CANON K.K.
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1995
Main classification: H04N1
IPC codes: H04N1, G06T9, H03M7, G06K9