0% found this document useful (0 votes)
3 views

Lecture - 2 Multimedia

The document outlines the principles of image compression and coding, focusing on the redundancies present in images and the classification of these redundancies. It discusses both lossless and lossy compression techniques, detailing the elements of image compression and decompression systems. Additionally, it covers methods for measuring the quality of reconstructed images, such as Mean Square Error, Signal-to-Noise Ratio, and Peak Signal-to-Noise Ratio.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lecture - 2 Multimedia

The document outlines the principles of image compression and coding, focusing on the redundancies present in images and the classification of these redundancies. It discusses both lossless and lossy compression techniques, detailing the elements of image compression and decompression systems. Additionally, it covers methods for measuring the quality of reconstructed images, such as Mean Square Error, Signal-to-Noise Ratio, and Peak Signal-to-Noise Ratio.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Multimedia Systems and Applications

Image Compression and Coding


Outline

• Redundancies present in an image

• Classification of redundancies

• Image compression

• Measuring the quality of reconstructed images

• Elements of an image compression system

• Elements of an image decompression system


Introduction

• One of the major challenges in multimedia communication is


to transmit the multimedia signals especially the image and the
video signals through limited bandwidth channels.

• It is possible to achieve compression by exploiting the


redundancies present in image and video signals.

• Redundancies are exploited at the transmission end.

• The compressed image and video signals are represented in an


encoded form.
• A reversal of this process is needed at the receiver end before
the signal can be reconstructed and presented.

• All image and video compression techniques are not exactly


reversible.

• Some compression techniques are lossless in the sense that


exact reconstruction is possible.

• Some compression techniques achieve a greater amount of


compression by incurring some loss of quality.

• The compression schemes adopted for images and videos are


same in nature, except for the fact that video signals are
spatio-temporal in nature.
Redundancies present in an image

• Image compression - possible by exploiting various kinds of


redundancies which are present in an image.

• The extent of redundancies may vary from image to image.

Fig. 1: Image at the left has less details and more redundancy
Fig. 2: Texture image contains less redundancy

• Fig. 2 has much higher degree of details and hence less


redundancies as compared to Fig. 1.
Fig. 3: Image containing one rectangular foreground against background

• To represent the above image without incurring any loss of


data, we need to include only the following information
● Background intensity

● Foreground intensity

● Size and position of the foreground object.


• If the
● Intensity levels are represented by 1 byte each

● Size (height and width) by 2 bytes

● Position (x-y coordinates of a reference corner point) by 2 bytes

• We require just 6 bytes of data as compared to the original


256 x 256 pixel array consisting of 65536 bytes.

• In this case very high compression is achievable.


Fig. 4: Random Dot Image

• We cannot perceive any redundancy from Fig. 4. It is a


synthetically generated random-dot image.

• It is not possible to predict any pixel from its immediate


neighbors.
• To represent Fig. 4. without incurring any loss, we need to
include each pixel value individually and hence there is no
redundancy.

• Natural images however are not as simple as that of Fig. 3


and not as complex as that of Fig. 4.

• Therefore the extent of redundancy varies from image to


image.
Classification of Redundancies

• Statistical Redundancy

• Psychovisual Redundancy
Statistical Redundancy

• Statistical redundancy occurs due to the fact that pixels within


an image tend to have very similar intensities as those of its
neighborhood, except at the object boundaries or illumination
changes.

• For still images, statistical redundancies are essentially spatial


in nature.

• For natural two-dimensional images, redundancies are present


along both the x- and y-dimensions.

• Video signals exhibit yet another form of statistical


redundancy and that is temporal.
Psychovisual Redundancy

• Psychovisual redundancy arises due to the problem of


perception.

• Our eyes are more responsive to slow and gradual changes of


illumination than perceiving finer details and rapid changes of
intensities.

256 gray levels 16 gray levels


Image compression

• Lossless Image Compression

• Lossy Image Compression


Lossless Image Compression

• Lossless image compression schemes exploit redundancies


without incurring any loss of data.

• Data stream prior to encoding and after decoding is exactly the


same and no distortion in the reconstruction quality is
observed.

• Lossless image compression is therefore exactly reversible.

• Lossless compression is achieved through the exploitation of


statistical redundancy.
• For example, we transform the image into a string of symbols
prior to encoding.

• Encoding process can be exactly reversed during decoding,


since there is an one-to-one mapping between the symbols and
their codes.

• Schemes such as run-length encoding, entropy coding,


Ziv-Lempel coding etc., can achieve lossless compression.

• Lossless image compression schemes can achieve only limited


extent of bandwidth reduction for data transmission.

• Lossless image compression preserves the quality of the


image, without suffering any distortion.
Lossy Image Compression

• Lossy image compression schemes incur loss of data and


hence suffer a loss of quality in reconstruction.

• In lossy image compression, the image is first transformed


into a string of symbols, which are quantized to a discrete set
of allowable levels.

• In this scheme, it is possible to achieve significant data


compression, but quantization being a many-to-one mapping is
irreversible, therefore exact reconstruction is never possible.

• Lossy compression schemes essentially exploit the


psychovisual redundancy.
Measuring the quality of reconstructed images

• Mean Square Error (MSE)

• Signal-to-Noise Ratio (SNR)

• Peak Signal-to-Noise Ratio (PSNR)


Mean Square Error (MSE)

• The simplest measure often employed to measure the quality


of such reconstructed images is Mean Square Error (MSE).

• For an M x Noriginal image array (i,j) where i and j are the


row and column indices, (i=0,1,……, M-1; j=0,1,……, N-1)

• If (i,j) is the reconstructed image array of the same size, the


MSE is given by
Mean Square Error (MSE)

• The reconstruction quality is also measured with


Signal-to-Noise Ratio (SNR)

• The noise power is measured with respect to the actual signal


power.

• The measure is given by


Peak Signal-to-Noise Ratio (PSNR)

• The reconstruction quality is also measured with


Peak Signal-to-Noise Ratio (PSNR)

• The noise power is measured with respect to the peak signal


power, considering the intensities in the range of 0-255.

• The measure is given by


• SNR and PSNR measures are expressed in the units of
decibels (dB).

• The measures MSE, SNR, PSNR often do not correspond well


to the perceptual quality.

• In absence of any perceptual measure, which is essentially


subjective in nature, one can use these measures to judge the
quality of reconstruction.
Example 1

• A given 4 x 4 image array and its corresponding reconstructed


image array obtained through lossy compression scheme are
given below. Calculate the (a) MSE (b) SNR (c) PSNR of the
reconstructed image array

Original Reconstructed
Elements of Image Compression System
• Due to the high degree of statistical (spatial) and psychovisual
redundancies present in a natural image, it can be compressed
without significant degradation of the visual quality.

• A typical image compression system consists of the following


elements
● Transformer

● Quantizer

● Coder

• An image compression system is often referred to in the


literature as image encoder.
Fig. 5: Elements of Image encoding system

Transformer

• This block transforms the original input data into a form that is
more amenable to compression.

• The transformation can be local, involving pixels in the


neighbourhood or global, involving the full image or a block
of pixels.
• The example of local transformation is linear predictive coding
followed by Differential Pulse Code Modulation (DPCM)

• Global transformation techniques use


● Discrete Fourier Transforms (DFT)

● Discrete Cosine Transforms (DCT)

● Discrete Wavelet Transforms (DWT)

• The transformer block transforms the original spatial domain


signal into another spatial domain signal of reduced dynamic
range.

• This block in itself does not perform any compression and is


lossless.
Quantizer

• The quantizer follows the transformer block in image


compression systems.

• It generates a limited number of symbols that can be used in


the representation of the transformed signal.

• It is a many-to-one mapping which is irreversible.

• Quantizers are of two basic types


● Scalar quantization

● Vector quantization
• Scalar quantization refers to element-by-element quantization
of data.

• Vector quantization refers to quantization of a block at a time.

• Quantization exploits psychovisual redundancy and achieves


significant bit reduction.

• It is the only block in image compression system, which is


lossy.
Coder

• Coders assign a code word, a binary bit-stream, to each


symbol at the output of the quantizer.

• The coder may employ


● Fixed Length Coding (FLC)

● Variable Length Coding (VLC)


• FLC which have code word length fixed, irrespective of the
probabilities of occurrence of quantized symbols.

• VLC is also known as entropy coding.

• VLC assigns code words in such a way as to minimize the


average length of the binary representation of the symbols.

• This is achieved by assigning shorter code words to the more


probable symbols.
Elements of Image Decompression System
• The output of an image compression system is a bit stream in
an encoded form and hence can not be displayed.

• The encoded bit stream is sent through a communication


channel, which is ideally lossless but lossy for all practical
channels.

• At the receiver end, the encoded bit stream received through


the communication channel has to be decoded before it can be
displayed.
• A typical image decompression system consists of the
following elements
● Decoder

● De-quantizer

● Inverse Transformer

• The image de-compression system, also known as image


decoding system does exact reversal of the processes adopted
during encoding.
Fig. 5: Elements of Image decoding system

Image decoder

• Performs exact reversal of the coder in image compression


system.

• This block extracts the quantized coefficients.


De-Quantizer

• Performs inverse of the quantization operation in image


compression.

• Since quantizer itself is lossy, de-quantization can never


exactly recover the transformed coefficients.

Inverse Transformer

• Performs exact reversal of the transformation operation carried


out in the corresponding image compression system.

• The output of this block can be used for display.

You might also like