Image encoding apparatus

Abstract: An image encoding apparatus includes a smoothing circuit (11) for smoothing a binary image to be encoded, a binary-encoding circuit (12) for binary-encoding the image smoothed by the smoothing circuit, a sampling circuit (13) for sub-sampling the image binary-encoded by the binary-encoding circuit, and an encoding circuit (26) for encoding the binary image sub-sampled by the sampling circuit. A degree of smoothness (G) of an image by the smoothing circuit and a threshold value (T₁) for a binary-encoding operation of the binary-encoding circuit can be varied.

Description: The present invention relates to an image encoding apparatus for encoding a binary image. In a facsimile apparatus as a typical still image communication apparatus, a method of encoding an image in accordance with MH or MR coding by sequentially scanning the image is employed. In this method, in order to recognize the entire image, all the image data must be transmitted, resulting in a long transmission time. Therefore, it is difficult to apply this method to an image communication service such as an image data base service, a videotex, or the like, in which an image must be quickly judged. Unlike the method employed in the facsimile apparatus, a sequential reproducing/encoding method in which rough image data is transmitted before the entire image is transmitted, and additional data is then transmitted to generate detailed image data is proposed in, e.g., "Sequential Reproducing/Encoding Method of Facsimile Signal Suitable for Conversation Type Image Communication" , Endo and Yamazaki, (Transaction of the institute of electronics, information and communication engineers, (B) J67-B.12, pp. 1462-1469 (1984)). In a so-called progressive encoding method for generating images having different resolutions and separately encoding and transmitting the images having the different resolutions, in order to obtain a low-resolution image, an input image is subjected to sampling processing at a predetermined rate. However, since initial image data is generated by sampling pixels at specific intervals, encoding efficiency of a normal document image is good while effective image data cannot be transmitted in a first stage depending on the type of image. Especially, if an image which is dither-processed for pseudo halftone reproduction is simply sampled, an image is omitted depending on a sampling period. When an encoded image is reproduced, an original image cannot be faithfully reproduced. The present invention has been made in consideration of the above situation, and has as its object to provide an image encoding apparatus which can faithfully reproduce an original image. It is another object of the present invention to provide an image encoding apparatus which can satisfactorily form images having different resolutions in progressive coding. It is still another object of the present invention to provide an image encoding apparatus which can satisfactorily encode images having different resolutions in progressive coding. The above and other objects and effects of the present invention will be apparent from the following description. Fig. 1 is a block diagram of an embodiment of an encoder; Fig. 2 is a block diagram of an embodiment of a decoder; Fig. 3 is a table showing coefficients of a low-pass filter; Fig. 4 is a block diagram of an embodiment of a low-pass filter; Fig. 5 is a view for explaining a sub-sampling operation; Fig. 6 is a block diagram of a prediction circuit; Fig. 7 is view for explaining reference pixels on an encoding surface; Fig. 8 is a view for explaining reference pixels of an image sent one stage before the current stage; Fig. 9 is a block diagram of an arithmetic code encoder; Fig. 10 is a block diagram of an arithmetic code decoder; and Fig. 11 is a block diagram of another embodiment for adjusting a smoothing effect. Fig. 1 shows an embodiment of an encoder to which the present invention is applied. Original image data I₁ as binary data representing black/white of each pixel of an original image is stored in a first frame memory 10. A first low-pass filter 11 then performs smoothing processing of the image data. The smoothed data is binary-encoded again by a first comparator 12. A parameter C₁ for adjusting a degree of smoothing is input to the first low-pass filter 11. A threshold value T₁ is input to the first comparator 12. These values are determined by a controller 9 on the basis of required image quality and encoding efficiency. A first sub sampling 13 generates a signal 101 representing an image which is sampled to 1/2 in both the vertical and horizontal directions. The signal 101 is stored in a second frame memory 14. The signal 101 is similarly processed by a second low-pass filter 15, a second comparator 16, and a second sub sampling 17, thus generating a signal 102 representing a 1/4 image. The signal 102 is stored in a third frame memory 18. The signal 102 is similarly processed by a third low-pass filter 19, a third comparator 20, and a third sub sampling 21 to obtain a signal 103 representing an 1/8 image. The signal 103 is stored in a fourth frame memory 22. The controller 9 inputs parameters C₂ and C₃ to the second and third low-pass filters, and threshold values T₂ and T₃ to the second and third comparators, respectively. The signal 103 is encoded by a first encoder 23, and is transmitted as a first-stage signal 104. A second encoder 24 performs encoding with reference to data in the fourth and third frame memories 22 and 18, and transmits a second-stage signal 105. Similarly, a third encoder 25 performs encoding with reference to data in the third and second frame memories 18 and 14, and transmits a third-stage signal 106. Similarly, a fourth encoder 26 performs encoding with reference to the second and first frame memories 14 and 10, and transmits a fourth-stage signal 107. As described above, the first to fourth encoders encode image data having different resolutions. The image data of the first to fourth stages are encoded and transmitted in the order starting from one having a low resolution, so that a reception side can immediately identify the entire image before image data having higher resolutions are transmitted. If the data is unnecessary, transmission of image data of the higher resolutions can be stopped. Thus, a communication time of unnecessary data can be reduced, and an efficient image communication service can be provided. In this embodiment, an image is encoded in four stages having different resolutions. However, the present invention is not limited to this, and the number of stages of encoding may be increased/decreased. The low-pass filters, comparators, sub samplings, and encoders need not be arranged in units of stages, and a system of these components may be time-divisionally utilized in units of stages. Fig. 2 shows an embodiment of a decoder for decoding image data encoded by the encoder shown in Fig. 1. The first-stage signal 104 encoded based on an 1/8 image by the encoder is decoded by a first decoder 27, and the decoded signal is stored in a fifth frame memory 31. This signal is converted to high-resolution data by x8 interpolation processing of a first interpolation device 35, and the high-resolution data is then stored in a video memory 39 through a selector 38 which is switched by a controller 42. The video memory 39 comprises a 2-port memory which can perform parallel input/output operations. Therefore, an image decoded at the reception side is displayed on a monitor 40 as needed. The second-stage signal 105 encoded based on 1/4 and 1/8 images by the encoder is decoded by a second decoder 28 with reference to data stored in the fifth frame memory 31, and is stored in a sixth frame memory 32. This data is subjected to x4 interpolation processing by a second interpolation device 36, and is stored in the video memory 39 upon switching of the selector 38. Similarly, the third-stage signal 106 encoded based on 1/2 and 1/4 images by the encoder and the fourth-stage signal 107 encoded based on an original image and a 1/2 image are respectively decoded by third and fourth decoders 29 and 30, seventh and eighth frame memories 33 and 34, and a third interpolation device 37, and are stored in the video memory 39. The stored data are displayed on the monitor 40. The signal stored in the eighth frame memory 34 as a fourth-stage decoded image signal is output to a printer 41 to obtain a hard copy. Fig. 3 shows filter coefficients of a 3 x 3 (pixel) low-pass filter used as the first, second, and third low-pass filters 11, 15, and 19 in the encoder shown in Fig. 1. The weighting coefficient of the central pixel is represented by C, a weighting coefficient of 2 is assigned to four pixels nearest to the central pixel, and a weighting coefficient of 1 is assigned to the next nearest pixels. Thus, the value of the central pixel is represented by D ij (i = 1 to M and j = 1 to N: M and N are pixel sizes in the horizontal and vertical directions), an average density W is given by: W = (D i-1,j-1 + 2D ij-1 + D i+1j-1 + 2D i-1j + cD ij + 2D i+1j + D i-1,j+1 + 2D ij+1 + D i+1,j+1 ) Each of the first, second, and third comparators 12, 16, and 20 binary-encodes this value W with a threshold value T (standard setup value is T = (12 + C)/2) . The values W and T have the following correspondence. Fig. 4 is a block diagram of the low-pass filter and the comparator for performing the above-mentioned arithmetic operations. An input signal is latched by latches 44a, 44b, and 44c to be delayed by one pixel clock, respectively. Line memories 43-a and 43-b hold input signals delayed by one line. Signals having pixel positions corresponding to those of the latches 44a, 44b, and 44c are obtained at latches 44d, 44e, and 44f, and latches 44g, 44h, and 44i. Thus, data corresponding to nine pixels shown in Fig. 3 are obtained. The output signals from the latches 44a, 44c, 44g, and 44i are added by an adder 45a, and the sum data is multiplied with a constant (x1) by a multiplier 46a. The output signals from the latches 44b, 44d, 44f, and 44h are added by an adder 45b, and the sum data is multiplied with a constant (x2) by a multiplier 46b. The output signal from the latch 44e as the central value is multiplied with a constant (xC) by a multiplier 46c. The value C can be set by the external controller 9, and its standard value is C = 4. The output signals from the multipliers 46a, 46b, and 46c are added by an adder 47, and the sum data is compared with the threshold value T by a comparator 48. When the sum data is larger than the threshold value T, a signal of "1" level is obtained; otherwise, a signal of "0" level is obtained. The threshold value T can also be set by the external controller 9, and has a value of T = (12 + C)/2 as the standard value, as described above. Fig. 5 is a view for explaining a sub-sampling operation in the encoder shown in Fig. 1. Hatched pixel data in Fig. 5 are sampled at every other timings in main and sub scan directions, thus forming a sub-sampled image having a 1/2 size (1/4 in terms of an area). Such sub-sampling operation can be easily realized by adjusting latch timing of image data. In this manner, before sub-sampling processing for obtaining a low-resolution image for progressive coding, original data is smoothed by the low-pass filter, and the smoothed data is binary-encoded. Thus, good low-resolution image data free from omission or error of an image can be obtained as compared with resolution reduction processing by simple sampling. Furthermore, since the smoothing parameters and the binary-encoding threshold value can be independently set in units of stages, sub-sampled images suitable for respective processing operations can be obtained, and the following encoding processing can be satisfactorily performed. Encoding will be described below. In this embodiment, encoding is performed using arithmetic coding, and a value of a pixel of interest is predicted on the basis of surrounding pixels. A symbol when prediction is successful is called a most probable symbol (1), a symbol when prediction is unsuccessful is called a less probable symbol (0), and a generation probability of the less probable symbol is represented by p . With this data, encoding is performed. For further details about arithmetic coding, please refer to "Image Signal Processing for FAX and OA", Takahiko FUKINUKI, Nikkan Kogyo, Co. More specifically, if a binary arithmetic code for a code string s is represented by C(S) and its assist amount is represented by A(S), encoding progresses according to the following arithmetic operations: for A (null) = 0.11...1 Assuming p(S) = 2 -Q(S ) , multiplication is performed by only shifting a binary number. Q is called a skew value. The most probable symbol, the less probable symbol, the skew value Q, and the like are state-separated from values of reference pixels used for prediction, and are determined in advance based on a standard image. In decoding, a binary signal string S is given by S' x S'', and when decoding progresses up to S', C(S) and C(S') + A(S'0) are compared. When C(S) > C(S') + A(S'0) , decoding is performed if x = 1; otherwise, decoding is performed if X = 0. Fig. 6 is a block diagram of a circuit portion for predicting a pixel of interest in the first, second, third and fourth encoders 23, 24, 25, and 26. A frame memory A51 is a memory for storing at least one frame of image data to be encoded. A frame memory B52 stores at least one frame of image data which corresponds to an image sent one stage before and is sub-sampled to 1/2 of the image data stored in the frame memory A51. Each frame memory comprises a two-dimensional memory. If a clock for x addresses is represented by ₁ and a clock for y addresses is represented by ₂, the clocks ₁ and ₂ are input to the frame memory A51, and clocks 1/2₁ and 1/2₂ having a 1/2 frequency are input to the frame memory B52. Thus, one pixel of the frame memory B52 corresponds to 2 x 2, i.e., 4 pixels of the frame memory A51. Data read out from the frame memories A51 and B52 are delayed by one line in line memories 53a, 53b, 54a, and 54b, and are input to latches 55 and 56. These latches hold data delayed by one pixel. Fig. 7 shows the positions of reference pixels of image data read out from the frame memory A51. The outputs from the latches shown in Fig. 6 have the following correspondence with the pixel positions shown in Fig. 7. That is, a pixel of interest (*) corresponds to the output from a latch 55j (pixel of interest signal D301); a position No. 1 in Fig. 7, the output from a latch 55i; No. 2, a latch 55g; No. 3, a latch 55h; No. 4, a latch 55f; No. 5, a latch 55e; No. 6, a latch 55b; and No. 7, a latch 55d. Fig. 8 shows the positions of reference pixels of image data read out from the frame memory B52. A pixel position No. 8 corresponds to the output from a latch 56e; No. 9, a latch 56c; No. 10, a latch 56d; No. 11, a latch 56c; No. 12, a latch 56h; No. 13, a latch 56g; and No. 14, a latch 56i. An image at the position No. 8 in Fig. 8 is 1/2 image data corresponding to 2 x 2 pixels including a pixel of interest. A 2-bit pixel position signal 59 for identifying the position of the pixel of interest in No. 8 (four states, i.e., upper left, upper right, lower left, and lower right) is generated by a counter 60 on the basis of the clocks ₁ and ₂. The pixel position signal 59 and pixel signals from the latches 55 and 56 are input to an LUT (look-up table) 57. The LUT 57 outputs a skew value Q61 and a less probable symbol (LPS) signal 62 in each state. The content of the LUT 57 can be calculated in advance with reference to a standard image or the like. An EXOR gate 58 exclusively ORs the LPS signal 62 from the LUT 57 and the pixel of interest signal D301 from the latch 55j, thus obtaining an MPS/ LPS signal 63. When the signal MPS/ LPS signal is "1", the pixel of interest corresponds to the most probable symbol; when it is "0", the pixel corresponds to the less probable symbol. The first encoder 23 for first-stage encoding does not refer to the content of the frame memory B52, and refers to only pixel data from the frame memory A51. Therefore, the line memories 54, the latches 56, and the counter 60 associated with the frame memory B52 are omitted. Fig. 9 is a block diagram of an arithmetic code encoder. The signal Q61 and the MPS/ LPS signal 63 shown in Fig. 6 are input to the arithmetic code encoder, so that arithmetic operations represented by equations (1) are performed for the pixel of interest data D301 by an encoder 90, thus obtaining encoding data 92. Fig. 10 is a block diagram of the first, second, third, and fourth decoders 27, 28, 29, and 30 in Fig. 2. A decoding side also includes a prediction circuit similar to that in the encoder. A decoder 91 performs decoding arithmetic operations on the basis of a skew value Qd94 of the decoder, a less probable symbol LPSd97 from the LUT, and receiving data 95, thus obtaining decoding data 96. In the above embodiment, the degree of smoothness is adjusted in accordance with the weighting coefficient of the central value of the coefficients of the 3 x 3 low-pass filter. As another embodiment of sub-sampling, as shown in Fig. 11, when conversion data W is determined on the basis of original image data D A , D B , D C , and D D , W is given by: W = α₁D A + α₂D B + α₂D C + α₂ D D In this case, coefficients α₁ and α₂ can be changed to adjust the degree of smoothness and coding efficiency. In this case, If W ≧ T, output signal = 1 If W < T, output signal = 0 When α₁ >> α₂, a ratio of determination based on D A is increased, and coding efficient is improved. When α₁ = α₂, a smoothing effect for an image is improved. As described above, when images having progressively different resolutions are to be encoded, the degree of smoothness and a binary-encoding threshold value for an image before resolution conversion are adjusted. Therefore, quality and coding efficiency of an image to be transmitted in a first stage can be arbitrarily selected. The preferred embodiment of the present invention has been described. However, the present invention is not limited to this, and various changes and modifications may be made within the scope of the invention as defined by the claims.

Claims: An image encoding apparatus comprising: smoothing means (11) for smoothing a binary image to be encoded; binary-encoding means (12) using a threshold value for binary-encoding the image smoothed by said smoothing means; sampling mean (13) for sub-sampling the image binary-encoded by said binary-encoding means; and encoding means (23,24,25,26) for encoding the binary image sub-sampled by said sampling means, wherein the degree of smoothness of the image output by said smoothing means can be varied and the threshold value for the binary-encoding operation of said binary-encoding means is variable. An apparatus according to claim 1, wherein said smoothing means smoothes a pixel of interest using surrounding pixels. An apparatus according to claim 1, wherein the threshold value for the binary-encoding operation of said binary-encoding means changes in accordance with a change in degree of smoothness of said smoothing means. An image encoding apparatus comprising: first smoothing means (11) for smoothing a binary image to be encoded; first binary-encoding (12) means for binary-encoding the image smoothed by said first smoothing means; first sampling means (13) for sub-sampling the image binary-encoded by said first binary-encoding means to form an image having a first resolution; second smoothing mean (15) for smoothing the binary image sub-sampled by said first sampling means; second binary-encoding means (16) for binary encoding the image smoothed by said second smoothing means; second sampling means (17) for sub-sampling the image binary-encoded by said second binary-encoding means to form an image having a second resolution; and encoding means (23-26) for encoding the images having the first and second resolutions sub-sampled by said first and second sampling means, respectively, wherein the degree of smoothness of said first smoothing means is different from that of said second smoothing means, and the threshold value for a binary-encoding operation of said first binary-encoding means is different from that of said second binary-encoding means. An apparatus according to claim 4, wherein said first and second smoothing means smooth a pixel of interest using surrounding pixels. An apparatus according to claim 4, wherein the degrees of smoothness of said first and second smoothing means can be varied. An apparatus according to claim 6, wherein the threshold values of said first and second binary-encoding means change in accordance with a change in degree of smoothness of said first and second smoothing means, respectively.

Inventors: KATO SHIGEO, OHSAWA HIDEFUMI, YASUDA YASUHIKO, KATO, SHIGEO, OHSAWA, HIDEFUMI, YASUDA, YASUHIKO
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1989
Main classification: H04N1
IPC codes: H04N7, G06T3, H03M7, H04N1, G06T9