0% found this document useful (0 votes)
34 views7 pages

DC 2

always available

Uploaded by

srigoutham2414
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
34 views7 pages

DC 2

always available

Uploaded by

srigoutham2414
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
2. Introduction to image compression The term data compression refers to the process of reducing the amount of data required to represent a given quantity of information. A clear distinction must be made between data and information. They are not synonymous. In fact, data are the means by which information is conveyed, Various amounts of data may be used to represent the same amount of information. That is, it contains data (or words) that either provide no relevant information or simply restate that which is already known, It is thus said to contain data redundancy. Data redundancy is a central issue in digital image compression. It is e compression. It is not an abstract concept but a mathematically quantifiable entity. If m: and nz denote the number of information-carrying units in two data sets that represent the same information, the relative data redundancy Rp of the first data set (the one characterized by ni) can be defined as, Rp Ce Where Cx commonly called the compression ratio, as Cn m For the case nz = mi, Ck = 1 and Ro = 0, indicating that (relative to the second data set) the first representation of the information contains no redundant data, When me ny, CR co» and Rp ~ —oo implying significant compression and highly redundant data. Finally, when n2>> m1, Cx — 0 and Rp + —o, indicating that the second data set contains much more data than the original representation. In general, Cx and Rp lie in the open intervals (0, 00) and (-00, 1), respectively. A practical compression ratio, such as 10 (or 10:1), means that the first data set has 10 information carrying units (say, bits) for every 1 unit in the second or compressed data set. The corresponding redundancy of 0.9 implies that 90% of the data in the first data set is redundant. In digital image compression, three basic data redundancies can be identified and exploited: 1. coding redundancy, 2. interpixel redundancy, 3. Psychovisual redundancy. Data compression is achieved when one or more of these redundancies are reduced or eliminated. 2.1 Coding Redundancy We know that how the gray-level histogram of an image can provide a great deal of insight into the construction of codes to reduce the amount of data used to represent it. Let us assume, that a discrete random variable rg in the interval [0,1] represents the gray levels of an image and that each T« occurs with probability pr(ri), which is given by, Pr(ry) =" where L is the number of gray levels, nis the number of times that the kth gray level appears in the image, and n is the total number of pixels in the image. If the number of bits used to represent each value of rx is I(r), then the average number of bits required to represent each pixel is Lavg =) Ura dPr(re) & That is, the average length of the code words assigned to the various gray-level values is found by summing the product of the number of bits used to represent each gray level and the probability that the gray level occurs. Thus the total number of bits required to code an M X N image is MNLavg. Assigning fewer bits to the more probable gray levels than to the less probable ones achieves data compression. This process commonly is referred to as variable-length coding. If the gray levels of an image are coded in a way that uses more code symbols than absolutely necessary to represent each gray level, the resulting image is said to contain coding redundancy. In general, coding redundancy is present when the codes assigned to a set of events (such as gray-level values) have not been selected to take full advantage of the probabilities of the events. It is almost always present when an image's gray levels are represented with a straight or natural binary code. In this case, the underlying basis for the coding redundancy is that images are typically composed of objects that have a regular and somewhat predictable morphology (shape) and reflectance, and are generally sampled so that the objects being depicted are much larger than the picture elements. The natural consequence is that, in most images, certain gray levels are more probable than others. A natural binary coding of their gray levels assigns the same number of bits to both the most and least probable values, thus failing to minimize Lavgand resulting in coding redundancy. 2.2 Interpixel Redundancy Consider the images shown in Figs. 1(a) and (b). As Figs. 1(c) and (d) show, these images have virtually identical histograms. Note also that both histograms are trimodal, indicating the presence of three dominant ranges of gray-level values. Because the gray levels in these images are not equally probable, variable-length coding can be used to reduce the coding redundancy that would result from a straight or natural binary encoding of their pixels. The coding process, however, would not alter the level of correlation between the pixels within the images. In other words, the codes used to represent the gray levels of each image have nothing to do with the correlation between pixels. These correlations result from the structural or geometric relationships between the objects in the image. These illustrations reflect another important form of data redundancy—one directly related to the interpixel correlations within an image. Because the value of any given pixel can be reasonably predicted from the value of its neighbors, the information carried by individual pixels is relatively small. Much of the visual contribution of a single pixel to an image is redundant; it could have been guessed on the basis of the values of its neighbors, A variety of names, including spatial redundancy, geometric redundancy, and interframe redundancy, have been coined to refer to these interpixel dependencies. We use the term interpixel redundancy to encompass them all. Figure 1: Two images (a) and (b) and their gray- level histograms (c) and (D) In order to reduce the interpixel redundancies in an image, the 2-D pixel array normally used for human viewing and interpretation must be transformed into a more efficient (but usually "nonvisual") format, For example, the differences between adjacent pixels can be used to represent an image, Transformations of this type (that is, those that remove interpixel redundancy) are referred to as mappings. They are called reversible mappings if the original image elements can be reconstructed from the transformed data set. 2.3 Psychovisual Redundancy We know that the brightness of a region, as perceived by the eye, depends on factors other than simply the light reflected by the region. For example, intensity variations (Mach bands) can be perceived in an area of constant intensity. Such phenomena result from the fact that the eye does not respond with equal sensitivity to all visual information, Certain information simply has less relative importance than other information in normal visual processing. This information is said to be psychovisually redundant. It can be eliminated without significantly impairing the quality of image perception, That psychovisual redundancies exist should not come as a surprise, because human perception of the information in an image normally does not involve quantitative analysis of every pixel value in the image. In general, an observer searches for distinguishing features such as edges or textural regions and mentally combines them into recognizable groupings. The brain then correlates these groupings with prior knowledge in order to complete the image interpretation process. Psychovisual redundancy is fundamentally different from the redundancies discussed earlier. Unlike coding and interpixel redundancy, psychovisual redundancy is associated with real or quantifiable visual information. Its elimination is possible only because the information itself is not essential for normal visual processing. Since the elimination of psychovisually redundant data results in a loss of quantitative information, it is commonly referred to as quantization. This terminology is consistent with normal usage of the word, which generally means the mapping of a broad range of input values to a limited number of output values. As it is an irreversible operation (visual information is lost), quantization results in lossy data compression. Improved gray-scale (IGS) quantization method recognizes the eye's inherent sensitivity to edges and breaks them up by adding to each pixel a pseudorandom number, which is generated from the low-order bits of neighboring pixels, before quantizing the result, Because the low-order bits arc fairly random, this amounts to adding a level of randomness, which depends on the local characteristics of the image, to the artificial edges normally associated with false contouring. 3, Approaches to Image Compression Approach 1: This is appropriate for bi-level images. A pixel in such an image is represented by one bit. Applying the principle of image compression to a bi-level image therefore means that the immediate neighbors of a pixel P tend to be identical to P. Thus, it makes sense to use run-length encoding (RLE) to compress such an image. A compression method for such an image may scan it in raster order (row by row) and compute the lengths of runs of black and white pixels. The lengths are encoded by variable-size (prefix) codes and are written on the compressed stream. An example of such a method is facsimile compression. Approach 2: Also for bi-level images. The principle of image compression tells us that the neighbors of a pixel tend to be similar to the pixel. We can extend this principle and conclude that if the current pixel has color c (where c is either black or white), then pixels of the same color seen in the past (and also those that will be found in the future) tend to have the same immediate neighbors, This approach looks at n of the near neighbors of the current pixel and considers them an n- bit number. This number is the context of the pixel. In principle there can be 2n contexts, but because of image redundancy we expect them to be distributed in a nonuniform way. Some contexts should be common while others will be rare. This approach is used by JBIG. Approach 3: Separate the grayscale image into n bi-level images and compress each with RLE and prefix codes. The principle of image compression seems to imply intuitively that two adjacent pixels that are similar in the grayscale image will be identical in most of the n bi-level images. This, however, is not true. An example of such a code is the reflected Gray codes. Approach 4: Use the context of a pixel to predict its value. The context of a pixel is the values of some of its neighbors, We can examine some neighbors of a pixel P, compute an average A of their values, and predict that P will have the value A. The principle of image compression tells us that our prediction will be correct in most cases, almost correct in many cases, and completely wrong in a few cases. This is used in MLP method. Approach 5: Transform the values of the pixels and encode the transformed values. Recall that compression is achieved by reducing or removing redundancy. The redundancy of an image is caused by the correlation between pixels, so transforming the pixels to a representation where they are decorrelated eliminates the redundancy. It is also possible to think of a transform in terms of the entropy of the image. In a highly correlated image, the pixels tend to have equiprobable values, which results in maximum entropy. If the transformed pixels are decorrelated, certain pixel values become common, thereby having large probabilities, while others are rare, This results in small entropy. Quantizing the transformed values can produce efficient lossy image compression. Approach 6: The principle of this approach is to separate a continuous-tone color image into three grayscale images and compress each of the three separately; using approaches 3, 4, or 5. For a continuous-tone image, the principle of image An important feature of this approach is to use a luminance chrominance color representation instead of the more common RGB. The advantage of the luminance chrominance color representation is that the eye is sensitive to small changes in luminance but not in chrominance, This allows the loss of considerable data in the chrominance components, while making it possible to decode the image without a significant visible loss of quality. Approach 7: A different approach is needed for discrete-tone images. Recall that such an image contains uniform regions, and a region may appear several times in the image. A good example is a screen dump. Such an image consists of text and icons. Each character of text and each icon is a region, and any region may appear several times in the image. A possible way to compress such an image is to scan it, identify regions, and find repeating regions. If a region B is identical to an already found region A, then B can be compressed by writing a pointer to A on the compressed stream, The block decomposition method (FABD) is an example of how this approach can be implemented. Approach 8: Partition the image into parts (overlapping or not) and compress it by processing the parts one by one. Suppose that the next unprocessed image part is part number 15. Try to match it with parts 1-14 that have already been processed. If part 15 can be expressed, for example, as a combination of parts 5 (scaled) and 11 (rotated), then only the few numbers that specify the combination need be saved, and part 15 can be discarded, If part 15 cannot be expressed as a combination of already-processed parts, itis declared processed and is saved in raw format. ‘This approach is the basis of the various fractal methods for image compression. It applies the principle of image compression to image parts instead of to individual pixels. Applied this way, the principle tells us that “interesting” images (i.e,, those that are being compressed in practice) have a certain amount of self similarity. Parts of the image are identical or similar to the entire image or to other parts. 4. Gray Codes and its significance for image compression ‘An image compression method that has been developed specifically for a certain type of image can sometimes be used for other types. Any method for compressing bi-level images, for example, can be used to compress grayscale images by separating the bitplanes and compressing each individually, as if it were a bi-level image. Imagine, for example, an image with 16 grayscale values. ch pixel is defined by four bits, so the image can be separated into four bi-level images. The trouble with this approach is that it violates the general principle of image compression, Imagine two adjacent 4-bit pixels with values 7 = 01112 and 8 = 10002, These pixels have close values, but when separated into four bitplanes, the resulting 1-bit pixels are different in every bitplane! This is because the binary representations of the consecutive integers 7 and 8 differ in all four bit positions. In order to apply any bilevel compression method to grayscale images, a binary

You might also like