Presentation is loading. Please wait.

Presentation is loading. Please wait.

IT472 Digital Image Processing

Similar presentations


Presentation on theme: "IT472 Digital Image Processing"— Presentation transcript:

1 IT472 Digital Image Processing
Asim Banerjee Faculty Block #1, Room No. 1109 Extn. # 554

2 Data Redundancies - Types
In image compression three basic data redundancies can be identified Coding redundancy Inter-pixel redundancy Psycho-visual redundancy NOTE: Data compression is achieved when one or more of these redundancies are reduced or eliminated. IT472 - Digital Image Processing

3 IT472 - Digital Image Processing
What is a Code? A code is a set of symbols (letters, numbers, bits, etc.) used to represent a body of information or set of events. Each piece of information or event is assigned a sequence of code symbols, called a code word. The number of symbols in each code word is its length. IT472 - Digital Image Processing

4 IT472 - Digital Image Processing
Coding Redundancy In general coding redundancy is present when the codes assigned to a set of gray-level values have not been selected to take full advantage of the probabilities of their occurrence in the image. It is always present when an image’s gray levels are represented in natural binary code. Assigning fewer bits to more frequently occurring gray levels than to less probable ones achieves compression. NOTE: This is also referred to as variable length coding. The histogram of an image is used to construct a code that reduces the amount of data used to represent it (the image). IT472 - Digital Image Processing

5 IT472 - Digital Image Processing
Coding Redundancy If the number of bits used to represent each value rk is l(rk) then the average number of bits required to represent each pixel is Lavg =  l(rk) pr(rk) where pr(rk) = nk / n k = 0,1,…,L-1 The total number of bits required to code an image of size M x N is MNLavg IT472 - Digital Image Processing

6 Coding Redundancy - Example
rk pr(rk) l(rk) Code 0.19 3 000 1 0.25 001 2 0.21 010 0.16 011 4 0.08 100 5 0.06 101 6 0.03 110 7 0.02 111 Lavg = 3 IT472 - Digital Image Processing

7 Coding Redundancy - Example
rk pr(rk) l(rk) Code 0.19 2 11 1 0.25 01 0.21 10 3 0.16 001 4 0.08 0001 5 0.06 00001 6 0.03 000001 7 0.02 000000 Lavg = ? and CR = ? IT472 - Digital Image Processing

8 Coding Redundancy - Example
rk pr(rk) l(rk) Code 0.19 2 11 1 0.25 01 0.21 10 3 0.16 011 4 0.08 0001 5 0.06 0011 6 0.03 00001 7 0.02 00011 Lavg = ? and CR = ? IT472 - Digital Image Processing

9 Interpixel Redundancy (1/2)
Interpixel redundancy exploits the correlation between pixels, that result from the structural or geometric relationships between the objects in the image. 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. NOTE: This is also known as spatial redundancy, geometric redundancy and interframe redundancy. IT472 - Digital Image Processing

10 Interpixel Redundancy (2/2)
In order to reduce interpixel redundancies in an image, the 2D pixel array must be transformed into a more efficient (usually nonvisual) format. Transformations of the type that remove interpixel redundancies are referred to as mappings NOTE: These become reversible mappings if the original image elements can be reconstructed from the transformed data set. IT472 - Digital Image Processing

11 Psychovisual Redundancy (1/2)
The brightness of a region as perceived by the eye, depends on factors other than simply the light reflected by the region. NOTE: Mach bands can be perceived in an area of constant intensity. Such a phenomena result from the fact that the eye does not respond with equal sensitivity to all visual information i.e. certain information has less relative importance than other information in normal visual processing. IT472 - Digital Image Processing

12 Psychovisual Redundancy (2/2)
This relatively less important information is said to be psychovisually redundant and can be easily eliminated without significantly impairing the quality of the perceived image. Psychovisual redundancy is associated with real or quantifiable visual information. NOTE: Since elimination of psychovisually redundant data results in a loss of quantitative information, it commonly referred to as quantization. IT472 - Digital Image Processing

13 IT472 - Digital Image Processing
Fidelity Criteria Removal of psychovisually redundant information results in a loss of real or quantifiable visual information. Because information of interest may be lost, a repeatable or reproducible means of quantifying the nature and extent of information loss is highly desirable. Two general classes of criteria are used as a basis for assessment Objective fidelity criteria Subjective fidelity criteria IT472 - Digital Image Processing

14 Objective Fidelity Criteria
When the level information loss is expressed as a function of the original or input image and the compressed and subsequently decompressed image, it is said to be based on an objective fidelity criteria. Example Root mean square error (RMSE) between the input and the output images. Mean square signal to noise ratio of the compressed-decompressed image. IT472 - Digital Image Processing

15 Subjective Fidelity Criteria
Although objective fidelity criteria offer a simple and convenient mechanism for evaluating information loss, most decompressed image are ultimately viewed humans, hence subjective evaluation by human observer is often more appropriate The typical mechanism is to have observers rate the images on a scale of (say) –4 to 4 to represent their subjective evaluation. NOTE: -4  worst 0  the same 4 best IT472 - Digital Image Processing

16 Image Compression Models
Source encoder and decoder Reduces or eliminates any coding, interpixel and/or psycho visual redundancies in the input image. Channel encoder and decoder Plays an important role when the channel is noisy or prone to error by inserting “controlled redundancy”. IT472 - Digital Image Processing

17 IT472 - Digital Image Processing
Types of Compression Lossless compression Huffman coding Bit-plane coding Run length coding Lossy compression Lossy predictive coding Transform coding JPEG IT472 - Digital Image Processing

18 IT523 - Digital Image Processing
Huffman Coding (1/2) It is the most popular technique for removing coding redundancy. When coding the symbols of an independent source individually, it yields the smallest possible number of code symbols per source symbol. It involves a series of source reductions by ordering the probabilities of symbols under consideration and combining the two lowest probability symbols into a single symbol that replaces them in the next source reduction. IT523 - Digital Image Processing

19 Source Reductions - Example
Source: “Digital Image Processing” by R. C. Gonzalez and R. E. Woods A series of source reductions by ordering the probabilities of symbols under consideration and combining the bottom two lowest probability symbols into a single symbol that replaces them in the next source reduction. IT523 - Digital Image Processing

20 IT523 - Digital Image Processing
Huffman Coding (2/2) The second step is to code each reduced source starting with the smallest source and working backwards to the original source. It is called a block code because each source symbol is mapped into a fixed sequence of code symbols. It is instantaneous because each code word in a sting of code symbols can be decoded without referencing succeeding symbols. It is uniquely decodable because any string of code symbols can be decoded in only one way. Source: “Digital Image Processing” by R. C. Gonzalez and R. E. Woods The Huffman code is an instantaneous uniquely decodable block code. IT523 - Digital Image Processing

21 IT523 - Digital Image Processing
Bitplane Coding (1/2) It reduces the images interpixel redundancies by processing the image’s bit planes individually. The multilevel images are decomposed into a series of binary images and then compressing the binary images using one of the several well-known binary compression methods. The images are often first gray coded before the bit plane decomposition is carried out to avoid too many 0 to 1 transitions across bit planes for pixel values that are close to each other. Binary compression methods like constant area coding, one-dimensional run length coding, 2-D run length coding and contour tracing and coding. IT523 - Digital Image Processing

22 IT523 - Digital Image Processing
Bitplane Coding (2/2) Normal Gray coded Normal Gray coded Source: “Digital Image Processing” by R. C. Gonzalez and R. E. Woods IT523 - Digital Image Processing

23 IT523 - Digital Image Processing
Run-length Coding (1/2) 1-D run length coding Represents each row or column of an image or a bit plane by a sequence of lengths that describe successive runs of black and white pixels. It is a standard compression approach in facsimile (FAX) coding. It involves specifying the value of the gray level and the length of that run. Binary compression methods like constant area coding, one-dimensional run length coding, 2-D run length coding and contour tracing and coding. IT523 - Digital Image Processing

24 IT523 - Digital Image Processing
Run-length Coding (2/2) The most common approaches for determining the value of a run are Specify the value of the first run of each row To assume that each row begins with a white run whose run length may be zero. NOTE: One can employ variable length coding on the run lengths themselves to achieve further compression. The same can be extended to 2-D run length coding. Binary compression methods like constant area coding, one-dimensional run length coding, 2-D run length coding and contour tracing and coding. IT523 - Digital Image Processing

25 Constant Area Coding (1/2)
A simple method to compress binary or bit plane images is to use special code words to denote large areas of continuous 0’s or 1’s. The image is divided into blocks of p x q pixels, which are classified as all black, all white or mixed. The most probable or frequently occurring category is assigned the 1-bit code word 0, and the other two categories are assigned 2 bit code words 10 and 11. IT472 - Digital Image Processing

26 Constant Area Coding (2/2)
Compression is achieved because the pq bits that normally would be normally used to represent each constant area are replaced by a 1-bit or 2-bit code words. NOTE: The code assigned to the mixed intensity category is used as a prefix which is followed by the pq bit pattern of the block. IT472 - Digital Image Processing

27 IT472 - Digital Image Processing
White Block Skipping When predominantly white text document are being compressed, one can code the solid white areas as 0 and all other blocks (including solid black blocks) by a 1 followed by the bit pattern of the block. A modification of the above (with block size 1 x q) is to code the solid white lines as 0 and all other lines with a 1 followed by the normal WBS code sequence. IT472 - Digital Image Processing

28 Variable Length Coding
The simplest approach to error free (lossless) image compression is to reduce only coding redundancy. This is achieved by assigning the shortest possible code words to the most probable gray levels Example - Huffman Coding NOTE: There are various other variable length coding startegies including a variants of the Huffman Coding viz. the truncated Huffman Coding; B-code and shift codes. IT472 - Digital Image Processing

29 IT472 - Digital Image Processing
Arithmetic Coding (1/2) Arithmetic coding generates non-block codes. In it, a one to one correspondence between source symbols and code words does not exist. Instead an entire sequence of source symbols (or message) is assigned a single arithmetic code word. The code word itself defines an interval of real numbers between 0 and 1. IT472 - Digital Image Processing

30 IT472 - Digital Image Processing
Arithmetic Coding (2/2) As the number of symbols in the message increases, the interval used to represent it becomes smaller and the number of information unit (bits) required to represent the interval becomes larger. Each symbol of the message reduces the size of the interval in accordance with its probability of occurrence. NOTE: It achieves (theoretically) the bound established by the noiseless coding theorem. IT472 - Digital Image Processing

31 Noiseless Coding Theorem
When both the information channel and communication system are error free, the principal function of the communication system is to represent the source as compactly as possible. Under such circumstances, noiseless coding theorem (aka Shannon’s first theorem) defines the minimum average code word length per source symbol that can be achieved. IT472 - Digital Image Processing

32 Lossless Predictive Coding (1/3)
It is based on eliminating the interpixel redundancies of closely spaced pixels by extracting and coding only the new information in each pixel. The new information of a pixel is defined as the difference between the actual and the predicted value of that pixel. The system consists of an encoder and decoder each having an identical predictor. IT472 - Digital Image Processing

33 Lossless Predictive Coding (2/3)
Predictor Nearest Integer Symbol Encoder Encoder Input Image Compressed Image O/P + - IT472 - Digital Image Processing

34 Lossless Predictive Coding (3/3)
Predictor Symbol Decoder Decoder Decompressed Image O/P Compressed Image I/P + IT472 - Digital Image Processing

35 IT472 - Digital Image Processing
Lossy Compression Lossy encoding is based on the concept of compromising the accuracy of the reconstructed image in exchange for increased compression. The idea is, if the resulting distortion is tolerable (at times not visually significant), and the increase in compression is significant, then the approach is worthwhile. Typical compression ratios achieved by these approaches are of the order of 10:1 to 100:1. NOTE: Lossless the figure is 3:1 IT472 - Digital Image Processing

36 Lossy Predictive Coding (1/2)
Predictor Symbol Encoder Encoder Input Image + - Quantizer en en' fn' fn ^ Compressed Image O/P IT472 - Digital Image Processing

37 Lossy Predictive Coding (2/2)
Predictor Symbol Decoder Decompressed Image O/P Compressed Image I/P + - Decoder IT472 - Digital Image Processing

38 Subimage Size Selection
It is a significant factor affecting the transform coding error and computational complexity. In most applications, the image is subdivided so that the correlation (redundancy) between adjacent subimages is reduced to some acceptable level The subimage dimension, n, is an integer power of 2. NOTE: Both the level of compression and computational complexity increase as the subimage size increases. IT472 - Digital Image Processing

39 IT472 - Digital Image Processing
Bit Allocation (1/2) The overall process of truncating, quantizing and coding the coefficients in a transformed subimage is commonly called bit allocation. The reconstruction error associated with the truncated series expansion of the transform code is a function of The number and relative importance of the transform coefficients that are discarded The precision that is used to represent the retained coefficients. IT472 - Digital Image Processing

40 IT472 - Digital Image Processing
Bit Allocation (2/2) NOTE: If the retained coefficients are selected on the basis of Maximum variance – zonal coding Maximum magnitude – threshold coding IT472 - Digital Image Processing

41 IT472 - Digital Image Processing
Assignment What is LZW coding? Give an example of using LZW coding. What are the tradeoffs involved in LZW coding? Submit by: 12:00 hrs on 6th March 2011. IT472 - Digital Image Processing

42 Transform Coding System
Source: “Digital Image Processing” by R. C. Gonzalez and R. E. Woods IT523 - Digital Image Processing

43 Compression Standards
Jointly developed and sanctioned by International Standardization Organization (ISO) Consultative Committee of the International Telephone and Telegraph (CCITT) Examples JPEG standard MPEG standard (MPEG 1 and MPEG 2) IT472 - Digital Image Processing

44 IT472 - Digital Image Processing
Assignment Write a short report on JPEG standard (JPEG and JPEG2000) MPEG standards (viz. MPEG 1, MPEG 2, MPEG 4, MPEG 7 and MPEG 21) Submit by: 12:00 hrs on 6th March 2011. IT472 - Digital Image Processing

45 That’s all for now. We shall continue in the next class.
IT472 - Digital Image Processing


Download ppt "IT472 Digital Image Processing"

Similar presentations


Ads by Google