Patent Publication Number: US-6034796-A

Title: Data processor

Description:
CROSS REFERENCE TO RELATED APPLICATION 
     This is a division of U.S. patent application Ser. No. 08/677,564, filed Jul. 8, 1996 now U.S. Pat. No. 5,677,736, which is a division of then application Ser. No. 08/286,669, filed on Aug. 5, 1994 and now U.S. Pat. No. 5,563,726. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a data processor for data compression of image data. 
     2. Description of the Prior Art 
     An international standard for color still image coding by a Joint Photographic Experts Group (JPEG) is a known coding technique for image data. In the color image coding, image data of red, green and blue are converted to a luminance data V and color difference data W R  and W B . The luminance data V and the color difference data W R  and W B  are coded separately. Then, the input data (luminance data V or color difference data W R , W B ) is divided into processing blocks each of a prescribed size of pixel matrix (normally 8*8 pixel matrix), and image data in a processing block is subjected to discrete cosine transform (DCT) to generate DCT coefficients. Then, they are compressed as Huffman codes. The coded data are decoded when the document image is reproduced. 
     An image data of a document read by an image reader is an object of the above-mentioned coding. When an image data of a document of a single color or an achromatic color is read by an image reader, the image data will be all the same ideally. For example, in a case of a document of only red color, chroma has a certain value, but the AC components of the DCT coefficients will all be zero. On the other hand, in a case of an achromatic color image of black and white, chroma will be zero. However, errors occur actually on reading an image data because a read condition such as a quantity of exposure light or a reflectivity of a document paper may change. 
     As explained above, image data are usually divided into processing units of say 8*8 pixel matrix and they are processed for coding for each processing unit with discrete cosine transformation. Values of DC component and AC components of the DCT coefficients obtained after the discrete cosine transformation are affected by the existence of incorrect data caused by read errors. Therefore, if the incorrect values are decoded to reproduce a document image, a so-called block distortion occurs wherein colorfulness changes for each processing block and this deteriorates a quality of the entire reproduced document image. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to provide a data processor which can correct read errors or the like to prevent so-called block distortion for an achromatic image when image data are processed for coding by dividing them into blocks. 
     Another object of the present invention is to provide a data processor which removes colorfulness between blocks when differences are small between DC coefficients of adjacent processing blocks when image data are processed for coding by dividing them into blocks. 
     A further object of the present invention is to provide a data processor which can remove colorfulness errors between blocks in a monochromatic dot image when image data are processed for coding by dividing them into blocks. 
     In one aspect of the present invention, in data processing wherein image data are processed by dividing them into blocks, a chroma data W is obtained from the color difference data W R  and W B , and the color difference data W R  and W B  are corrected according to an amplitude of the chroma data W. For example, if the chroma W is smaller than a prescribed threshold value, the color difference data W R  and W B  are set as zero. Then, the so-called block distortion can be prevented. The degree of the correction may be changed to depend on the amplitude of the chroma data W. 
     In a different aspect of a data processor, in data processing wherein image data are processed by dividing them into blocks, DC coefficients of discrete cosine transform of adjacent blocks are compared with each other. The DC coefficient is a fundamental data among the DCT coefficients, while the AC coefficients represents of differences from the DC coefficient. When they represent a same image, if DC coefficients are different from each other, block distortion occurs. Then, if differences of DC coefficients of discrete cosine transform coefficients of adjacent blocks are small with each other, the DC coefficients are corrected to tend to have similar values. 
     In a further aspect of the invention, in data processing wherein image data are processed by dividing them into blocks, a comparator compares absolute values of AC components in the DCT coefficient data received from a discrete cosine transform section with a prescribed threshold value. Then, if absolute values of AC components in the DCT coefficient data are smaller than a prescribed threshold value, the values of the AC components are not sent to a coder because in such cases read errors or the like are thought to affect the AC components. 
     An advantage of the present invention is that read errors or the like in image data of a monochromatic image or an achromatic dot image can be corrected to remove erroneous colorfulness change. 
     Another advantage of the present invention is that a vivid image can be reproduced when the differences of color difference data between adjacent blocks are small. 
     A third advantage of the present invention is that read errors or the like in image data of a color image can be corrected to remove erroneous colorfulness change. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     These and other objects and features of the present invention will become clear from the following description taken in conjunction with the preferred embodiments thereof with reference to the accompanying drawings, and in which: 
     FIG. 1 is a schematic sectional view of a digital color copying machine with a facsimile function; 
     FIG. 2 is a block diagram of a coding unit; 
     FIG. 3 is a diagram of a color space for illustrating a relation of color difference data W R  and W B  to hue data H and chroma data W in a space of V, W R  and W B  ; 
     FIG. 4 is a graph of achromatic level (BK) plotted against chroma data (W); 
     FIG. 5 is a block diagram of a coding section for color difference data W R  and W B  for correcting read errors of a monochromatic image; 
     FIG. 6 is a diagram of 8*8 blocking in an image of X*Y pixels; 
     FIG. 7 is a diagram of DC coefficients in processing blocks in 3*3 blocking unit; 
     FIGS. 8A and 8B are diagrams of examples of DCT coefficients of a monochromatic image and of a monochromatic dot image, respectively; 
     FIG. 9 is a diagram of a matrix of DCT coefficients S.sub.α,β and a scan order therein in zigzag scan; and 
     FIG. 10 is a block diagram of a coding section for image data according to an international standard. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Referring now to the drawings, wherein like reference characters designate like or corresponding parts throughout the views, FIG. 1 shows a digital color copying machine which also serves as a facsimile apparatus, wherein image data of a document placed on a platen is read with an image reader and the image is printed on a paper with an electrophotographic process or sent to another facsimile apparatus through a telephone line. 
     A scanner 10 comprises an exposure lamp 12, a rod lens array 13 and a color image sensor 14. When image reading for copying or facsimile transmission is started, a document is put on a platen glass 16, and the scanner 10 is driven by a motor 11 to read image data of the document along a direction of an arrow as shown in the drawing. The exposure lamp 12 exposes the document, and a light reflected from the document is received through the rod lens array 13 to the color image sensor 14. A signal processor 20 processes the image data from the sensor 14 to supply digital image data of red, green and blue to a coding unit 30. The coding unit 30 sends the image data to a print head 31. On the other hand, it also performs variable length coding of the image data and stores the code data. The code data may be transmitted to another facsimile apparatus via a facsimile transmission section 40 comprising a modulation and demodulation unit (MODEM) and a network control unit (NCU). The coding unit 30 will be explained later with reference to FIG. 2. 
     On image forming on a paper, a laser diode in the print head 31 modulates a light beam according the image data received from the coding unit 30, and the light beam is guided via a reflection mirror 37 to illuminate a surface of a photoconductor drum 41. The light beam forms an electrostatic latent image on the photoconductor drum 41 which has been sensitized at a predetermined potential. A development unit 45a-45d develops the latent image with toners of either of cyan, magenta, yellow and black. A paper in a tray 50 is fed to a transfer drum 51 and its top is chucked with a chucking mechanism 52. The toners adhered to the latent image is transferred to the parer wound on the transfer drum 51. Then, the remaining latent image is erased with a lamp 42. Toners of four colors of cyan, magenta, yellow and black are transferred successively to the paper. Then, the paper is isolated from the transfer drum 51 with a claw 47, fixed by a fixing unit 48 and discharged to a tray 49. 
     FIG. 2 shows a block diagram of the coding unit 30. Image data of red (R), green (G) and blue (B) are supplied to an HVC converter 201 as well as to the print head 31. The HVC converter 201 converts the R, G and B image data into a luminance data V and two color difference data W R  and W B . In general, spectral luminous efficiency has a large weight at green, and it is approximated generally that R:G:B=0.229:0.589:0.114 for C light source at 2° visual field. The luminance data V can be determined according to the spectral luminous efficiency. On the other hand, the color difference data W R  and W B  are determined as follows: 
     
         W.sub.B =B-V,                                              (1) 
    
     and 
     
         W.sub.R =R-V. 
    
     In other words, the luminance data V and the two color difference data W R  and W B  are determined in the HVC converter 201 by using a following matrix calculation: ##EQU1## 
     An achromatic level detector 202 is provided to remove erroneous colorfulness change between processing blocks due to read errors or the like. If an image is achromatic, the DCT coefficients of the color difference data W R  and W B  will be zero theoretically. However, the DCT coefficients do not necessarily become zero due to image noises and the like. Then, the achromatic level detector 202 detects chroma of a data and checks if the data is achromatic or not. The decision of the achromatic level detector 202 is used to correct the color difference data W R  and W B . 
     The achromatic level detector 202 calculates a chroma W from the color difference data W R  and W B . The chroma W is calculated according to a following equation: ##EQU2## 
     In a color space of V, W R  and W B  shown in FIG. 3, a data point is denoted as an open circle. The color difference data W R  and W B  received from the HVC converter 201 are represented by two orthogonal coordinate axes in a hue plane, and a length of a vector from the origin to a point in the hue plane of W R  and W B  represents the chroma W, and the chroma decreases as the point approaches to the origin. The angle Θ in the hue plane represents a hue H. 
     The achromatic level detector 202 next determines achromatic level BK (%) according to the chroma data W. In an example shown in FIG. 4, the achromatic level BK changes nonlinearly against chroma data W. The achromatic level data BK has a value of 100% in a certain range of chroma data near the origin as shown in FIG. 4. In other words, if the color is achromatic, the value BK is 100%. The achromatic level detector 202 determines the achromatic level B by using a table included therein. 
     In order to correct the color difference data W R  and W B , the achromatic level detector 202 sends (1-BK/100) value to multipliers 203 and 204 to multiply it with the color difference data W R  and W B , respectively, and sends multiplied or corrected data W R  &#39; and W B  &#39; to a coding unit 205. Therefore, if the data is decided to be completely achromatic (BK=100%), the corrected data W R  &#39; and W B  &#39; are all set as zero. On the other hand, if the data is decided to be completely chromatic (BK=0%), the corrected data W R  &#39; and W B  &#39; are equal to W R  and W B . However, for a data between the two extreme cases, the color difference data W R  and W B  can be controlled according to the achromatic level BK. This nonlinear relation is appropriate for a half-tone image. 
     In a second example, the achromatic level BK may be set at two levels, in contrast to FIG. 4, by comparing with a prescribed threshold value. That is, it is 100% when the chroma data W is smaller than the prescribed threshold value, otherwise it is set as 0. Such a two level processing is simple but appropriate for example to a character image because of characteristics of color recognition of human eyes. 
     The coding unit 205 performs coding of the color difference data W R  &#39; and W B  &#39; and the luminance data V. Thus, errors which occur when the scanner 10 reads an achromatic document image can be corrected effectively on basis of color data W, so that block distortion in a reproduced image can be prevented. 
     In the present embodiment, the correction of the color difference data is performed before discrete cosine transform, but it may be performed after discrete cosine transform. However, if the correction of the color difference data is performed before discrete cosine transform, the efficiency of data processing is better. 
     FIG. 5 shows a processing block 300 for the color difference data W R  &#39;, W B  &#39; in the coding unit 205 shown in FIG. 2. Image data of a document is first received by a 8*8 blocking section 301, and the 8*8 blocking section 201 divides the image data into processing blocks B.sub.α,β of 8*8 pixel matrices as shown in FIG. 6. If an image comprises X*Y pixels, the number of the processing blocks is (X/8)*(Y/8). 
     A DCT (discrete cosine transform) section 302 performs discrete cosine transform of image data in a processing matrix to DCT coefficients. In the discrete cosine transform, data P x ,y (x, y=0, 1, . . . , 7) of pixels in a processing matrix are transformed into 64 DCT coefficients S u ,v (u, v=0, 1, . . . , 7) according to Eq. (4). ##EQU3## wherein x and y denote positions in the processing matrix, u and v denote positions in a matrix of DCT coefficients, ##EQU4## 
     Among the 64 DCT coefficients S u ,v, a coefficient S 0 ,0 is called as DC coefficient while the others are called as AC coefficients. The DC coefficient means an average of the data in the 8*8 pixels in a processing matrix. If a pixel value P x ,y is represented as an 8-bit data, L s  is defined as 128 as an expected value of the DC coefficient is taken as 128. Then, if an average of pixel values is 128, the DC component becomes zero. As shown in FIG. 5, the DCT section 302 sends the DC coefficient and the AC coefficients through different paths. 
     As explained above, the DC component represents an average value of data of 8*8 pixels. In the coding unit 205, the DC component of the DCT components in a specified processing block is smoothed more strongly stepwise according to a difference of the DC coefficient D.sub.α,β of the specified processing block B.sub.α,β from those of the DC components of adjacent eight processing blocks shown in FIG. 7. That is, the DC coefficient D.sub.α,β of the processing block B.sub.α,β from the DCT section 302 is sent to a 3*3 blocking section 303. 
     The 3*3 blocking section 303, a level decision section 304, a smoothing section 305 and a DC coefficient processor 306 are provided to remove colorfulness noises between the 8*8 blocks. When color image is compressed with discrete cosine transform, the values of DCT coefficients between 8*8 blocks become different. The differences become small for an image of uniform color, but they do not vanish completely and this causes colorfulness noises. The 3*3 blocking section 303 is provided to compile nine DC coefficients of 3*3 block including D.sub.α,β in order to correct the DC component by taking into account DC components of adjacent processing blocks. As will be explained later, if the level decision section 304 decides that a degree of the difference of the color difference data W R  &#39; and W B  &#39;. If the degree is decided to be small, the same densities (or DCT coefficients) are adopted to remove colorfulness noises and to reproduce a vivid color. 
     In this processing, the 3*3 blocking section 303 receives nine DC coefficients D.sub.α,β of eight adjacent processing blocks with B.sub.α,β at a center, as shown in FIG. 7, wherein D.sub.α,β represents a value of the DC coefficient of a processing block B.sub.α,β. Therefore, the 3*3 blocking section 303 compiles D.sub.α-1,β-1, D.sub.α,β-1, D.sub.α+1,β-1, D.sub.α-1,β, D.sub.α,β, D.sub.α+1,β, D.sub.α-1,β+1, D.sub.α,β+1 and D.sub.α+1,β+1. 
     As shown in FIG. 5, the 3*3 blocking section 303 sends the DC coefficients of the nine processing blocks to a smoothing section 305. The smoothing section 305 calculates two smoothed values DM.sub.α,β and DL.sub.α,β from DC coefficients by following Equations (5) and (6) according to two kinds of 3*3 smoothing filters: ##EQU5## DM.sub.α,β represents a DC coefficient of the processing block B.sub.α,β for smoothing of an intermediate degree with denominator of 16, while DL.sub.α,β represents a DC coefficient of the processing block B.sub.α,β for smoothing of averaging. They are sent to the DC coefficient processor 306. The processor 306 also receives as-received color difference data W R  &#39; and W B  &#39;. Therefore, the processor 306 receives three kinds of the color difference data W R  &#39; and W B  &#39; and sends one of them according to a level signal L which will be explained next. 
     On the other hand, the level decision section 304 receives the nine DC coefficients from the 3*3 blocking section 303 and instructs the processor 306 to use which of the three kinds of data. The level decision section 304 compares the DC coefficient D.sub.α,β of the specified processing block B.sub.α,β with each DC coefficient of the eight adjacent processing blocks D.sub.α-1,β-1, D.sub.α,β-1, D.sub.α+1,β-1, D.sub.α-1,β, D.sub.α-1,β, D.sub.α+1,β, D.sub.α-1,β+1, D.sub.α,β+1, D.sub.α+1,β+1 and decides a level of the differences between the nine blocks. That is, if we represents 
     
         A=D.sub.α-1,β-1 -D.sub.α,β, 
    
     
         B=D.sub.α,β-1 -D.sub.α,β, 
    
     
         C=D.sub.α+1,β-1 -D.sub.α,β, 
    
     
         E=D.sub.α-1,β -D.sub.α,β, 
    
     
         F=D.sub.α+1,β -D.sub.α,β, 
    
     
         g=D.sub.α-1,β+1 -D.sub.α,β, 
    
     
         H=D.sub.α,β+1 -D.sub.α,β 
    
     and 
     
         I=D.sub.α+1,β+1 -D.sub.α,β, 
    
     the level is decided by using threshold values γ and θ determined on the basis of experimental data. The level is sent to the DC coefficient processor 306. 
     (a) If all values of A, B, C, E, F, G, H and I are smaller than a threshold value γ, the level decision signal L is set as &#34;10&#34;. This is a case where differences among the DC coefficients around the central processing block are small. Then, the processor 306 adopts the DL.sub.α,β as the DC coefficient. The value DL.sub.α,β is a simple average of the DC coefficients of the nine processing blocks. Because there is a gradual change of color difference signals, a simple smoothing thereof is used. 
     (b) If all values of A, B, C, E, F, G, H and I are larger than a threshold value γ and smaller than another threshold value θ, the level decision signal L is set as &#34;01&#34;. In this case, differences of the DC coefficients are not so small, but relatively large around the central processing block. This case is found for example for a half-tone image. Then, the processor 306 adopts the DL.sub.α,β as the DC coefficient. The value DL.sub.α,β is an average of the DC coefficients of the nine processing blocks with a large weight of D.sub.α,β. 
     (c) If at least one of the values of A, B, C, E, F, G, H and I does not satisfy the above-mentioned condition (a) or (b), the level decision signal L is set as &#34;00&#34;. This corresponds to all cases other than the above-mentioned cases (a) and (b). 
     The DC coefficient processor 306 receives the above-mentioned decision level L and the three kinds of DC coefficients, an as-received value, DM.sub.α,β and DL.sub.α,β, and it selects the as-received value D.sub.α,β without smoothing to a quantization section 307 if the decision level L=&#34;00&#34;, DM.sub.α,β if the decision level L=&#34;01&#34;, and DL.sub.α,β if decision level L=&#34;10&#34;. for example, by performing the above-mentioned processing on the DC coefficient of the processing block B.sub.α,β, if the decision level L=&#34;10&#34;, subtle differences between processing blocks due to read errors, image errors or the like can be smoothed to correct differences of colorfulness in a reproduced image. If the decision level L=&#34;01&#34;, a half-tone image can be corrected to have smooth colorfulness change in a reproduced image. 
     Then, the quantizing section 307 quantizes a data received from the processor 306 with a quantization table, and a differential pulse-coded modulation (DPCM) section 308 calculates a difference of the DC coefficient of the processing block B.sub.α,β from that of a previous processing block B.sub.α-1,β, and the coder 309 performs a variable length coding of the difference. 
     On the other hand, the AC coefficients B.sub.α,β from the DCT unit 302 are quantized by a second quantizing section 311 with a quantization table. However, if the AC coefficients include read errors, a quality of a reproduced image is deteriorated. FIG. 8A shows an example of DCT coefficients of a monochromatic image, while FIG. 8B shows an example of DCT coefficients of a dot image consisting of monochromatic minute dots. As shown in FIG. 8A, the absolute values of the AC coefficients of a monochromatic image have values near zero. On the other hand, as shown in FIG. 8B, the absolute values of the AC coefficients of a dot image do not necessarily have values near zero. If as received AC coefficients of such a monochromatic dot image having read errors are quantized and coded, a color shift at high frequencies appears obviously in an image reproduced by decoding the data. 
     Then, in the coding device of the embodiment, a comparator 310 is provided in order to determine if the received AC coefficients supplied have to be corrected or not. The DCT coefficient section 302 also supplies the AC coefficients successively to the comparator 310. If absolute values of all the AC coefficients in the processing block B.sub.α,β are smaller than a threshold value T determined experimentally (T=12 for FIG. 8B), it is considered that differences of the AC components are all ascribed to read errors or the like of a monochromatic dot image, and all AC components are set as zero by a gate 312 in order to avoid a change in colorfulness in a reproduced image. Therefore, the comparator 310 decides that the image is a monochromatic dot image and sends a gate signal to the gate 312 which makes all the AC coefficients zero because a monochromatic dot image will have all zero AC coefficients. The above-mentioned processing corrects the read errors or the like and improves a quality of a reproduced image. Further, because only the DC coefficient is coded, a compression ratio of information quantity can also be improved. 
     The AC coefficients supplied through the gate 312 are next sent to a zigzag scan section 313. The zigzag scan section 313 scans the AC components S u ,v (u, v; u=1-8, v=1-8) in the order of arrows shown in FIG. 9 so as to reorder them in a one-dimensional array. Then, a coder 314 processes the reordered data for entropy coding. 
     A multiplexer 315 multiplexes the data coded by the coders 309 and 314 and sends a multiplex data to the facsimile transmission unit 40 or the like. Decoding of the image data is performed by a reverse processing. 
     The luminance data V is coded according to the above-mentioned prior art international standard. FIG. 10 shows a processor block in the coding unit 300 for processing luminance data V in pixel data of a document image. Luminance data V is sent to an 8*8 blocking section 101, which divides pixel data into blocks B.sub.α,β of processing pixel matrices of 8*8 pixels similarly to the blocking section 301. 
     The DCT section 102 performs discrete cosine transform of the luminance data V of an 8*8 block similarly to the DCT section in FIG. 5 and sends the DCT coefficients to a quantization section 103. As shown in FIG. 10, a DC coefficient among the DCT coefficients is supplied to a differential pulse-coded modulation (DPCM) section 104, while the AC coefficients are supplied to a zigzag scan section 105. The DPCM section 108 calculated a difference between the DC component of a processing block B.sub.α,β from that of a preceding block B.sub.α-1,β (refer FIG. 6), and the difference is subjected to variable length coding in the coder 106. On the other hand, the zigzag scan section 105 scans the AC components S u ,v (u, v; u=1-8, v=1-8) in the order shown with arrows in FIG. 9 in order to reorder them in a one-dimensional array. A coder 107 processes the reordered data for entropy coding. A multiplexer 108 multiplexes the data coded by the two coders 106 and 107 and sends a multiplex data to the facsimile transmission unit 40 or the like. Decoding of the image data is performed by reverse the above-mentioned processing. 
     Although the present invention has been fully described in connection with the preferred embodiments thereof with reference to the accompanying drawings, it is to be noted that various changes and modifications are apparent to those skilled in the art. Such changes and modifications are to be understood as included within the scope of the present invention as defined by the appended claims unless they depart therefrom.