Device for judging type of color of document

Abstract: A device for judging the type of color of a document judges in real time on the basis of read data whether or not a document is a color document or a black-and-white document. It is judged whether or not each pixel is a color pixel on the basis of the read data. When not less than a predetermined number of color pixels are continuously detected, the presence of a color block is detected. When there are not less than a predetermined number of color blocks in one line or there is a relatively long color block having not less than a constant length in one line, it is judged that the line is a color line. When not less than a predetermined number of color lines, for example, 100 color lines are detected, it is judged that the document is a color document.

Description: The invention relates to a device for judging the type of color of a document for judging whether a document is a color document containing chromatic color information or a black-and-white document containing only achromatic color information on the basis of pixel data read from the document, comprising: color pixel detecting means, to which the pixel data read are sequentially applied for each pixel, for judging whether or not the pixel is a color pixel having a chromatic color on the basis of pixel data applied, to output a detection signal when it is judged that the pixel is a color pixel; color block detecting means for detecting the presence of a color block on the basis of the fact that the color pixel detecting means continuously output detection signals whose number is not less than a predetermined number for forming a color block; and color document detecting means for outputting a color document detection signal on the basis of the fact that the color block detecting means detect the presence of color blocks whose number is not less than a predetermined number of color blocks for judging a color document, wherein the pixel data applied to the color pixel detecting means include three types of color data, that is, yellow data, magenta data and cyan data. Description of the Prior Art Some digital color copying machines being commercially available have a mechanism for judging the type of color of a document for prescanning the document to read its image data and automatically judging from the image data read whether the document is a black-and-white document containing only achromatic color information or a color document containing chromatic color information. In the mechanism for judging the type of color of a document in such a digital color copying machine being commercially available, the image data read is stored once in an image memory, the composition ratio of yellow (hereinafter referred to as "Y"), magenta (hereinafter referred to as "M") and cyan (hereinafter referred to as "C") colors constituting the data stored is investigated for each pixel, and the type of color of the document is judged on the basis of the results of the investigation. When it is judged that the document is a black-and-white document containing only achromatic color information, copies are made using black (hereinafter referred to as "Bk") toner particles. On the other hand, when it is judged that the document is a color document containing chromatic color information, color copies are made using toner particles in three colors, that is, Y, M and C colors or toner particles in four colors, that is, Y, M, C and Bk colors. The above described mechanism for judging the type of color of a document has the disadvantages in that a high-cost image memory is an indispensable constituent element because the image data read must be stored once in the image memory so as to judge the type of color of the document, and the type of color of the document cannot be judged in real time on the basis of the image data read because the image data is stored once in the image memory. A device for judging the type of color of a document according to the preamble of patent claim 1 is known from the publication EP-A-0411918. The conventional device comprises a color image processing apparatus provided with a detector for detecting end portions of a non-rectangular original, a determination unit for determining, based on the output of the detector, whether the non-rectangular original is a color image or a black-and-white image, and a processor for processing the image of the original in accordance with the result of determination by the determination unit. While the document describing the conventional device for judging the type of color of a document discloses color pixel detecting means, color block detecting means and color document detecting means, it is silent as to any difference calculating means, threshold value setting means and comparing means provided in the color pixel detecting means. The publication JP-A-63-098671 discloses a digital color copying machine wherein the image data read are put into a matrix form, the black-and-white picture elements in this matrix are counted in order to determine which picture elements of the matrix are black-and-white and which are color picture elements, wherein the result thereof is stored in a picture element map memory. Hence, the necessity arises that a corresponding image memory is provided resulting in the same situation which was discussed above. The object underlying the present invention is to provide a device for judging the type of color of a document of the type specified above, which device is capable of judging the type of color of a document in real time without using any image memory and on the basis of document data read. According to the invention, the device for judging the type of color of a document of the type specified above is characterized by the features in the characterizing part of patent claim 1. Further developments of the device according to the invention have been specified in the claims 2 to 6. Thus, the present invention provides a device for judging the type of color of a document for judging whether a document is a color document containing chromatic color information or a black-and-white document containing only achromatic color information on the basis of document data read. The document data read are sequentially applied to a color pixel detecting portion for each pixel. In the color pixel detecting portion, it is judged whether a pixel is a color pixel having a chromatic color on the basis of pixel data applied, to output a detection signal when the pixel is a color pixel. The presence of a color block is detected on the basis of the fact that the color pixel detecting portion continuously outputs not less than a predetermined number of (for example, four) detection signals. When the presence of not less than a predetermined number of (for example, 100) color blocks is detected in one line, it is judged that the line is a color line. Furthermore, when there are not less than a predetermined number of (for example, 100) color lines, it is judged that the document is a color document, to output a color document detection signal. The above described respective reference numbers for detection can be freely determined. According to the present invention, the document data applied need not be stored once in an image memory, and the document data applied is directly processed, thereby to make it possible to judge in real time whether the document is a color document or a black-and-white document. More specifically, it is possible to rapidly judge the type of color of the document in a simple circuit structure using no image memory. Additionally, the reference numbers required for judging a color pixel, a color block, a color line and the like can be respectively set to arbitrary numbers. Accordingly, the boundary line as to what document is judged to be a color document and what document is judged to be a black-and-white document can be freely set and changed. For example, the boundary line can be freely set as to whether a black-and-white document containing chromatic color data in its part or a black-and-white document on which "strict secrecy" is written in cinnabar is judged to be a color document or a black-and-white document, thereby to make it possible to judge the type of color of a document for various applications. The foregoing and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a diagram for explaining the outline of processing in one embodiment of the present invention; Fig. 2 is a diagram for explaining the method of detecting a color pixel; Fig. 3 is a conceptual diagram showing the relationship among a document, a line CCD, a clock CLK, a reversed Hsync signal indicating an effective period on one line of main scanning, and a reversed Vsync signal indicating an effective period in the direction of subscanning in one embodiment of the present invention; Fig. 4 is an illustration for explaining the method of judging a color block; Fig. 5 is an illustration for explaining the method of judging a color line; Fig. 6 is a block diagram showing the entire construction of hardware according to one embodiment of the present invention; Fig. 7 is a block diagram showing an example of the detailed construction of an absolute value-of-difference calculating circuit; Fig. 8 is a block diagram showing another example of the detailed construction of the absolute value-of-difference calculating circuit; Fig. 9 is a block diagram showing an example of the detailed construction of a color block detecting portion according to one embodiment of the present invention; and Fig. 10 is a block diagram showing an example of the construction of a color line detecting portion and a final output portion according to one embodiment of the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS A device for judging the type of color of a document which can be applied to a digital color copying machine will be described in detail by way of example. Fig. 1 is a diagram showing the outline of processing in a device for judging the type of color of a document according to one embodiment of the present invention. In the present embodiment, document data read are sequentially applied for each pixel, and it is judged whether the pixel is a color pixel or a black-and-white pixel on the basis of data applied for each pixel, that is, pixel data. The judgement whether the pixel is a color pixel or a black-and-white pixel is made by adopting an approach of calculating the absolute values of the differences between a yellow (Y) signal, a magenta (M) signal and a cyan (C) signal constituting the pixel data, as shown in Fig. 2, to consider the pixel as a black-and-white pixel when the values of the respective color signals are almost the same on the basis of the absolute values, that is, when | Y - M | = | M - C | = | C - Y | = 0, while considering the pixel as a color pixel when any one of the color signals differs in magnitude from the other color signals. The details of this approach will be described later. An approach is adopted of detecting the presence of a color block as shown in Fig. 1 when color pixels whose number is not less than its reference number are continuously detected, judging when color blocks whose number is not less than its reference number are detected in one line that the line is a color line, and further judging that a document is a color document when color lines whose number is not less than its reference number are detected. More conceptually, an approach is adopted of judging whether each pixel is a color pixel or a black-and-white pixel, and judging that a document is a color document when the frequency of occurrence and the number of times of occurrence of the pixel judged to be the color pixel are larger than some extent. Fig. 3 is a conceptual diagram for explaining a clock (CLK) in a case where a document is read by a line CCD, for example, provided in a digital color copying machine, the level of a signal indicating an effective period on one line of main scanning (a reversed Hsync signal), and the level of a signal indicating an effective period in the direction of subscanning (a reversed Vsync signal). The document is read for each line by self-scanning of the line CCD in the direction of main scanning, and the relative positional relationship between the line CCD and the document is sequentially displaced in the direction of subscanning so that the document is sequentially read for each line from its upper end side to its lower end side. In Fig. 3, a region where the reversed Hsync signal and the reversed Vsync signal are both at a high level is an effective reading region of the document read by the line CCD. The type of color of the document is judged on the basis of read data read in this effective reading region whose size is smaller than the actual size of the document. The reason why the size of the effective reading region of the document is thus made smaller than the actual size of the document is that the number of times of erroneous judgement can be reduced if the type of color of the document is judged on the basis of the main part of the document. If the periods during which the reversed Hsync signal and the reversed Vsync signal are respectively at a high level are changed, the effective reading region can be set to an arbitrary region. Fig. 4 is a diagram for explaining the method of detecting a color block explained in Fig. 1, and Fig. 5 is a diagram for explaining the method of detecting a color line explained in Fig. 1. As shown in Fig. 4, it is judged whether a pixel is a color pixel (marked with "○") and a black-and-white pixel (marked with "x") on the basis of pixel data. A reference number for forming a color block THN is previously set to, for example, four. When not less than four color pixels continuously occur, the continuous color pixels are judged to be a color block. In Fig. 4, a portion in which fine dots are entered is a portion judged to be a color block. Furthermore, when color blocks whose number is not less than a predetermined number of color blocks for forming a color line THM (for example, THM is set to 5 in Fig. 5) exist in one line, as illustrated in the first line (line in the upper end) in Fig. 5, it is judged that the line is a color line. Furthermore, when the length of a color block occurring in one line is not less than a predetermined length, that is, when there exists a color block constituted by continuous color pixels whose number is not less than a predetermined number of pixels for forming a color line THNmax (for example, THNmax = 80), as illustrated in the fourth to sixth lines, it is judged that the line is a color line. Meanwhile, in the actual device, THM is set to 100 by way of example such that it is judged when the number of color blocks occurring in one line is not less than 100 that the line is a color line. Furthermore, in the stage in which the number of color lines detected is not less than the number of color lines for judging a color document THL (for example, THL = 100), it is judged that the document is a color document. Fig. 6 is a block diagram showing the entire construction of hardware according to one embodiment of the present invention. This construction includes a color pixel detecting portion, a color block detecting portion, a color line detecting portion, and a final output portion. Three YMC data which are document data are applied for each pixel to the color pixel detecting portion. In the color pixel detecting portion, three combinations YM, MC and CY for two colors of the three YMC data are considered and the differences in magnitude between the data are calculated as previous processing for detecting a color pixel. More specifically, the absolute values of the differences | Y - M | = ΔYM, | M - C | = ΔMC, and | C - Y | = ΔCY are respectively calculated in absolute value-of-difference calculating circuits 1, 2 and 3, and the results of the calculations are respectively applied to comparators 4, 5 and 6 provided in the next stages. In the comparators 4, 5, and 6, the results of the calculations are compared with threshold values THym, THmc and THcy. The threshold values THym, THmc and THcy in the respective comparators 4, 5 and 6 may be set to independent and suitable values. In the present embodiment, however, the three threshold values are set to an equal value THx = 20 to 30. Accordingly, when all of the absolute values ΔYM, ΔMC and ΔCY of the respective differences are not more than the threshold value THx, the absolute values of the three differences are considered to be the same value. Consequently, no pulse signal is output from an OR gate 7, so that it is judged that the pixel is a black-and-white pixel. On the other hand, when any one of the absolute values of the differences is more than the threshold value THx, a pulse is output from any one of the comparators 4, 5 and 6. Consequently, a pulse signal is output from the OR gate 7, so that it is judged that the pixel is a color pixel. The pulse output from the OR gate 7 is applied to a continuous number counter 8. In the continuous number counter 8, the number of pulses continuously output from the OR gate 7, that is, the number of continuous color pixels is counted. The counted value of the continuous number counter 8 is applied to two comparators 9 and 12 connected in parallel. In the comparator 9, the counted value of the counter 8 and the number for forming a color block THN = 4 are compared with each other. As a result, when the counted value of the counter 8 is not less than four, a pulse is output from the comparator 9, to be applied to a block number counter 10. The block number counter 10 is a counter reset by the reversed Hsync signal for counting the number of color blocks in one line. The counted value of the counter 10 is applied to a comparator 11. In the comparator 11, the counted value is compared with the number of color blocks for forming a color line THM = 100. As a result, when there are not less than 100 color blocks in one line, a pulse is output from the comparator 11. On the other hand, the counted value of the continuous number counter 8 applied to the comparator 12 is compared with the number of pixels for forming a color line THNmax = 80. It is when the number of continuous color pixels counted in the continuous number counter 8 is not less than 80 that a pulse is output from the comparator 12. When not less than 80 color pixels are thus continuously detected, it is considered that significantly large chromatic color data exists. In the present embodiment, therefore, a line having such a long color block is considered as a color line. The logical OR between the outputs of the comparators 11 and 12 are carried out in an OR gate 13. Accordingly, when a pulse is output from either one of the comparators 11 and 12, it is judged that the line is a color line. An output of the OR gate 13 which is a color line detection signal is counted by a color line number counter 14. When the output of the OR gate 13 is raised from a low level to a high level, the color line number counter 14 counts its rising level and increments the counted value by one. In addition, the counter 14 is reset by the reversed Vsync signal. Furthermore, the counted value of the color line number counter 14 is compared with the number of color lines for judging a color document THL = 100 in a comparator 15. As a result, when the number of color lines is not less than 100, a color document detection signal is output . Fig. 7 is a block diagram showing an example of the detailed construction of the absolute value-of-difference calculating circuit 1 explained in Fig. 6. The absolute value-of-difference calculating circuit 1 comprises two adders 21 and 22, two two's complement circuits 23 and 24, and one selector 25. Y data is directly applied to the adder 21, and the two's complement of the M data is taken in the two's complement circuit 23 so that the M data is reversed to be "-M" and is applied to the adder 21. Accordingly, an output of the adder 21 becomes "Y-M". Furthermore, the M data is directly applied to the adder 22, and the two's complement of the Y data is taken in the two's complement circuit 24 so that the Y data is reversed to be "-Y" and is applied to the adder 22. Accordingly, an output of the adder 22 becomes "M-Y". The respective outputs of the adders 21 and 22 are selected in the selector 25, and data taking a positive value is adopted. More specifically, the judgement whether the value is positive or negative is made by examining the most significant bit (MSB) of the result of the operation "Y-M", so that "Y-M" is selected when MSB = 0 (positive), while "M-Y" is selected when MSB = 1 (negative). The absolute value-of-difference calculating circuits 2 and 3 can be similarly constructed. Fig. 8 is a block diagram showing another example of the detailed construction of the absolute value-of-difference calculating circuit 1. In the construction shown in Fig. 8, the absolute value-of-difference calculating circuit 1 comprises two selectors 31 and 32, a comparator 33 for applying a selection signal to the selectors 31 and 32, one two's complement circuit 34, and one adder 35. In general, the two's complement circuit has a relatively complicated structure. Accordingly, the construction shown in Fig. 8 using only one two's complement circuit can be made more simpler as a whole, as compared with the construction shown in Fig. 7 using two two's complement circuits. The construction of the absolute value-of-difference calculating circuit 1 shown in Fig. 8 and the operation thereof will be described in detail. Y data and M data are respectively applied to the selectors 31 and 32. In addition, the Y data is applied to an A input of the comparator 33, and the M data is applied to a B input of the comparator 33. In the comparator 33, both the data are compared with each other. An output indicating A > B is used as a selection signal of the selector 31, while an output indicating A ≤ B is used as a selection signal of the selector 32. The selector 31 is a circuit for selecting larger one of the Y data and the M data inputted. In addition, the selector 32 is a circuit for selecting smaller one of the Y data and the M data inputted. Smaller one of the Y data and the M data which is selected by the selector 32 is reversed in sign in the two's complement circuit 34. As a result, in the adder 35, larger one of the Y data and the M data and data obtained by reversing in sign the smaller one of the Y data and the M data are added to each other. That is, an output of the adder 35 becomes | Y - M |. The other absolute value-of-difference calculating circuits 2 and 3 are similarly constructed. Fig. 9 is a block diagram showing an example of the detailed construction of the color block detecting portion. A continuous number counter 8 counts a clock when an output of the OR gate 7 (see Fig. 6) is at a high level, that is, a color pixel detection signal is outputted. Accordingly, the continuous number of color pixels is counted by the counter 8. The counted value of the counter 8 is compared with the number for forming a color block THN and the number of pixels for forming a color line THNmax, respectively, in two comparators 9 and 12 connected in parallel. As a result of the comparison in the comparator 9, when the continuous number of color pixels is not less than the number for forming a color block THN = 4, a pulse is output from the comparator 9. This pulse sets a flip-flop 41 at clock rise timing, to bring an output of the flip-flop 41 into a high level. The flip-flop 41 is reset when no color pixel detection signal is output . On the other hand, when the counted value of the counter 8 exceeds the number of pixels for forming a color line THNmax = 10, a pulse is output from the comparator 12. This pulse sets a flip-flop 43 at clock rise timing. An output of the flip-flop 43 is fed back into a D input of the flip-flop 43 through an OR gate 44. Accordingly, the flip-flop 43 set once is self-held in a period during which the reversed Hsync signal is at a high level. Fig. 10 is a block diagram showing an example of the detailed construction of the color line detecting portion and the final output portion. The color line detecting portion comprises a block number counter 10 for counting the number of color blocks in a period during which the reversed Hsync signal is at a high level. When the counted value of the counter 10 is compared with the number of color blocks for forming a color line THM in a comparator 11. When the counted value becomes larger than THM = 100, for example, a high output of the comparator 11 is applied to an OR gate 13. A color line output is also applied to the OR gate 13. This color line output is an output of the self-holding type flip-flop 43, as explained in Fig. 9. Accordingly, when the color line output enters a high level once, it remains at a high level until the transition to the next line processing occurs. An output of the OR gate 13 is applied to a color line number counter 14. In the counter 14, the output is counted in the counter 14 in a period during which the reversed Vsync signal is at a high level. The counted value of the counter 14 is compared with the number of color lines for judging a color document THL in a comparator 15. The number of color lines for judging a color document THL is set to, for example, 100. When the counted value of the counter 14 exceeds 100, that is, when not less than 100 color lines are detected, a color document detection signal is output . In the above described embodiment, the counted value of the continuous number counter 8 is compared with the predetermined reference numbers, respectively, in the two comparators 9 and 12 connected in parallel, as explained with reference to, for example, Figs. 6 and 9. However, this construction may be made simpler. For example, only the comparator 9 or the comparator 12 may be provided. More specifically, when a color line is detected, either one of the following constructions may be used: (1) the construction in which it is judged by only detecting not less than a predetermined number of color blocks in one line that the line is a color line, and (2) the construction in which it is judged only when a long color block constituted by not less than a relatively large predetermined number of continuous color pixels is detected in one line that the line is a color line. Furthermore, although in the above described embodiment, the color block is detected, the color line is detected, and it is judged that the document is a color document when not less than a predetermined number of color lines are detected, such a construction may be employed that a color document detection signal is output when not less than a predetermined number of color blocks, for example, not less than 1000 color blocks are detected in a period during which the reversed Vsync signal is at a high level instead of judging for each line whether or not the document is a color document. In the construction, a color line number counter can be omitted, thereby to make it possible to make the circuit structure simpler. Additionally, although in the above described embodiment, it is judged on the basis of the Y data, the M data and the C data included in the input data whether or not the pixel is a color pixel, it may be judged on the basis of so-called three primary color data, that is, red (R) data, green (G) data and blue (B) data whether a pixel is a color pixel or a black-and-white pixel. When attempts are made to make copies of a document using a digital color copying machine by incorporating the device for judging the type of color of a document according to the present invention into the digital color copying machine, it is automatically judged in real time whether a document is a color document or a black-and-white document. Accordingly, it is possible to make copies on the basis of the results of the judgement using monochromatic Bk toner particles when the document is a black and white document, while using toner particles in three colors, that is, Y toner particles, M toner particles and C toner particles or toner particles in four colors, that is, Y toner particles, M toner particles, C toner particles and Bk toner particles when the document is a color document. As a result, there can be provided a copying machine in which a black-and-white document is not copied using toner particles in three colors or in four colors, so that the consumption of the toner particles may be small. Additionally, a black-and-white document is not copied using a combination of color toner particles. Accordingly, some effects are obtained. For example, the blur of the outline of an image caused by subtle shift in color is eliminated, and character data and the like can be clearly reproduced. Although in the above described embodiment, the specific numbers such as the number for forming a color block THN, the number of pixels for forming a color line THNmax, the number of color blocks for forming a color line THM, and the number of color lines for judging a color document THL are shown, the specific numbers are not limited, and the respective reference numbers may be varied. Particularly when the number for forming a color block THN is set to, for example, "1", a color pixel is equal to a color block. Accordingly, the judgement of a color pixel made in a micro manner becomes a basis for the judgement of a color document.

Claims: A device for judging the type of color of a document for judging whether a document is a color document containing chromatic color information or a black-and-white document containing only achromatic color information on the basis of pixel data read from the document, comprising: color pixel detecting means (1, 2, 3; 4, 5, 6, 7, 8), to which the pixel data read are sequentially applied for each pixel, for judging whether or not the pixel is a color pixel having a chromatic color on the basis of pixel data applied, to output a detection signal when it is judged that the pixel is a color pixel; color block detecting means (9, 10, 11) for detecting the presence of a color block on the basis of the fact that the color pixel detecting means (1, 2, 3; 4, 5, 6, 7, 8) continuously output detection signals whose number is not less than a predetermined number (THN) for forming a color block; and color document detecting means (13, 14, 15) for outputting a color document detection signal on the basis of the fact that the color block detecting means (9, 10, 11) detect the presence of color blocks whose number is not less than a predetermined number of color blocks for judging a color document, wherein the pixel data applied to the color pixel detecting means (1, 2, 3; 4, 5, 6, 7, 8) include three types of color data (YMC), that is, yellow data (Y), magenta data (M) and cyan data (C), characterized in that the color pixel detecting means comprise difference calculating means (1, 2, 3) for finding the differences in magnitude (Y-M, M-C and C-Y) between the color data, threshold value setting means (4, 5, 6) in which a desired threshold value (THym, THcm, THcy) is set, and comparing means (4, 5, 6; 9, 12) for outputting a color pixel detection signal when any one of the differences calculated by the difference calculating means is larger than the threshold value set in the threshold value (THym, THmc, THcy) setting means. The device according to claim 1, characterized in that color line detection means (12) are provided for judging on the basis of the fact that the color pixel detecting means detect in one line the presence of continuous color pixels whose number is not less than a predetermined number that this line is a color line, and for outputting a detection signal, and in that the color document detection means (13, 14, 15) also output a color document detection signal in response to detection signals from the color line detecting means. The device according to claim 1 or 2, characterized in that the difference calculating means (1, 2, 3) comprise means (1) for calculating the absolute value of the difference in magnitude between the yellow data (Y) and the magenta data (M), means (2) for calculating the absolute value of the difference in magnitude between the magenta data (M) and the cyan data (C), and means (3) for calculating the absolute value of the difference in magnitude between the cyan data (C) and the yellow data (Y). The device according to any of claims 1 to 3, characterized in that three threshold values (Thym, THmc, THcy) to be respectively compared with the differences in magnitude between the color data are set in the threshold value setting means (4, 5, 6). The device according to any of claims 1 to 4, characterized by longitudinal line reading means (CCD) for sequentially reading the document from its one end side toward the opposed end side, and color data processing means for processing the pixel data read out from the longitudinal line reading means to be the color data including yellow data (Y), magenta data (M) and cyan data (C). The device according to claim 5, characterized in that the line reading means (CCD) output a line signal (HSYNC) in synchronization with the start or the termination of reading of one line, so that one line is determined on the basis of the one line signal.

Inventors: NAGATA KATSUMI, NAGATA, KATSUMI
Applicants: MITA INDUSTRIAL CO LTD, MITA INDUSTRIAL CO. LTD.
Application year: 1992
Main classification: H04N1
IPC codes: H04N1