Image processing apparatus and method

Abstract: An image processing apparatus comprises: discriminating means for discriminating an effective size of input image data; compressing means for compressing the input image data; and means for controlling a compressing state of the compressing means in accordance with the effective size discriminated by the discriminating means.

Description: The present invention relates to an image processing method and apparatus having image compressing means. A page printer is known with an image processing apparatus having image compressing means and compressed image storing means. In such an image processing apparatus, the compression is performed at a predetermined compression ratio for an input image size. The above conventional apparatus, however, has the following drawbacks. When the input image size is large or when the memory size is relatively small, there is a fear such that when the compression is performed at a low compression ratio, the compressed image data cannot be completely stored into the compressed image storing means. On the contrary, when the compression is performed at a high compression ratio, in the case of a small image, the original image cannot be discriminated. Image processing systems of this type are widely used in page printer systems or the like. In such a page printer system, the image size is compressed to, for instance, a predetermined size and the compressed image data is recorded for every page. In the above case, the compressed image data is stored into the compressed image storing means. In the case where the compressed image data cannot be completely stored into the compressed image storing means, hitherto, such a state is informed to the user so as to again compress the image data at a further high compression ratio and to again input the compressed image data or the like. On the other hand, when the user wants to finally set the size of the compressed image to a certain fixed size, there is used a method whereby a parameter regarding the control of the compression ratio is fixed to a certain value and, after that, the image of, for example, one entire page is compressed to such a size and the image size is made approach a predetermined fixed size by repeating the above operation while changing the parameter. However, as in the above conventional image processing apparatus, in the case of using the method whereby when the compressed image data cannot be completely stored, the image data is further compressed at a higher compression ratio every time and the compressed image data is again inputted or a method whereby in order to fix the size of the entire input image into a predetermined size, the data regarding the whole image is repetitively compressed while changing the parameter, it takes a long time for such processes, it is troublesome, and difficult to use. JP-A-2122763 describes facsimile apparatus in which a compression ratio is selected to enable a transmission to be recorded on paper of a desired size. GB-A-2172767 describes an image signal processing system in which a controller keeps track of the available memory and adjusts the compression mode to allow an image to be stored in the available memory capacity. The English language abstract for JP-A-2-100487 describes an image data compressing device wherein original image data are divided into blocks and then compressed. The compression process is carried out so that amount of compression data for one screen is always approximately fixed or constant. According to the present invention, there is provided an image processing apparatus in accordance with claim 1. The present invention also provides an image processing method in accordance with Claim 12. An embodiment of the invention provides an image processing apparatus which can set a compression ratio at a high speed. An embodiment of the invention provides an image processing apparatus which can preferably execute the compression in accordance with a residual amount in an image memory to store compressed data. An embodiment of the invention, provides an image processing apparatus which detects a residual amount in an image memory and properly controls a compression ratio of image data in accordance with the residual amount. An embodiment of the invention provides an image processing apparatus which can preferably execute the compression in accordance with the number of input images to be printed. An embodiment of the invention provides a novel printer controller. An embodiment of the invention provides a novel compressing method using an orthogonal transformation. Embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which: Fig. 1 is a system constructional diagram of an image processing system according to an embodiment of the invention; Fig. 2 is a diagram showing an example of an image data format which is used in the embodiment; Fig. 3 is a flowchart showing an image compressing process in the embodiment; Fig. 4 is a block diagram showing a system construction according to the second embodiment of the invention; Fig. 5 is an explanatory diagram of a format of compressed image data in Fig. 4; Fig. 6 is a flowchart showing an operating procedure in the control upon image processing according to the second embodiment of the invention; Fig. 7 is a block diagram showing a detailed construction of a compressing unit; Fig. 8 is a diagram showing the details of a DPCM circuit 215; Fig. 9A and 9B are diagrams for explaining the operation of the compressing unit in Fig. 9; and Fig. 10 is a diagram showing an application example of the invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the invention will be described in detail hereinbelow with reference to the drawings. 〈Description of construction (Fig. 1)〉 Fig. 1 is a system constructional diagram showing an image processing apparatus according to the embodiment. In an image processing apparatus 1, a main control unit 3 comprises a CPU to control the whole image processing apparatus 1 of the embodiment in accordance with a program showing in Fig. 3, which will be explained hereinlater, and its peripheral circuits. Reference numeral 2 denotes an input control unit to execute an input control of input image data; 4 a main memory unit to store compressed data and the like in addition to the image processing program which is executed by the main control unit 3 mentioned above; 5 an image discriminating unit to discriminate the size of input image; and 6 a compression ratio setting unit to set a proper compression ratio from the image size discriminated by the image discriminating unit 5. The setting unit 6 sets a quantization matrix for compression, a compressing method, and the like. Reference numeral 8 denotes a compressed image storage unit comprising, for example, a magnetic disk apparatus or the like. The storage unit 8 stores the image compressed by a compressing unit 7 and generates compressed data as necessary. In the case of generating data, it is also possible to expand the data by an expanding unit 9 and to generate expanded data. 〈Data format (Fig. 2 )〉 An example of an image data format which is used in the image processing apparatus 1 with the above construction will now be described hereinbelow with reference to Fig. 2. As shown in the diagram, in the embodiment, image data is constructed by a header portion comprising frames 21 to 23 and an image body 24. The header portion (21 to 23) includes the vertical size frame 21 indicative of the size of image in the vertical direction, horizontal size frame 22 indicative of the size of image in the horizontal direction, and another frame 23 to write comments or other information. Information (image) which is written into the frame of the image body 24 relates to all of images which can be handled as digital data. 〈Description of processing procedure (Fig. 3)〉 A compressing process in the image processing apparatus 1 according to the embodiment will now be described hereinbelow with reference to a flowchart shown in Fig. 3. As mentioned above, the image processing apparatus 1 executes the following processes under the control of the main control unit 3 in accordance with the image processing program stored in the main memory unit 4. When an input image is supplied to the input control unit 2 and the image is detected by the input control unit 2, the process in step S1 is started. In step S1, the image discriminating unit 5 checks the size of kind frames 21 and 22 of the received image and discriminates a size A of the image. After the image size was discriminated, the processing routine advances to step S2. When an image size S is larger than a predetermined size value A, step S3 follows. When it is equal to or smaller than the value A, step S4 follows. In each of the steps S3 and S4, the compression ratio setting unit 6 selects the compression ratio according to the image size. In step S2, the discriminating value can be further made fine and the compression ratio can be also more finely set. In step S5, the input image is compressed at the compression ratio set in step S3 or S4. The compressed image is stored into the compressed image storage unit 8 in step S6. In the case where a plurality of images are supplied to the input control unit 2, the sizes of those plurality of images are added and the total synthesized image size is judged. The compression ratio setting unit 6 sets the compression ratio in accordance with such an image size. As described above, according to the embodiment, the input image is compressed at the compression ratio according to the input image size and stored into the compressed image storing means, so that the image can be compressed at a proper compression ratio and the storing means can be effectively used. In the above embodiment, the image discriminating unit 5 checks the size kind frames 21 and 22 of the received image. In place of them, however, it is also possible to construct in a manner such that data indicative of an effective area to be stored into the memory is supplied independently of the size of the received image and the compression ratio setting unit 6 automatically sets the compression ratio on the basis of the data indicative of such an effective area. That is, designating means A such as a digitizer or the like for manually designating the effective area to be stored in the received image is provided, only the data in the area designated by the designating means is stored into the memory, and the compression ratio setting unit 6 sets the compression ratio in accordance with the size of area designated as mentioned above. The second embodiment of the invention will now be practically explained in detail. Fig. 4 shows an example of a construction according to the first format of the invention. Reference numeral 11 denotes an image processing apparatus; 12 an input control unit to execute controls regarding compression and expansion for compressed image data which is supplied to the image processing apparatus 11; 13 a main control unit which has a function of a CPU and includes a procedure, which will be explained hereinlater, and controls the whole apparatus 11 in accordance with each program stored in a main memory unit 14 in the ROM; 15 a compressed image storage unit constructed by a magnetic disk or the like; and 16 a size discriminating unit to discriminate the size of compressed image data which is supplied to the apparatus 11. Further, in the embodiment, the image processing apparatus 11 has an image expanding unit 17 and an image compressing unit 18. The image expanding unit 17 has a function to expand the compressed image into the image of the original size in the case where the compressed image data which has been supplied cannot be completely stored into a memory area of the memory size which is available in the compressed image storage unit 15. On the other hand, a quantization matrix and a method for compression are set by the image compressing unit 18. The image compressing unit 18 has a function to again compress the image expanded by the image expanding unit 17 by applying a compression ratio at which the compressed data can be stored into the compressed image storage unit 15. Fig. 5 shows an example of a format of the compressed image data which is supplied to the image processing apparatus 11 of the embodiment. That is, in the format according to the example, each data is constructed by an arrangement of frames 121 to 123. Reference numeral 121 denotes the size frame indicative of the data size of the compressed image which is supplied; 122 the note frame in which comments to the input image and other information are written; and 123 the image storage frame in which the compressed image is stored. An operating procedure of the input compressed image process according to the embodiment will now be described in accordance with Fig. 6 with reference to Figs. 4 and 5. The following procedure is stored in the main memory unit 14 in the ROM. First, when the image data is supplied to the input control unit 12, the input control unit 12 discriminates the data size written in the frame 121 in step S1 on the basis of the format of the input image data. When it is determined that the data size is equal to A, the size discriminating unit 16 compares the size A and a size B (hereinafter, referred to as a memory size) at which the compressed data can be stored into the compressed image storage unit 15, thereby discriminating whether A > B or not in step S2. If NO in step S2, namely, when it is determined that the input image data size A is equal to or less than the memory size B at which the data can be stored, step S5 follows and the input compressed image is directly stored into the storage unit 15. That is, the image data is directly stored into the storage unit 15 without compressing. When it is decided in step S2 that the data cannot be stored, step S3 follows and the input compressed image is expanded to the image of the original size by the image expanding unit 17. In step S4, the expanded image is again compressed by the image compressing unit 18 at a compression ratio such as to be matched with the memory size B. After that, the processing routine advances to step S5 and the compressed image data is stored into the storage unit 15. In the above procedure, the image data is compressed by using the compression ratio such as to be matched with the memory size B in step S4. However, such a compression ratio can be also previously fixed to a value such that the data is compressed to the data of a size which is equal to or smaller than the memory size B. In the image processing apparatus with the above construction, there is no need to execute complicated operations such that for the compressed image which is supplied, the user checks to see if it can be stored into the compressed image storage unit or not and, in the case where it cannot be stored, the image data further compressed by a new compression ratio is again stored into the storage unit. As described above, according to Fig. 4, the image processing apparatus comprises: the discriminating means for discriminating the data size of the compressed image data; the means for expanding the compressed image data into the image data before the compression in the case where it is determined that the data size of the compressed image data discriminated by the discriminating means is larger than the memory size in the storing means; and the compressing means for again compressing the expanded image data to the image data such that it can be stored into the storing means. Therefore, there is no need to execute the troublesome procedure such that each time the compressed image is supplied, a check is made to see if the image can be stored into the storing means or not and that the compressed image data is again stored. An image processing apparatus which can be easily used by the user is thus provided. Constructions of the compressing unit 7 and compressed image storage unit 8 in the embodiment will described with reference to Fig. 7. Fig. 7 is a block diagram showing a practical construction example of the compressing unit 7. The embodiment shows a coding section of the Baseline System as an international standardization idea for encoding a color still image which has been proposed in JPEG (Joint Photographic Expert Group) as a group work organization of ISO and CCITT. Image data of every pixel supplied from a signal line 103 is cut out into blocks of 8 x 8 pixels by a block formation circuit 211 which is constructed by line memories of a few lines and cosine transformed by a discrete cosine transforming (DCT) circuit 212. Transformation coefficients are supplied to a quantizer (Q) 213. The quantizer 213 executes a linear quantization of the transformation coefficients in accordance with quantization step information which is supplied from a quantization table 214. For instance, the transformation coefficients are divided by the value indicative of the quantization step. Among the quantized transformation coefficients, the DC coefficient is supplied to a predictive coding circuit (DPCM) 215, by which a difference (prediction error) between the DC coefficient and the DC component of the preceding block is calculated and supplied to a one-dimensional HUFFMAN encode circuit 216. Fig. 8 is a detailed block constructional diagram of the DPCM 215. The DC coefficient quantized by the quantizer 213 is supplied to a delay circuit 225 and a subtracter 226. The delay circuit 225 delays the input signal by only a time necessary for the DCT circuit 212 to calculate one block, namely, 8 x 8 pixels. Therefore, the DC coefficient of the preceding block is supplied from the delay circuit 225 to the subtracter 226. Thus, a difference (prediction error) between the preceding block and the DC coefficient is generated as an output signal of the subtracter 226. In the predictive encoding, since the preceding block value is used as a prediction value, the predictor is constructed by the delay circuit as mentioned above. The HUFFMAN encode circuit 216 variable length encodes the prediction error signal supplied from the DPCM 215 in accordance with a DC HUFFMAN code table 217 and supplies a DC HUFFMAN code to a multiplexer circuit 224. On the other hand, AC coefficients (coefficients other than the DC coefficient) quantized by the quantizer 213 are sequentially zig-zag scanned from the lower-degree coefficient by a scan conversion circuit 218 as shown in Fig. 9A and are supplied to a significant coefficient detection circuit 219. The detection circuit 219 discriminates whether the quantized AC coefficients are equal to "0" or not. When they are "0", a count-up signal is supplied to a run length counter 220, thereby increasing a count value of the counter by "+1". On the other hand, in the case of the coefficients other than "0", a reset signal is supplied to the run length counter 220, thereby resetting the count value of the counter. The coefficients are divided into a group numbers SSSS and additional bits by a group formation circuit 221 as shown in Fig. 9 B. The group numbers SSSS are supplied to a two-dimensional HUFFMAN encode circuit 222 and the additional bits are supplied to the multiplexer circuit 224, respectively. The run length counter 220 is a circuit to count a run length of "0" and supplies the number NNNN of "0" between the significant coefficients other than "0" to the two-dimensional HUFFMAN encode circuit 222. The HUFFMAN encode circuit 222 variable length encodes the run length NNNN of "0" and the group numbers SSSS of the significant coefficients supplied in accordance with an AC HUFFMAN code table 223 and supplies an AC HUFFMAN code to the multiplexer circuit 224. The multiplexer circuit 224 multiplexes the DC HUFFMAN codes, AC HUFFMAN codes, and additional bits of one block (8 x 8 input pixels) and generates the compressed image data from a signal line 104. Therefore, by storing the compressed data supplied from the signal line 104 into a memory and by expanding the compressed data by the opposite operation upon compression mentioned above in the reading mode, the memory capacity can be reduced. In the above embodiment, by controlling the quantization coefficients by the quantizer 213, the data amount after the encoding was finally performed can be controlled. That is, when the quantization step is increased, the level of the output of the DCT circuit 212 which is divided by the value indicative of such a quantization step decreases. Consequently, the value of the quantized AC coefficient decreases and the frequency of appearance of "0" rises and the data amount after completion of the HUFFMAN encoding can be relatively reduced. In the above embodiment, accordingly, in the case where, for instance, the image size discriminated by the image discriminating unit 5 in Fig. 1 is relatively large, the compression ratio setting unit sets the value indicative of the above quantization step to a large value, so that a high compression ratio can be obtained. A construction of a printer controller as an example of an apparatus in which the image processing apparatus according to the foregoing embodiment is assembled will now be described with reference to Fig. 10. Fig. 10 is a diagram showing a whole construction of such an apparatus. In Fig. 10 reference numeral 200 denotes an image input unit including a host computer. Image data supplied from the image input unit 200 is sent to an input terminal of an image storage unit 201 in each of the above embodiments. Reference numeral 202 denotes an operation unit which is used by the operator to designate an output destination side of the image data or the like; 203 an output control unit to execute the selection of the output destination side of the image data, the generation of a sync signal to read out the image data from a memory, and the like; 204 an image display unit such as a display or the like; 205 a transmission unit to transmit the image data through a public line (including a digital line) or a local area network (LAN); and 206 an image output unit such as a laser beam printer or the like to form a latent image by, for example, irradiating a laser beam onto a photo sensitive material and to obtain a visible image. The image output unit 206 may be any one of the ink jet printer, thermal copy transfer printer, dot printer, and the like. The sync signal is synchronized with, for instance, a BD signal to detect the scanning state of the laser beam of the image output unit 206. Or, the image output unit 206 may be also what is called a bubble jet type printer using a head of the type in which a liquid droplet is discharged by causing a film boiling due to a thermal energy. The invention is not limited to only the above embodiments but can be also applied to, e.g., an apparatus to record an image signal to a medium such as electronic file, video recorder, video camera, or the like.

Claims: An image processing apparatus comprising: input means (2) for inputting an image data signal including image data representing an image; and compression means (7) for compressing the image data, characterised by: determining means (5) for determining the effective size of image data included in an image data signal prior to compression from effective size data which is associated with the image data and indicates the effective size of that image data; compression ratio setting means (6) for setting the ratio by which the compression means is arranged to compress the image data; and control means (3) for causing the compression ratio setting means (6) to set the compression ratio in accordance with the effective size of said image data determined by said determining means (5) and for causing the compression means to compress said image data using the compression ratio set by the compression ratio setting means (6). An apparatus according to claim 1, wherein said effective size data indicates image size in a vertical direction. An apparatus according to claim 1 or 2, wherein said effective size data indicates image size in a horizontal direction. An apparatus according to any one of claims 1 to 3, wherein said compressing means (7) is arranged to compress the data by executing an orthogonal transformation on the input image data. An apparatus according to claim 4, wherein the control means (3) is arranged to control the compressing state by controlling a quantization value to quantize the data after completion of the orthogonal transformation. An apparatus according to any one of claims 1 to 5, further comprising means for storing the data compressed by said compressing means (7). An apparatus according to claim 6, further comprising means for expanding the compressed data stored in said storing means. An apparatus according to claim 7, wherein the expanding means is adapted to expand the compressed data when the data size is greater than the memory size of the storing means and the compressing means (7) is adapted to recompress the expanded data to enable it to be stored in the storing means. An apparatus according to claim 6, 7 or 8, further comprising means for supplying the compressed data stored in said storing means to a printer. An apparatus according to any one of claims 1 to 9, wherein said discriminating means (5) is arranged to discriminate a total size of a plurality of input images. An image processing apparatus according to any one of the preceding claims, further comprising: user-operable means for selecting a part of the input image data; means for allowing said compressing means (7) to compress the selected part of the input image data without compressing the whole input image data; and means for controlling a compressing state of the compressing means (7) in accordance with the size of the selected part of the input image data. A method of processing an image data signal including image data representing an image, which method comprises compressing the image data using compression means (7), characterised by: determining the effective size of image data included in an image data signal prior to compression from effective size data which is associated with the image data and indicates the effective size of that image data; setting the ratio by which the compression means is arranged to compress the image data in accordance with the determined effective size of said image data; and compressing said image data using the set compression ratio. A method according to claim 12, which comprises compressing the data by executing an orthogonal transformation on the input image data. A method according to claim 13, which comprises controlling the compressing means by controlling a quantization value to quantize the data after completion of the orthogonal transformation. A method according to any one of claims 12 to 14, further comprising storing the data compressed by said compressing means (7) in storing means. A method according to claim 15, further comprising expanding the compressed data stored in said storing means. A method according to claim 16, which comprises expanding the compressed data when the data size is greater than the memory size of the storing means and then recompressing the expanded data to enable it to be stored in the storing means. A method according to claim 15, 16 or 17, further comprising supplying the compressed data stored in said storing means to a printer. A method according to any one of claims 12 to 18, further comprising: selecting a part of the input image data using user-operable means; causing said compressing means (7) to compress the selected part of the input image data without compressing the whole input image data; and controlling a compressing state of the compressing means (7) in accordance with the size of the selected part of the input image data.

Inventors: OHKI JOJI, OHKI, JOJI, Ohki, Joji, c/o Canon Kabushiki Kaisha
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06T3
IPC codes: H04N1, H04N7, G06T9