This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2016-052655 filed Mar. 16, 2016.
The present invention relates to an image processing apparatus and a non-transitory computer readable medium.
According to an aspect of the embodiments of the present invention, there is provided an image processing apparatus comprising a splitting unit that splits an image into a block; a quantization unit that performs quantization of the block using a plurality of methods; a calculating unit that calculates a distance between the block and a result of the quantization; a selecting unit that selects a quantization result of the quantization unit using the distance; and an encoding unit that performs fixed-length encoding of the quantization result selected by the selecting unit, wherein the quantization unit includes a first quantization unit that preserves texture in the block, and a second quantization unit that represents pixels in the block in a plurality of colors.
Exemplary embodiments of the present invention will be described in detailed based on the following figures, wherein:
Hereinafter, an example of various exemplary embodiments for realizing the present invention will be described based on the drawings.
A module generally refers to a logically separable component of software (computer program), hardware, and the like. Therefore, a module in the present exemplary embodiment refers to not only a module in a computer program but also a module in a hardware configuration. Accordingly, the present exemplary embodiment describes a computer program that provides functionality as modules (a program that causes a computer to execute individual procedures, a program that causes a computer to function as individual units, or a program that causes a computer to realize individual functions) and a system and a method as well. While the terms “store” and “stored” and the equivalents thereof are used for convenience of description, these terms mean storing in a storage device or controlling to store in a storage device in a case where the exemplary embodiment is a computer program. Modules may correspond one-to-one to functions.
In implementation, one module may be configured of one program, multiple modules may be configured of one program, or conversely one module may be configured of multiple programs. Multiple modules may be executed by one computer.
One module may be executed by multiple computers that are computers in a distributed or parallel environment. One module may include another module. Hereinafter, the term “connection” will be used in a case of logical connection (data exchange, instructions, reference relationships among data, and the like) in addition to physical connection. The term “predetermined” will refer to being determined before a target process and is used to include the meaning of being determined in accordance with the status or the state at or until the point in time before not only the start of processes of the present exemplary embodiment but also before a target process even if processes of the present exemplary embodiment are started. A “predetermined value”, if existing in multiple numbers, may be a different value from each other, or two or more values (apparently includes all values) may be the same. A description having the meaning of “B is performed in a case where A is true” will be used to mean “a determination as to whether or not A is true is performed and B is performed in a case where A is determined to be true”. Exceptions are made in a case where a determination as to whether or not A is true is not required.
A system or an apparatus is not only configured by connecting multiple computers, hardware, devices, and the like with a communication unit such as a network (includes one-to-one communication connection) but also is realized by one computer, hardware, device, or the like. The terms “apparatus” and “system” will be used as terms having the same definition. Apparently, “system” does not include a system that is limited to a social “structure” (social system) which is artificial agreement.
Information of a target will be read from a storage device in each process performed by each module or in each process in a case where multiple processes are performed in a module, and the process result will be written to the storage device after the process is performed. Therefore, reading from the storage device before the process and writing to the storage device after the process may not be described. The storage device referred hereto may include a hard disk, a random access memory (RAM), an external storage medium, a storage device connected through a communication line, a register in a central processing unit (CPU), and the like.
A compressing device 100 of an image processing apparatus that is the first exemplary embodiment compresses an image 105 and, as illustrated in
The block splitting module 110 of the compressing device 100 is connected to the multiple quantization module 115 and the feature extracting module 120 and receives the image 105 and passes a block 112 to the multiple quantization module 115 and the feature extracting module 120. The block splitting module 110 splits the image 105 into blocks. Receiving images includes, for example, reading images with a scanner, a camera, and the like, receiving images with a facsimile and the like from an external machine through a communication line, reading images that are stored in a hard disk (includes a network-connected hard disk and the like in addition to a hard disk incorporated in a computer), receiving print images from other information processing apparatuses, and the like. The image is a multivalued image (includes a color image). The received image may be one or more in number. The content of the image may be a document used for business, an advertising pamphlet, and the like. The block has a rectangular shape and generally a square shape but is not limited thereto.
The example illustrated in
The multiple quantization module 115 is connected to the block splitting module 110 and the selecting module 125 and receives the block 112 from the block splitting module 110 and passes a quantization result 117 to the selecting module 125. The multiple quantization module 115 quantizes the block 112, which is split by the block splitting module 110, using multiple methods. The “multiple methods” are different from each other. For example, the multiple quantization module 115 may perform quantization using multiple methods in such a manner that the resolution and the tone have a trade-off relationship in the quantization result. In this case, the quantization result 117 includes multiple representations in which the resolution and the tone of the block 112 are traded off. The “trade-off relationship” refers to an antinomic relationship and refers to a relationship in which the tone is required to be decreased in order to increase the resolution while the resolution has to be decreased in order to increase the tone.
The examples illustrated in
The feature extracting module 120 is connected to the block splitting module 110 and the selecting module 125 and receives the block 112 from the block splitting module 110 and passes a feature 122 to the selecting module 125. The feature extracting module 120 extracts a feature of the block 112 that is split by the block splitting module 110. Features are extracted for each block. The feature extracting module 120, for example, may extract the dynamic range of the block 112 as a feature. The dynamic range refers to the width (the width defined by the maximum value and the minimum value) of a pixel value in a block of a target.
The selecting module 125 is connected to the multiple quantization module 115, the feature extracting module 120, and the fixed-length encoding module 130 and receives the quantization result 117 from the multiple quantization module 115 and the feature 122 from the feature extracting module 120 and passes an “ID+quantization result” 127 to the fixed-length encoding module 130. The selecting module 125 selects the quantization result 117 of the multiple quantization module 115 that corresponds to the feature 122 extracted by the feature extracting module 120. That is, one quantization result that corresponds to one block is selected from multiple quantization results. A result of the selecting process may include, in addition to the quantization result, an identification (ID) that is information indicating a quantization method or a representation method for the quantization result.
The fixed-length encoding module 130 is connected to the selecting module 125 and receives the “ID+quantization result” 127 from the selecting module 125 and outputs the code 132. The fixed-length encoding module 130 performs fixed-length encoding of the quantization result selected by the selecting module 125. The fixed-length encoding module 130 may perform fixed-length encoding of the “ID+quantization result” 127 selected by the selecting module 125. Since fixed-length encoding is performed, the code 132 for one block has a constant length. Fixed-length encoding may use an existing technology. Examples of process results of the fixed-length encoding module 130 are illustrated in
The bit representation includes 16 contiguous pixels, each of which has 8 bits (total 128 bits). The example illustrated in
The bit representation includes 16 contiguous pixels, each of which has one bit as a representative value, and two bits added as the ID (ID0: 00) (total 18 bits). The number of bits of the ID is preferably greater than or equal to the number of bits that allows representation of the number of types of the ID. Two bits are used in these examples since three types ID0, ID1, and ID2 are illustrated. The example illustrated in
The bit representation includes four contiguous pixels, each of which has four bits as a representative value, and two bits added as the ID (ID1: 01) (total 18 bits). The example illustrated in
The bit representation includes two contiguous pixels, each of which has 8 bits as a representative value, and two bits added as the ID (ID2: 10) (total 18 bits). The positional relationship between the result of the fixed-length encoding process and the ID may be different from those illustrated (for example, the ID is inserted at the head of the result).
The fixed-length decoding module 155 of the expanding device 150 is connected to the identifying module 160 and receives the code 132 and passes an “ID+quantization result” 157 to the identifying module 160. The fixed-length decoding module 155 decodes the code 132. Apparently, decoding corresponds to fixed-length encoding. A decoding result is the quantization result. The “ID+quantization result” 157 is the quantization result in a case where the above ID is included in the code 132.
The identifying module 160 is connected to the fixed-length decoding module 155 and the inverse quantization module 165 and receives the “ID+quantization result” 157 from the fixed-length decoding module 155 and passes a quantization result 162 to the inverse quantization module 165. The identifying module 160 obtains the above ID from the “ID+quantization result” 157.
The inverse quantization module 165 is connected to the identifying module 160 and receives the quantization result 162 from the identifying module 160 and outputs the image 195. The inverse quantization module 165 performs inverse quantization of the quantization result 162 to restore the original image. The inverse quantization of the quantization result 162 is performed according to the above ID to restore the original image in a case where the ID is included in the quantization result 162. The inverse quantization method corresponds to the quantization method that generates the quantization result selected by the selecting module 125.
One of the examples illustrated in
The example illustrated in
A fixed-length representation in which the resolution and the tone are traded off according to the feature of the block is selected. Accordingly, for example, the ID has two bits, the quantization result has 16 bits, and total 18 bits [blocks] (16×8/18=7.11) are encoded as the code 132 (refer to the above examples illustrated in
The inverse quantization module 165 outputs the restored image 195. Outputting an image includes, for example, printing the image using a printing device such as a printer, displaying the image on a display device such as a display, sending the image using an image sending device such as a facsimile, writing the image to an image storage device such as an image database, storing the image in a storage medium such as a memory card, and passing the image to other information processing apparatuses.
The principle of the exemplary embodiment will be described by using the example of
It is determined through research by the inventor that the original image can be sufficiently reproduced when trade-offs are made along the resolution axis and the tone axis for each block of a target. The present exemplary embodiment uses this result and performs fixed-length representation in which the resolution (the size of a sub-block represented flat) and the tone (the number of bits) are traded off for each block.
The first row of the example of
The second row of the example of
The third row of the example of
The fourth row of the example of
That is, although quantization may not deal with all of a character, a gray character, and a gradation in terms of image quality, some can be dealt with in terms of image quality when quantization is performed with high resolution and fewer tones, medium resolution and medium tones, and low resolution and more tones. These types of quantization are appropriately used according to the feature of the block. Apparently, quantization that is performed differently from the examples in
In Step S402, the block splitting module 110 receives the image 105.
In Step S404, the block splitting module 110 blocks the image 105.
In Step S406, the multiple quantization module 115 quantizes the block 112 into multiple representations in which the resolution and the tone are traded off. A detailed process example will be described later by using
In Step S408, the feature extracting module 120 extracts the feature 122 of the block 112.
In Step S410, the selecting module 125 selects one from multiple quantization results 117 according to the feature 122. A detailed process example will be described later by using
In Step S412, the fixed-length encoding module 130 performs an encoding process.
In Step S414, the fixed-length encoding module 130 sends the code 132 to the expanding device 150.
The example illustrated in
In Step S522, a sub-sampling process is performed. The example illustrated in
In Step S524, the tone is simply quantized. The example illustrated in
In Step S532, the average value of sub-blocks is calculated. The example illustrated in
In Step S534, the tone is simply quantized. The example illustrated in
Quantization with low resolution and more tones can be performed by equivalent processes.
Quantization with high resolution and fewer tones may be performed by an existing binarizing process.
The first row of the feature and quantization ID correspondence table 600 indicates high resolution and fewer tones (black and white) in a case where the dynamic range is equal to 255 (refer to
The second row indicates medium resolution and medium tones in a case where the dynamic range is 16 to 254 (refer to
The third row indicates low resolution and more tones in a case where the dynamic range is less than 16 (refer to
The selecting module 125 searches for the D range field 610 corresponding to the feature 122 and extracts the corresponding ID field 620. One of the multiple quantization results 117 is selected according to the ID.
In Step S702, the fixed-length decoding module 155 receives the code 132.
In Step S704, the fixed-length decoding module 155 performs a decoding process.
In Step S706, the identifying module 160 identifies the ID for inverse quantization.
In Step S708, the inverse quantization module 165 performs inverse quantization. The inverse quantization is performed according to the ID by using the above feature and quantization ID correspondence table 600.
In Step S710, the inverse quantization module 165 outputs the image 195.
The example illustrated in
The drawing device 810 is connected to the compressing device 100. The drawing device 810 generates an image to be printed.
The compressing device 100 is connected to the drawing device 810 and the storage device 820. The compressing device 100 compresses the image.
The storage device 820 is connected to the compressing device 100 and the expanding device 150. The storage device 820 stores a code that results from compression by the compressing device 100.
The expanding device 150 is connected to the storage device 820 and the printer 830. The expanding device 150 expands the code in the storage device 820 to restore the image.
The printer 830 is connected to the expanding device 150. The printer 830 prints the image restored by the expanding device 150.
Data has to be continuously transferred without delay with respect to a printing speed in a case where, for example, the printer 830 is a continuous printer, since a paper roll cannot be stopped. Thus, assuring a compression ratio and achieving a high compression/expansion speed are required. There exist two types of compression (encoding), variable-length encoding and fixed-length encoding.
For a high-resolution (for example, 1,200 dpi) continuous printer, assuring a compression ratio in variable-length encoding is not realistic since a high speed (for example, approximately a few [GB/s]) is required. That is, since the amount of encoding is not determined when trials are not performed in variable-length encoding, it is difficult to guarantee a compression ratio, and it is also difficult to segment codes at the time of expansion. Thus, a fixed-length encoding process is mostly performed in a high-speed printer.
The example illustrated in
A compressing device 100A, a compressing device 100B, an expanding device 150A, an expanding device 150B, an expanding device 150C, and an expanding device 150D are connected to each other through a communication line 890. The communication line 890 may be a wireless type, a wired type, or a combination thereof and may be, for example, the Internet as a communication infrastructure. Examples of the expanding device 150 include a mobile terminal, a PC, a printer, and the like.
The expanding device 150 reproduces images compressed by the compressing device 100.
A compressing device 900 includes the block splitting module 110, the multiple quantization module 115, a pattern extracting module 920, the feature extracting module 120, the selecting module 125, and the fixed-length encoding module 130. The same parts as those of the above exemplary embodiment will be designated by the same reference signs, and duplicate descriptions thereof will not be provided (the same applies hereinafter). An expanding device that corresponds to the compressing device 900 has the same configuration as the expanding device 150 of the first exemplary embodiment.
The compressing device 900 of the second exemplary embodiment uses a post-quantization pixel value pattern in order to increase the accuracy of ID selection. For example, while ID=1 is a representation that prioritizes resolution more than does ID=2 (by sacrificing the tone), the representation may not achieve high resolution according to circumstances. In order to prevent this, the compressing device 900 performs the selection by using a combination of the dynamic range and the post-quantization pattern (histogram).
The multiple quantization module 115 is connected to the block splitting module 110, the selecting module 125, and the pattern extracting module 920 and receives the block 112 from the block splitting module 110 and passes the quantization result 117 to the pattern extracting module 920 and the selecting module 125.
The pattern extracting module 920 is connected to the multiple quantization module 115 and the selecting module 125 and receives the quantization result 117 from the multiple quantization module 115 and passes a post-quantization pattern 922 to the selecting module 125. The pattern extracting module 920 extracts the form (hereinafter, referred to as a pattern as well) of the quantization result 117 of the multiple quantization module 115.
The selecting module 125 is connected to the multiple quantization module 115, the pattern extracting module 920, the feature extracting module 120, and the fixed-length encoding module 130 and receives the quantization result 117 from the multiple quantization module 115, the post-quantization pattern 922 from the pattern extracting module 920, and the feature 122 from the feature extracting module 120 and passes the “ID+quantization result” 127 to the fixed-length encoding module 130. The selecting module 125 selects the quantization result 117 that corresponds to the post-quantization pattern 922 extracted by the pattern extracting module 920 and to the feature 122 extracted by the feature extracting module 120.
Pixel values in a quantization result can be classified into one-color, two-color, three-color, and four-color as patterns. The two-color includes an equal split of the entirety (the right-side example of “not improved” in the examples of
The example of
Specifically, for example, the selecting module 125 makes determination using a feature and pattern correspondence table 1100.
Either the ID1 or the ID2 is used according to a pattern in a case where the dynamic range is 16 to 254 in the example of the feature and pattern correspondence table 1100 (the ID1 is selected in accordance with the feature and quantization ID correspondence table 600 in the first exemplary embodiment).
A compressing device 1200 includes the block splitting module 110, the multiple quantization module 115, a distance calculating module 1220, the feature extracting module 120, the selecting module 125, and the fixed-length encoding module 130.
The compressing device 1200 of the third exemplary embodiment changes the form of representation of the resolution even if the tone is the same. An ID3 is added to the IDs of the first exemplary embodiment as illustrated in the example of
The multiple quantization module 115 is connected to the block splitting module 110, the selecting module 125, and the distance calculating module 1220 and receives the block 112 from the block splitting module 110 and passes the quantization result 117 to the distance calculating module 1220 and the selecting module 125.
The distance calculating module 1220 is connected to the block splitting module 110, the multiple quantization module 115, and the selecting module 125 and receives the block 112 from the block splitting module 110 and the quantization result 117 from the multiple quantization module 115 and passes a distance 1222 to the selecting module 125. The distance calculating module 1220 calculates the distance between the block 112, which is split by the block splitting module 110, and the quantization result 117 of the multiple quantization module 115. For example, Equation (1) is used to calculate distances in a multivalued image. In Equation (1), P denotes a pixel value of an original image, Q denotes a pixel value of a quantization result, and an index i denotes the coordinate position of a pixel.
where P and Q are pixel values within the respective images (multiple values)
The selecting module 125 is connected to the multiple quantization module 115, the distance calculating module 1220, the feature extracting module 120, and the fixed-length encoding module 130 and receives the quantization result 117 from the multiple quantization module 115, the distance 1222 from the distance calculating module 1220, and the feature 122 from the feature extracting module 120 and passes the “ID+quantization result” 127 to the fixed-length encoding module 130. The selecting module 125 selects the quantization result 117 that corresponds to the distance 1222 calculated by the distance calculating module 1220 and to the feature 122 extracted by the feature extracting module 120. Specifically, for example, processes that are equivalent to those of the first exemplary embodiment may be performed.
A distance E in a case of the ID2 may be compared with that in a case of the ID3 in a case where the IDs of the same resolution are selected, and the ID having a smaller value of the distance E may be selected.
The third exemplary embodiment may be combined with the second exemplary embodiment. That is, the distance calculating module 1220 may be added to the compressing device 900.
In that case, a determination as to whether or not to perform processes of the distance calculating module 1220 may be performed in accordance with a form identifier and representative pixel value definition table 1300.
The processes of the distance calculating module 1220 may be performed in a case where such quantization results exist (for example, in a case where the ID2 and the ID3 exist), and the selecting module 125 may perform determination using the distance 1222 as well. The processes of the distance calculating module 1220 may not be performed in a case where such quantization results do not exist, and the selecting module 125 may perform determination using the feature 122 and the post-quantization pattern 922.
A compressing device 1400 includes a block splitting module 1410, a feature extracting module 1415, a selecting module 1420, a quantization module 1425, and a fixed-length encoding module 1430.
The block splitting module 1410 is connected to the feature extracting module 1415 and the quantization module 1425 and receives an image 1405 and passes a block 1412 to the feature extracting module 1415 and the quantization module 1425. The block splitting module 1410 performs processes equivalent to those of the block splitting module 110. That is, the image 1405 is split into blocks.
The feature extracting module 1415 is connected to the block splitting module 1410 and the selecting module 1420 and receives the block 1412 from the block splitting module 1410 and passes a feature 1417 to the selecting module 1420. The feature extracting module 1415 performs processes equivalent to those of the feature extracting module 120. That is, the feature of the block 1412 is extracted.
The selecting module 1420 is connected to the feature extracting module 1415 and the quantization module 1425 and receives the feature 1417 from the feature extracting module 1415 and passes an ID 1422 to the quantization module 1425. The selecting module 1420 selects a quantization technique (ID) that corresponds to the feature 1417 extracted by the feature extracting module 1415. One quantization technique is selected from multiple quantization techniques that place the resolution and the tone in the quantization result into a trade-off relationship. A selecting process that is equivalent to that of the selecting module 125 is performed. A selection target is the quantization technique and not the quantization result.
The quantization module 1425 is connected to the block splitting module 1410, the selecting module 1420, and the fixed-length encoding module 1430 and receives the block 1412 from the block splitting module 1410 and the ID 1422 from the selecting module 1420 and passes an “ID+quantization result” 1427 to the fixed-length encoding module 1430. The quantization module 1425 quantizes the block 1412, which is split by the block splitting module 1410, using the quantization technique (ID 1422) selected by the selecting module 1420.
The fixed-length encoding module 1430 is connected to the quantization module 1425 and receives the “ID+quantization result” 1427 from the quantization module 1425 and outputs a code 1432. The fixed-length encoding module 1430 performs processes equivalent to those of the fixed-length encoding module 130. That is, fixed-length encoding is performed of the “ID+quantization result” 1427 of the quantization module 1425 to output the code 1432.
The BTC disclosed in JP-A-2009-094619 is a fixed-length compression method that represents a block with two types of representative values and in the form of a BTC pattern. The BTC pattern requires 1 [bit/pixel] and a representative value of 8 bits×2=16 [bits] per block. For example, a 4-pixel×4-pixel block (16 pixels) has 8 bits×16 pixels=128 [bits/block] and is compressed to have 1×16+16=32 [bits/block].
Thus, the compression ratio is 128/32=4.
Exemplary embodiments (the fifth and subsequent exemplary embodiments) described in the examples below convert a block into a fixed-length representation according to the feature thereof and thereby reduces image quality deterioration and realizes encoding at a higher compression ratio than the technology disclosed in JP-A-2009-094619. A compressing device 1500 converts a block into a texture-preserving representation or a two-color representation. The texture-preserving representation preserves any texture. The two-color representation represents an image in two colors in any form.
The compressing device 1500 of an image processing apparatus that is the fifth exemplary embodiment compresses an image 1505. An expanding device 1550 of the image processing apparatus that is the fifth exemplary embodiment decodes a code 1537 that is compressed by the compressing device 1500, to generate an image 1595. The fifth exemplary embodiment adds a process of improving the image quality such as character edges and fine lines, compared with the first exemplary embodiment (the first exemplary embodiment to the fourth exemplary embodiment).
The compressing device 1500 includes a block splitting module 1510, a texture-preserving representation converting module 1515, a two-color representation converting module 1520, a distance calculating module 1525, a selecting module 1530, and a fixed-length encoding module 1535.
The block splitting module 1510 receives the image 1505 and is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, and the distance calculating module 1525. The block splitting module 1510 performs processes equivalent to those of the block splitting module 110 of the first exemplary embodiment. The image 1505 is split into blocks. The block is quantized by using multiple methods (two methods in this example).
The texture-preserving representation converting module 1515 is connected to the block splitting module 1510, the distance calculating module 1525, and the selecting module 1530. The texture-preserving representation converting module 1515 quantizes the block split by the block splitting module 1510 in order to preserve the texture in the block.
The two-color representation converting module 1520 is connected to the block splitting module 1510, the distance calculating module 1525, and the selecting module 1530. The two-color representation converting module 1520 represents pixels in the block, which is split by the block splitting module 1510, in multiple colors. The block is quantized into a two-color representation.
Since the texture-preserving representation converting module 1515 and the two-color representation converting module 1520 limit types of representation, the amount of encoding is decreased.
The distance calculating module 1525 is connected to the block splitting module 1510, the texture-preserving representation converting module 1515, the two-color representation converting module 1520, and the selecting module 1530. The distance calculating module 1525 calculates the distance between the block and the quantization result (a quantization result of the texture-preserving representation converting module 1515 and a quantization result of the two-color representation converting module 1520). The distance calculating module 1525 performs processes equivalent to those of the distance calculating module 1220 of the third exemplary embodiment. In this case, there exist two types of distances including the distance between the block and the quantization result of the texture-preserving representation converting module 1515 and the distance between the block and the quantization result of the two-color representation converting module 1520. The distance between the block and the block converted into a fixed-length representation may be calculated by using, for example, above Equation (1).
The selecting module 1530 is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, the distance calculating module 1525, and the fixed-length encoding module 1535. The selecting module 1530 uses the distance calculated by the distance calculating module 1525 to select either the quantization result of the texture-preserving representation converting module 1515 or the quantization result of the two-color representation converting module 1520. That is, the fixed-length representation of one of the texture-preserving representation converting module 1515 and the two-color representation converting module 1520 is selected.
The fixed-length encoding module 1535 is connected to the selecting module 1530 and a fixed-length decoding module 1555 of the expanding device 1550 and passes the code 1537 to the fixed-length decoding module 1555 of the expanding device 1550. The fixed-length encoding module 1535 performs processes equivalent to those of the fixed-length encoding module 130 of the first exemplary embodiment. The fixed-length encoding module 1535 performs fixed-length encoding of the quantization result selected by the selecting module 1530. That is, fixed-length encoding is performed of the ID of the selected fixed-length representation (of the texture-preserving representation converting module 1515 or the two-color representation converting module 1520) and the result of quantization into the fixed-length representation. The code 1537 which is a process result of the fixed-length encoding is passed to the expanding device 1550 through a communication line and the like.
The expanding device 1550 includes the fixed-length decoding module 1555, an identifying module 1560, an inverse quantization module 1565, and a deblocking module 1570.
The fixed-length decoding module 1555 is connected to the fixed-length encoding module 1535 of the compressing device 1500 and the identifying module 1560 and receives the code 1537 from the fixed-length encoding module 1535 of the compressing device 1500. The fixed-length decoding module 1555 performs processes equivalent to those of the fixed-length decoding module 155 of the first exemplary embodiment. The inverse of the conversion by the fixed-length encoding module 1535 is performed. The code 1537 is decoded to obtain the ID of the fixed-length representation selected by the selecting module 1530 and the result of quantization into the fixed-length representation.
The identifying module 1560 is connected to the fixed-length decoding module 1555 and the inverse quantization module 1565. The identifying module 1560 performs processes equivalent to those of the identifying module 160 of the first exemplary embodiment. The ID (the ID of the fixed-length representation) is obtained from the decoded information. The quantization result (ID) selected by the selecting module 1530 is identified as either the quantization result of the texture-preserving representation converting module 1515 or the quantization result of the two-color representation converting module 1520.
The inverse quantization module 1565 is connected to the identifying module 1560 and the deblocking module 1570. The inverse quantization module 1565 performs processes equivalent to those of the inverse quantization module 165 of the first exemplary embodiment. The inverse of the conversion by the texture-preserving representation converting module 1515 or by the two-color representation converting module 1520 is performed. That is, inverse quantization is performed in correspondence with the ID obtained by the identifying module 1560.
The deblocking module 1570 is connected to the inverse quantization module 1565 and outputs the image 1595. The deblocking module 1570 uses the block of pixels obtained after inverse quantization by the inverse quantization module 1565 to generate the image 1595.
In Step S1602, the block splitting module 1510 performs blocking.
In Step S1604, the texture-preserving representation converting module 1515 performs conversion into a texture-preserving representation.
In Step S1606, the two-color representation converting module 1520 performs conversion into a two-color representation.
In step S1608, the distance calculating module 1525 calculates the distance.
In Step S1610, the selecting module 1530 selects the ID that indicates either the process result of the texture-preserving representation converting module 1515 or the process result of the two-color representation converting module 1520.
In Step S1612, the fixed-length encoding module 1535 performs an encoding process.
In Step S1702, the fixed-length decoding module 1555 performs a decoding process.
In Step S1704, the identifying module 1560 identifies the ID.
The process proceeds to Step S1706 in a case of a texture-preserving representation and proceeds to Step S1708 in a case of a two-color representation.
In Step S1706, the inverse quantization module 1565 performs inverse conversion of the texture-preserving representation.
In Step S1708, the inverse quantization module 1565 performs inverse conversion of the two-color representation.
In Step S1710, the deblocking module 1570 performs a deblocking process.
For example, a code type (ID) is represented by four types (two bits), and a data portion is represented by 16 bits. At this point, the code length in the fifth exemplary embodiment is, as illustrated in the example of
The content of the code type (ID) is illustrated in the example of
A code type ID:0 is a “texture-preserving” representation and has “any” form and a data portion of “8 bit pattern and 8 bit tone”. As illustrated in the example of
A code type ID:1 is a “two-color” representation and is a grid (check pattern) in two colors as illustrated in the form of the ID:1 in
A code type ID:2 is a “two-color” representation and has vertically split two colors on the left and right sides as illustrated in the form of the ID:2 in
A code type ID:3 is a “two-color” representation and has horizontally split two colors on the upper and lower sides as illustrated in the form of the ID:3 in
The texture-preserving representation preserves a pattern and a tone in the data portion. Description will be provided in a case where, for example, the pattern has 8 bits and the tone has 8 bits. The 8 bit pattern is an identifier that specifies any form.
Since the pattern has 8 bits, 256 types of forms can be specified. Hereinafter, the pattern identifier will be referred to as a PID. The 8 bit tone represents the tone of any form specified by the pattern. The average pixel value of pixels corresponding to the specified form is used as a tone value. The color of a part different from the specified form (background color) is fixed to any color. While the background color is regarded as 255 (white), the background color may be freely set according to an applied image or a color space. A texture representation table 2100 illustrated in the example of
The texture representation table 2100 includes a PID field 2110, a 16-bit representation (hexadecimal) field 2120, and a form field 2130. The PID field 2110 illustrates a PID (a value that may be put in the pattern 2022). The PID in the PID field 2110 has a length of 16 bits. The 16-bit representation (hexadecimal) field 2120 illustrates a 16-bit representation (hexadecimal) of the pattern (PID). The form field 2130 illustrates the form of the pattern (PID).
The PID is represented by “0x7777” in 16-bit representation in a case where, for example, the PID is equal to zero, and has a form illustrated in the content of the form field 2130 in the first row of the texture representation table 2100. The form is illustrated as a 4×4 rectangular shape in which the initial bits of each row are set to white (255; fixed) and the other three bits are set as an 8 bit tone.
The PID is represented by “˜0x7777” in 16-bit representation in a case where, for example, the PID is equal to one, and has a form illustrated in the content of the form field 2130 in the second row of the texture representation table 2100.
The PID is represented by “0x000f” in 16-bit representation in a case where, for example, the PID is equal to two, and has a form illustrated in the content of the form field 2130 in the third row of the texture representation table 2100.
The PID is represented by “˜0x000f” in 16-bit representation in a case where, for example, the PID is equal to three, and has a form illustrated in the content of the form field 2130 in the fourth row of the texture representation table 2100.
The texture-preserving representation by the texture-preserving representation converting module 1515 may set, for example, 10 bits for the pattern 2022 and six bits for the tone 2024. The average pixel value calculated is required to be quantized in a case where the number of bits of tone is decreased. A technology in the related art may be applied as a quantization method. Examples include simple quantization, quantization along with error diffusion that preserves the tone, simple quantization after superimposition of a random number on the average pixel value, and the like.
Representative color may be fixed to 0 (black) in a case where, for example, 16 bits are used for the pattern and zero bits for the tone.
The two-color representation by the two-color representation converting module 1520 represents a block in two colors in any form and preserves each tone (the tone 2026 of color 1 (8 bits) and the tone 2028 of color 2 (8 bits)) in the data portion 1920. While the form is regarded as a grid (ID=1), a left-right form (ID=2), and an upper-lower form (ID=3) as illustrated in the example of
The texture-preserving representation of the texture-preserving representation converting module 1515 may represent, for example, the pattern with 8 bits and the tone with four bits+four bits. In this case, the representative color of the pattern is preserved in four bits and the background color in four bits. As illustrated in the example of
The two-color representation by the two-color representation converting module 1520 can increase the resolution by increasing the number of forms. For example, the number of forms is increased as illustrated in
Code types ID:0 to ID:3 are equivalent to those of
A code type ID:4 is a “two-color” representation and has a form in which the color 2 is at the upper left as illustrated in the form of the ID:4 in
A code type ID:5 is a “two-color” representation and has a form in which the color 2 is at the upper right as illustrated in the form of the ID:5 in
A code type ID:6 is a “two-color” representation and has a form in which the color 2 is at the lower right as illustrated in the form of the ID:6 in
A code type ID:7 is a “two-color” representation and has a form in which the color 2 is at the lower left as illustrated in the form of the ID:7 in
A compressing device 2400 includes the block splitting module 1510, the texture-preserving representation converting module 1515, the two-color representation converting module 1520, a tone quantization module 2425, the distance calculating module 1525, the selecting module 1530, and the fixed-length encoding module 1535.
The block splitting module 1510 receives an image 2405 and is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, and the distance calculating module 1525.
The texture-preserving representation converting module 1515 is connected to the block splitting module 1510 and the tone quantization module 2425.
The two-color representation converting module 1520 is connected to the block splitting module 1510 and the tone quantization module 2425.
The tone quantization module 2425 is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, the distance calculating module 1525, and the selecting module 1530. The tone quantization module 2425 performs tone quantization of at least one or more quantization results of multiple quantization results of the texture-preserving representation converting module 1515 and the two-color representation converting module 1520 (the quantization result of the texture-preserving representation converting module 1515 and the quantization result of the two-color representation converting module 1520).
The distance calculating module 1525 is connected to the block splitting module 1510, the tone quantization module 2425, and the selecting module 1530. The distance calculating module 1525 calculates the distance between the block, which is split by the block splitting module 1510, and a tone quantization result of the tone quantization module 2425.
The selecting module 1530 is connected to the tone quantization module 2425, the distance calculating module 1525, and the fixed-length encoding module 1535. The selecting module 1530 uses the distance calculated by the distance calculating module 1525 to select either the tone quantization result of the tone quantization module 2425 obtained from the quantization result of the texture-preserving representation converting module 1515 or the tone quantization result of the tone quantization module 2425 obtained from the quantization result of the two-color representation converting module 1520.
The fixed-length encoding module 1535 is connected to the selecting module 1530 and outputs a code 2437.
A compressing device 2500 includes the block splitting module 1510, the texture-preserving representation converting module 1515, the two-color representation converting module 1520, a random number superimposing module 2525, the tone quantization module 2425, the distance calculating module 1525, the selecting module 1530, and the fixed-length encoding module 1535.
The block splitting module 1510 receives an image 2505 and is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, and the distance calculating module 1525.
The texture-preserving representation converting module 1515 is connected to the block splitting module 1510 and the random number superimposing module 2525.
The two-color representation converting module 1520 is connected to the block splitting module 1510 and the random number superimposing module 2525.
The random number superimposing module 2525 is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, and the tone quantization module 2425. The random number superimposing module 2525 superimposes a random number on at least one or more quantization results of multiple quantization results of the texture-preserving representation converting module 1515 and the two-color representation converting module 1520 (the quantization result of the texture-preserving representation converting module 1515 and the quantization result of the two-color representation converting module 1520). For example, a blue noise mask and the like may be used.
The tone quantization module 2425 is connected to the random number superimposing module 2525, the distance calculating module 1525, and the selecting module 1530. The tone quantization module 2425 performs tone quantization of multiple process results of the random number superimposing module 2525.
The distance calculating module 1525 is connected to the block splitting module 1510, the tone quantization module 2425, and the selecting module 1530.
The selecting module 1530 is connected to the tone quantization module 2425, the distance calculating module 1525, and the fixed-length encoding module 1535. The selecting module 1530 uses the distance calculated by the distance calculating module 1525 to select either the tone quantization result of the tone quantization module 2425 obtained from the process result of the random number superimposing module 2525 obtained from the quantization result of the texture-preserving representation converting module 1515 or the tone quantization result of the tone quantization module 2425 obtained from the process result of the random number superimposing module 2525 obtained from the quantization result of the two-color representation converting module 1520.
The fixed-length encoding module 1535 is connected to the selecting module 1530 and outputs a code 2537.
A compressing device 2600 includes the block splitting module 1510, the texture-preserving representation converting module 1515, the two-color representation converting module 1520, an error diffusion module 2625, the tone quantization module 2425, the distance calculating module 1525, the selecting module 1530, and the fixed-length encoding module 1535.
The block splitting module 1510 receives an image 2605 and is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, and the distance calculating module 1525.
The texture-preserving representation converting module 1515 is connected to the block splitting module 1510, the tone quantization module 2425, and the error diffusion module 2625.
The two-color representation converting module 1520 is connected to the block splitting module 1510, the tone quantization module 2425, and the error diffusion module 2625.
The tone quantization module 2425 is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, the error diffusion module 2625, the distance calculating module 1525, and the selecting module 1530.
The error diffusion module 2625 is connected to the texture-preserving representation converting module 1515, the two-color representation converting module 1520, and the tone quantization module 2425. The error diffusion module 2625 uses at least one or more tone quantization results of multiple tone quantization results resulting from tone quantization by the tone quantization module 2425 to perform an error diffusion process on the block split by the block splitting module 1510. The block (the block before error diffusion) that is regarded as a target by the error diffusion module 2625 is a block that is different from the block which is regarded as a target by the texture-preserving representation converting module 1515 and the two-color representation converting module 1520. For example, the block is a block of a subsequent process target.
The distance calculating module 1525 is connected to the block splitting module 1510, the tone quantization module 2425, and the selecting module 1530.
The selecting module 1530 is connected to the tone quantization module 2425, the distance calculating module 1525, and the fixed-length encoding module 1535.
The fixed-length encoding module 1535 is connected to the selecting module 1530 and outputs a code 2637.
Expansion of the process results (codes) of the sixth exemplary embodiment to the tenth exemplary embodiment may use the expanding device 1550 of the fifth exemplary embodiment or may be performed by conversion that is the inverse of quantization performed by the compressing device.
A compressing device 2700 of an image processing apparatus that is the eleventh exemplary embodiment compresses an image 2705. An expanding device 2750 of the image processing apparatus that is the eleventh exemplary embodiment decodes a code 2747 that is compressed by the compressing device 2700, to generate an image 2795. The eleventh exemplary embodiment increases the compression ratio, compared with the first exemplary embodiment. Specifically, while the first exemplary embodiment (the first exemplary embodiment to the fourth exemplary embodiment) achieves 18 to 19 [bits/block], the eleventh exemplary embodiment (the eleventh exemplary embodiment to a twentieth exemplary embodiment) achieves 10 to 11 [bits/block].
The eleventh exemplary embodiment converts a block into one of a high-resolution/fewer-tone representation, a tone-preserving representation, and a two-color representation. The high-resolution/fewer-tone representation preserves the resolution of character edges and fine lines, and the tone-preserving representation preserves the tone of gradations. The two-color representation is between the high-resolution/fewer-tone representation and the tone-preserving representation.
The compressing device 2700 includes a block splitting module 2710, a high-resolution/fewer-tone representation converting module 2715, a tone-preserving representation converting module 2720, a two-color representation converting module 2725, a tone quantization module 2730, a distance calculating module 2735, a selecting module 2740, and a fixed-length encoding module 2745.
The block splitting module 2710 receives the image 2705 and is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the distance calculating module 2735. The block splitting module 2710 performs processes equivalent to those of the block splitting module 110 of the first exemplary embodiment. The image 2705 is split into blocks. The block is quantized by using multiple methods (three methods in this example).
The high-resolution/fewer-tone representation converting module 2715 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740. The high-resolution/fewer-tone representation converting module 2715 performs quantization in order to preserve the resolution in the block.
The tone-preserving representation converting module 2720 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740. The tone-preserving representation converting module 2720 performs quantization in order to preserve the tone in the block.
The two-color representation converting module 2725 is connected to the block splitting module 2710 and the tone quantization module 2730. The two-color representation converting module 2725 represents the pixels in the block in multiple colors.
The tone quantization module 2730 is connected to the two-color representation converting module 2725, the distance calculating module 2735, and the selecting module 2740. The tone quantization module 2730 performs tone quantization of a process result of the two-color representation converting module 2725.
Since the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the tone quantization module 2730 limit types of representation, the amount of encoding is decreased.
The distance calculating module 2735 is connected to the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, and the selecting module 2740. The distance calculating module 2735 calculates the distance between the block and the quantization result (a quantization result of the high-resolution/fewer-tone representation converting module 2715, a quantization result of the tone-preserving representation converting module 2720, and a quantization result of the two-color representation converting module 2725 and the tone quantization module 2730). The distance calculating module 2735 performs processes equivalent to those of the distance calculating module 1220 of the third exemplary embodiment. In this case, there exist three types of distances including the distance between the block and the quantization result of the high-resolution/fewer-tone representation converting module 2715, the distance between the block and the quantization result of the tone-preserving representation converting module 2720, and the distance between the block and the quantization result of “the two-color representation converting module 2725 and the tone quantization module 2730”. The distance between the block and the block converted into a fixed-length representation may be calculated by using, for example, above Equation (1).
The selecting module 2740 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, the distance calculating module 2735, and the fixed-length encoding module 2745. The selecting module 2740 uses the distance to select one of the quantization results of the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, and the two-color representation converting module 2725 and the tone quantization module 2730. That is, one of the fixed-length representations of the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, and the two-color representation converting module 2725 and the tone quantization module 2730 is selected.
The fixed-length encoding module 2745 is connected to the selecting module 2740 and a fixed-length decoding module 2755 of the expanding device 2750 and passes the code 2747 to the fixed-length decoding module 2755 of the expanding device 2750. The fixed-length encoding module 2745 performs processes equivalent to those of the fixed-length encoding module 130 of the first exemplary embodiment. The fixed-length encoding module 2745 performs fixed-length encoding of the quantization result selected by the selecting module 2740. That is, fixed-length encoding is performed of the ID of the selected fixed-length representation (of the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, or the two-color representation converting module 2725 and the tone quantization module 2730) and the result of quantization into the fixed-length representation. The code 2747 which is a process result of the fixed-length encoding is passed to the expanding device 2750 through a communication line and the like.
The expanding device 2750 includes the fixed-length decoding module 2755, an identifying module 2760, an inverse quantization module 2765, and a deblocking module 2770.
The fixed-length decoding module 2755 is connected to the fixed-length encoding module 2745 of the compressing device 2700 and the identifying module 2760 and receives the code 2747 from the fixed-length encoding module 2745 of the compressing device 2700. The fixed-length decoding module 2755 performs processes equivalent to those of the fixed-length decoding module 155 of the first exemplary embodiment. The inverse of the conversion by the fixed-length encoding module 2745 is performed. The code 2747 is decoded to obtain the ID of the fixed-length representation selected by the selecting module 2740 and the result of quantization into the fixed-length representation.
The identifying module 2760 is connected to the fixed-length decoding module 2755 and the inverse quantization module 2765. The identifying module 2760 performs processes equivalent to those of the identifying module 160 of the first exemplary embodiment. The ID (the ID of the fixed-length representation) is obtained from the decoded information. The quantization result (ID) selected by the selecting module 2740 is identified as either the quantization result of the high-resolution/fewer-tone representation converting module 2715, the quantization result of the tone-preserving representation converting module 2720, or the quantization result of the two-color representation converting module 2725 and the tone quantization module 2730.
The inverse quantization module 2765 is connected to the identifying module 2760 and the deblocking module 2770. The inverse quantization module 2765 performs processes equivalent to those of the inverse quantization module 165 of the first exemplary embodiment. The inverse of the conversion by the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, or the two-color representation converting module 2725 and the tone quantization module 2730 is performed. That is, inverse quantization is performed in correspondence with the ID obtained by the identifying module 2760.
The deblocking module 2770 is connected to the inverse quantization module 2765 and outputs the image 2795. The deblocking module 2770 uses the block of pixels obtained after inverse quantization by the inverse quantization module 2765 to generate the image 2795.
In Step S2802, the block splitting module 2710 performs blocking.
In Step S2804, the high-resolution/fewer-tone representation converting module 2715 performs conversion into a high-resolution/fewer-tone representation.
In Step S2806, the tone-preserving representation converting module 2720 performs conversion into a tone-preserving representation.
In Step S2808, the two-color representation converting module 2725 performs conversion into a two-color representation.
In Step S2810, the tone quantization module 2730 quantizes the tone.
In step S2812, the distance calculating module 2735 calculates the distance.
In Step S2814, the selecting module 2740 selects the ID that indicates either the process result of the high-resolution/fewer-tone representation converting module 2715, the process result of the tone-preserving representation converting module 2720, or the process result of the two-color representation converting module 2725 and the tone quantization module 2730.
In Step S2816, the fixed-length encoding module 2745 performs an encoding process.
In Step S2902, the fixed-length decoding module 2755 performs a decoding process.
In Step S2904, the identifying module 2760 identifies the ID.
The process proceeds to Step S2906 in a case of a high-resolution/fewer-tone representation, proceeds to Step S2908 in a case of a tone-preserving representation, and proceeds to Step S2910 in a case of a two-color representation.
In Step S2906, the inverse quantization module 2765 performs inverse conversion of the high-resolution/fewer-tone representation.
In Step S2908, the inverse quantization module 2765 performs inverse conversion of the tone-preserving representation.
In Step S2910, the inverse quantization module 2765 performs inverse conversion of the quantized tone and performs inverse conversion of the two-color representation.
In Step S2912, the deblocking module 2770 performs a deblocking process.
For example, a code type (ID) is represented by four types (two bits), and a data portion is represented by 8 bits. At this point, the code length in the eleventh exemplary embodiment is, as illustrated in the example of
The content of the code type (ID) is illustrated in the example of
A code type ID:0 is a “high-resolution/fewer-tone” representation and has “any” form and a data portion of “8 bit pattern”. As illustrated in the example of
A code type ID:1 is a “tone-preserving” representation and has one color as illustrated in the form of the ID:1 in
A code type ID:2 is a “two-color” representation and has vertically split two colors on the left and right sides as illustrated in the form of the ID:2 in
A code type ID:3 is a “two-color” representation and has horizontally split two colors on the upper and lower sides as illustrated in the form of the ID:3 in
The high-resolution/fewer-tone representation has a pattern in the data portion. For example, the pattern is an identifier that has 8 bits and specifies any form. Since the pattern has 8 bits, 256 types of forms can be specified. The color of any form specified by the pattern (form color) and color of a part different from the form (background color) are fixed to any color. While the form color is regarded as 0 (black) and the background color as 255 (white), the background color may be freely set according to an applied image or a color space. A texture representation table 3300 illustrated in the example of
The texture representation table 3300 includes a PID field 3310, a 16-bit representation (hexadecimal) field 3320, and a form field 3330. The PID field 3310 stores a PID (a value that may be put in the pattern 3222). The PID in the PID field 3310 has a length of 8 bits. The 16-bit representation (hexadecimal) field 3320 stores a 16-bit representation (hexadecimal) of the pattern (PID). The form field 3330 stores the form of the pattern (PID).
The PID is represented by “0x7777” in 16-bit representation in a case where, for example, the PID is equal to zero, and has a form illustrated in the content of the form field 3330 in the first row of the texture representation table 3300. The form is illustrated as a 4×4 rectangular shape in which the initial bits of each row are set to white (255; fixed) and the other three bits are set as an 8 bit tone.
The PID is represented by “˜0x7777” in 16-bit representation in a case where, for example, the PID is equal to one, and has a form illustrated in the content of the form field 3330 in the second row of the texture representation table 3300.
The PID is represented by “0x000f” in 16-bit representation in a case where, for example, the PID is equal to two, and has a form illustrated in the content of the form field 3330 in the third row of the texture representation table 3300.
The PID is represented by “˜0x000f” in 16-bit representation in a case where, for example, the PID is equal to three, and has a form illustrated in the content of the form field 3330 in the fourth row of the texture representation table 3300.
The high-resolution/fewer-tone representation by the high-resolution/fewer-tone representation converting module 2715 may set, for example, four bits for the pattern and four bits for the tone. The four-bit tone represents the form color.
The average pixel value of the pixels on the form is quantized and retained as the four-bit tone. A technology in the related art may be applied as a quantization method. Examples include simple quantization, quantization along with error diffusion that preserves the tone, simple quantization after superimposition of a random number on the average pixel value, and the like. Apparently, the four-bit tone may be retained as the background color and not the form color.
The tone-preserving representation by the tone-preserving representation converting module 2720 represents a block in a monochromatic manner. As illustrated in the example of
The two-color representation by the two-color representation converting module 2725 represents a block in two colors in any form and preserves each tone (the tone 3226 of color 1 (four bits) and the tone 3228 of color 2 (four bits)) in the data portion 3120. While the form is regarded as a left-right form (ID=2) and an upper-lower form (ID=3) as illustrated in the example of
The high-resolution/fewer-tone representation in the high-resolution/fewer-tone representation converting module 2715 may represent, for example, the pattern with four bits and the tone with two bits+two bits. In this case, the form color is preserved in two bits and the background color in two bits. As illustrated in the example of
The two-color representation by the two-color representation converting module 2725 can increase the resolution by increasing the number of forms. For example, the number of forms is increased as illustrated in
Code types ID:0 to ID:3 are equivalent to those of
A code type ID:4 is a “two-color” representation and has a form in which the color 2 is at the upper left in two color as illustrated in the form of the ID:4 in
A code type ID:5 is a “two-color” representation and has a form in which the color 2 is at the upper right in two color as illustrated in the form of the ID:5 in
A code type ID:6 is a “two-color” representation and has a form in which the color 2 is at the lower right in two color as illustrated in the form of the ID:6 in
A code type ID:7 is a “two-color” representation and has a form in which the color 2 is at the lower left in two color as illustrated in the form of the ID:7 in
The two-color representation by the two-color representation converting module 2725 may be, for example, as illustrated in
Code types ID:0 and ID:1 are equivalent to those of
A code type ID:2 is a “two-color” representation and has a check pattern of two colors as illustrated in the form of the ID:2 in
Code types ID:3 to ID:7 are equivalent to the ID2 to the ID6 of
While the two-color patterns illustrated in
The dynamic range in a block may be used in selection of a fixed-length representation. The high-resolution/fewer-tone representation has pixel values of 0/255.
The quantization result of the high-resolution/fewer-tone representation converting module 2715 is selected in a case where the dynamic range is greater than or equal to a predetermined threshold. That is, the high-resolution/fewer-tone representation is prioritized in a case where the dynamic range is equal to 255 or close to 255.
A compressing device 3700 includes the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, the tone quantization module 2730, a D range calculating module 3735, the distance calculating module 2735, the selecting module 2740, and the fixed-length encoding module 2745.
The block splitting module 2710 receives an image 3705 and is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, the D range calculating module 3735, and the distance calculating module 2735.
The high-resolution/fewer-tone representation converting module 2715 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740.
The tone-preserving representation converting module 2720 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740.
The two-color representation converting module 2725 is connected to the block splitting module 2710 and the tone quantization module 2730.
The tone quantization module 2730 is connected to the two-color representation converting module 2725, the distance calculating module 2735, and the selecting module 2740.
The D range calculating module 3735 is connected to the block splitting module 2710 and the selecting module 2740. The D range calculating module 3735 extracts the dynamic range of the block.
The distance calculating module 2735 is connected to the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, and the selecting module 2740.
The selecting module 2740 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, the D range calculating module 3735, the distance calculating module 2735, and the fixed-length encoding module 2745. The selecting module 2740 selects the quantization result of the high-resolution/fewer-tone representation converting module 2715 in a case where the dynamic range extracted by the D range calculating module 3735 is greater than or equal to the predetermined threshold. Otherwise (in a case where selection cannot be made with the value of the dynamic range), selection may be made by using the value of the distance calculating module 2735.
The fixed-length encoding module 2745 is connected to the selecting module 2740 and outputs a code 3747.
A compressing device 3800 includes the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, a random number superimposing module 3830, the tone quantization module 2730, the distance calculating module 2735, the selecting module 2740, and the fixed-length encoding module 2745.
The block splitting module 2710 receives an image 3805 and is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the distance calculating module 2735.
The high-resolution/fewer-tone representation converting module 2715 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740.
The tone-preserving representation converting module 2720 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740.
The two-color representation converting module 2725 is connected to the block splitting module 2710 and the random number superimposing module 3830.
The random number superimposing module 3830 is connected to the two-color representation converting module 2725 and the tone quantization module 2730. The random number superimposing module 3830 superimposes a random number on the process result of the two-color representation converting module 2725 and passes a process result to the tone quantization module 2730. A blue noise mask, for example, may be used as a random number superimposing process.
The tone quantization module 2730 is connected to the random number superimposing module 3830, the distance calculating module 2735, and the selecting module 2740.
The distance calculating module 2735 is connected to the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, and the selecting module 2740.
The selecting module 2740 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, the distance calculating module 2735, and the fixed-length encoding module 2745.
The fixed-length encoding module 2745 is connected to the selecting module 2740 and outputs a code 3847.
A compressing device 3900 includes the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, the tone quantization module 2730, an error diffusion module 3930, the distance calculating module 2735, the selecting module 2740, and the fixed-length encoding module 2745.
The block splitting module 2710 receives an image 3905 and is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the distance calculating module 2735.
The high-resolution/fewer-tone representation converting module 2715 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740.
The tone-preserving representation converting module 2720 is connected to the block splitting module 2710, the distance calculating module 2735, and the selecting module 2740.
The two-color representation converting module 2725 is connected to the block splitting module 2710, the tone quantization module 2730, and the error diffusion module 3930.
The tone quantization module 2730 is connected to the two-color representation converting module 2725, the error diffusion module 3930, the distance calculating module 2735, and the selecting module 2740.
The error diffusion module 3930 is connected to the two-color representation converting module 2725 and the tone quantization module 2730. The error diffusion module 3930 uses the tone quantization result of the tone quantization module 2730 to perform an error diffusion process on the block. The block (the block before error diffusion) that is regarded as a target by the error diffusion module 3930 is a block that is different from the block which is regarded as a target by the two-color representation converting module 2725. For example, the block is a block of a subsequent process target.
The distance calculating module 2735 is connected to the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, and the selecting module 2740.
The selecting module 2740 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the tone quantization module 2730, the distance calculating module 2735, and the fixed-length encoding module 2745.
The fixed-length encoding module 2745 is connected to the selecting module 2740 and outputs a code 3947.
A compressing device 4000 includes the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, a tone quantization module 4030, the distance calculating module 2735, the selecting module 2740, and the fixed-length encoding module 2745.
The block splitting module 2710 receives an image 4005 and is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the distance calculating module 2735.
The high-resolution/fewer-tone representation converting module 2715 is connected to the block splitting module 2710 and the tone quantization module 4030.
The tone-preserving representation converting module 2720 is connected to the block splitting module 2710 and the tone quantization module 4030.
The two-color representation converting module 2725 is connected to the block splitting module 2710 and the tone quantization module 4030.
The tone quantization module 4030 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, the distance calculating module 2735, and the selecting module 2740. The tone quantization module 4030 performs tone quantization of at least one or more quantization results of multiple quantization result of the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, and the two-color representation converting module 2725 (the quantization result of the high-resolution/fewer-tone representation converting module 2715, the quantization result of the tone-preserving representation converting module 2720, and the quantization result of the two-color representation converting module 2725).
The distance calculating module 2735 is connected to the block splitting module 2710, the tone quantization module 4030, and the selecting module 2740. The distance calculating module 2735 calculates the distance between the block, which is split by the block splitting module 2710, and a tone quantization result of the tone quantization module 4030.
The selecting module 2740 is connected to the tone quantization module 4030, the distance calculating module 2735, and the fixed-length encoding module 2745. The selecting module 2740 uses the distance calculated by the distance calculating module 2735 to select either the tone quantization result of the tone quantization module 4030 obtained from the quantization result of the high-resolution/fewer-tone representation converting module 2715, the tone quantization result of the tone quantization module 4030 obtained from the quantization result of the tone-preserving representation converting module 2720, or the tone quantization result of the tone quantization module 4030 obtained from the quantization result of the two-color representation converting module 2725.
The fixed-length encoding module 2745 is connected to the selecting module 2740 and outputs a code 4047.
A compressing device 4100 includes the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, a random number superimposing module 4130, the tone quantization module 4030, the distance calculating module 2735, the selecting module 2740, and the fixed-length encoding module 2745.
The block splitting module 2710 receives an image 4105 and is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the distance calculating module 2735.
The high-resolution/fewer-tone representation converting module 2715 is connected to the block splitting module 2710 and the random number superimposing module 4130.
The tone-preserving representation converting module 2720 is connected to the block splitting module 2710 and the random number superimposing module 4130.
The two-color representation converting module 2725 is connected to the block splitting module 2710 and the random number superimposing module 4130.
The random number superimposing module 4130 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the tone quantization module 4030. The random number superimposing module 4130 superimposes a random number on at least one or more quantization results of multiple quantization result of the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, and the two-color representation converting module 2725 (the quantization result of the high-resolution/fewer-tone representation converting module 2715, the quantization result of the tone-preserving representation converting module 2720, and the quantization result of the two-color representation converting module 2725). For example, a blue noise mask and the like may be used.
The tone quantization module 4030 is connected to the random number superimposing module 4130, the distance calculating module 2735, and the selecting module 2740. The tone quantization module 4030 performs tone quantization of multiple process results of the random number superimposing module 4130.
The distance calculating module 2735 is connected to the block splitting module 2710, the tone quantization module 4030, and the selecting module 2740.
The selecting module 2740 is connected to the tone quantization module 4030, the distance calculating module 2735, and the fixed-length encoding module 2745. The selecting module 2740 uses the distance calculated by the distance calculating module 2735 to select either the tone quantization result of the tone quantization module 4030 obtained from the process result of the random number superimposing module 4130 obtained from the quantization result of the high-resolution/fewer-tone representation converting module 2715, the tone quantization result of the tone quantization module 4030 obtained from the process result of the random number superimposing module 4130 obtained from the quantization result of the tone-preserving representation converting module 2720, or the tone quantization result of the tone quantization module 4030 obtained from the process result of the random number superimposing module 4130 obtained from the quantization result of the two-color representation converting module 2725.
The fixed-length encoding module 2745 is connected to the selecting module 2740 and outputs a code 4147.
A compressing device 4200 includes the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, the tone quantization module 4030, an error diffusion module 4230, the distance calculating module 2735, the selecting module 2740, and the fixed-length encoding module 2745.
The block splitting module 2710 receives an image 4205 and is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the distance calculating module 2735.
The high-resolution/fewer-tone representation converting module 2715 is connected to the block splitting module 2710, the tone quantization module 4030, and the error diffusion module 4230.
The tone-preserving representation converting module 2720 is connected to the block splitting module 2710, the tone quantization module 4030, and the error diffusion module 4230.
The two-color representation converting module 2725 is connected to the block splitting module 2710, the tone quantization module 4030, and the error diffusion module 4230.
The tone quantization module 4030 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, the error diffusion module 4230, the distance calculating module 2735, and the selecting module 2740.
The error diffusion module 4230 is connected to the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, and the tone quantization module 4030. The error diffusion module 4230 uses at least one or more quantization results of multiple tone quantization results of the tone quantization module 4030 to perform an error diffusion process on the block split by the block splitting module 2710. The block (the block before error diffusion) that is regarded as a target by the error diffusion module 4230 is a block that is different from the block which is regarded as a target by the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, and the two-color representation converting module 2725. For example, the block is a block of a subsequent process target.
The distance calculating module 2735 is connected to the block splitting module 2710, the tone quantization module 4030, and the selecting module 2740.
The selecting module 2740 is connected to the tone quantization module 4030, the distance calculating module 2735, and the fixed-length encoding module 2745.
The fixed-length encoding module 2745 is connected to the selecting module 2740 and outputs a code 4247.
Expansion of the process results (codes) of the twelfth exemplary embodiment to the twentieth exemplary embodiment may use the expanding device 2750 of the eleventh exemplary embodiment or may be performed by conversion that is the inverse of quantization performed by the compressing device.
A hardware configuration example of the image processing apparatus of the present exemplary embodiment will be described with reference to
The hardware configuration example illustrated in
A central processing unit (CPU) 4301 is a controller that performs processes in accordance with a computer program in which execution sequences of various modules described in the above exemplary embodiments, that is, each module of the block splitting module 110, the multiple quantization module 115, the feature extracting module 120, the selecting module 125, the fixed-length encoding module 130, the fixed-length decoding module 155, the identifying module 160, the inverse quantization module 165, the pattern extracting module 920, the distance calculating module 1220, the block splitting module 1410, the feature extracting module 1415, the selecting module 1420, the quantization module 1425, the fixed-length encoding module 1430, the block splitting module 1510, the texture-preserving representation converting module 1515, the two-color representation converting module 1520, the distance calculating module 1525, the selecting module 1530, the fixed-length encoding module 1535, the fixed-length decoding module 1555, the identifying module 1560, the inverse quantization module 1565, the deblocking module 1570, the block splitting module 2710, the high-resolution/fewer-tone representation converting module 2715, the tone-preserving representation converting module 2720, the two-color representation converting module 2725, the tone quantization module 2730, the distance calculating module 2735, the selecting module 2740, the fixed-length encoding module 2745, the fixed-length decoding module 2755, the identifying module 2760, the inverse quantization module 2765, the deblocking module 2770, and the like, are described.
A read only memory (ROM) 4302 stores programs, operation parameters, and the like used by the CPU 4301. A random access memory (RAM) 4303 stores programs used in execution by the CPU 4301, parameters that are appropriately changed during the execution, and the like. The ROM 4302 and the RAM 4303 are connected to each other by a host bus 4304 that is configured of a CPU bus and the like.
The host bus 4304 is connected to an external bus 4306 such as a peripheral component interconnect/interface (PCI) bus and the like through a bridge 4305.
A keyboard 4308 and a pointing device 4309 such as a mouse are input devices operated by the operator. A display 4310 is a liquid crystal display device, a cathode ray tube (CRT), or the like and displays various types of information as text or image information.
A hard disk drive (HDD) 4311 incorporates a hard disk, drives the hard disk, and records or reproduces information and programs executed by the CPU 4301. The hard disk stores the image 105, the block 112, the quantization result 117, the feature 122, the “ID+quantization result” 127, the code 132, the “ID+quantization result” 157, the quantization result 162, the image 195, and the like. Furthermore, the hard disk stores various computer programs such as other various data processing programs.
A drive 4312 reads data or programs recorded in a removable recording medium 4313 such as a magnetic disk, an optical disc, a magnetooptical disc, a semiconductor memory, or the like mounted and supplies the data or programs to the RAM 4303 that is connected thereto through an interface 4307, the external bus 4306, the bridge 4305, and the host bus 4304. The removable recording medium 4313 may be used as a data recording region like the hard disk.
A connection port 4314 is a port to which an externally connected machine 4315 is connected, and includes a connection unit such as USB, IEEE1394, and the like. The connection port 4314 is connected to the CPU 4301 and the like through the interface 4307, the external bus 4306, the bridge 4305, the host bus 4304, and the like. A communicating unit 4316 is connected to a communication line and performs an external data communication process. The data reading unit 4317 is, for example, a scanner and performs a document reading process. The data output unit 4318 is, for example, a printer and performs a document data output process.
The hardware configuration of the image processing apparatus illustrated in
The present exemplary embodiment is not limited to the configuration illustrated in
A part of the modules may be in an external system and may be connected to a communication line.
Furthermore, multiple numbers of the systems illustrated in
The above various exemplary embodiments may be combined (includes, for example, adding or replacing a module between one exemplary embodiment and another exemplary embodiment).
The technology described in Related Art may be adopted as the process contents of each module.
The program described may be provided as being stored in a recording medium.
The program may be provided by a communication unit. In that case, for example, the described program may be perceived as an invention of “a computer readable recording medium in which the program is recorded”.
The “computer readable recording medium in which the program is recorded” refers to a computer readable recording medium in which the program is recorded and that is used for installation and execution of the program, distribution of the program, and the like.
Examples of the recording medium include, for example, “DVD-R, DVD-RW, DVD-RAM, and the like” that are digital versatile discs (DVD) and are standards established by the DVD Forum; “DVD+R, DVD+RW, and the like” that are standards established by the DVD+RW Alliance; a read-only memory (CD-ROM), a CD-RECORDABLE (CD-R), a CD-REWRITABLE (CD-RW), and the like that are compact discs (CD); a BLU-RAY (registered trademark) disc; a magneto-optical disc (MO); a flexible disk (FD); a magnetic tape; a hard disk; a read-only memory (ROM); an electrically erasable and rewritable read-only memory (EEPROM (registered trademark)); a flash memory; a random access memory (RAM); and a SECURE DIGITAL (SD) memory card.
A part or the entirety of the program may be, for example, retained or distributed by being recorded in the recording medium. The program may be transferred by using a transfer medium such as a wired network used in, for example, a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), the Internet, an intranet, and an extranet; a wireless communication network; or a combination thereof or may be carried by being superimposed on a carrier wave.
Furthermore, the program may be a part of another program or may be recorded in the recording medium along with a different program. The program may be recorded in a split manner in multiple recording media. The program may be recorded in any form such as compression and encryption provided that the program is restorable.
The above exemplary embodiments (particularly, the first exemplary embodiment to the fourth exemplary embodiment) may be recognized as follows.
[A] An image processing apparatus is characterized by including a splitting unit that splits an image into a block, a quantization unit that performs quantization of the block using plural methods, a feature extracting unit that extracts a feature of the block, a selecting unit that selects a quantization result of the quantization unit corresponding to the feature, and an encoding unit that performs fixed-length encoding of the quantization result selected by the selecting unit.
[B] The image processing apparatus according to [A] is characterized in that the quantization unit performs quantization using multiple methods in such a manner that resolution and tone have a trade-off relationship in the quantization result, and the feature extracting unit extracts a dynamic range of the block as the feature.
[C] The image processing apparatus according to [A] or [B] is characterized by further including an extracting unit that extracts a form of the quantization result, in which the selecting unit selects the quantization result corresponding to the form and the feature.
[D] The image processing apparatus according to any one of [A] to [C] is characterized by further including a calculating unit that calculates a distance between the block and the quantization result, in which the selecting unit selects the quantization result corresponding to the distance and the feature.
[E] An image processing apparatus is characterized by including a splitting unit that splits an image into a block, a feature extracting unit that extracts a feature of the block, a selecting unit that selects a quantization technique corresponding to the feature, a quantization unit that quantizes the block using the quantization technique selected by the selecting unit, and an encoding unit that performs fixed-length encoding of a quantization result of the quantization unit.
[F] An image processing program causes a computer to function as a splitting unit that splits an image into a block, a quantization unit that performs quantization of the block using plural methods, a feature extracting unit that extracts a feature of the block, a selecting unit that selects a quantization result of the quantization unit corresponding to the feature, and an encoding unit that performs fixed-length encoding of the quantization result selected by the selecting unit.
[G] An image processing program causes a computer to function as a splitting unit that splits an image into a block, a feature extracting unit that extracts a feature of the block, a selecting unit that selects a quantization technique corresponding to the feature, a quantization unit that quantizes the block using the quantization technique selected by the selecting unit, and an encoding unit that performs fixed-length encoding of a quantization result of the quantization unit.
The above exemplary embodiments of the invention achieve the following effects.
According to the image processing apparatus of [A], fixed-length encoding of the image can be performed without requiring BTC plane region information.
According to the image processing apparatus of [B], quantization can be performed by using multiple methods in such a manner that the resolution and the tone have a trade-off relationship in the quantization result.
According to the image processing apparatus of [C], the quantization result that corresponds to the form of the quantization result and to the feature of the block can be selected.
According to the image processing apparatus of [D], the quantization result that corresponds to the distance between the block and the quantization result and to the feature of the block can be selected.
According to the image processing apparatus of [E], fixed-length encoding of the image can be performed without requiring BTC plane region information.
According to the image processing program of [F], fixed-length encoding of the image can be performed without requiring BTC plane region information.
According to the image processing program of [G], fixed-length encoding of the image can be performed without requiring BTC plane region information.
The foregoing description of the exemplary embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, thereby enabling others skilled in the art to understand the invention for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2016-052655 | Mar 2016 | JP | national |