chapter-5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Chapter-5

Image Compression and Fusion


Lossy Compression Lossless Compression
1. The technique involves some loss of information. 1. Involves no loss of information.

2. Data that has been compressed using this technique 2. If data has been (lossless) compressed, the original
can’t be recovered and reconstructed exactly. data can be recovered from the compressed data.

3. Used for application that can tolerate difference 3. Used for application that can’t tolerate any
between the original and reconstructed data. difference between original and reconstructed data.

4. In return for accepting this distortion in 4. No loss in information so compression rate is


reconstructed data we obtain high compression rate small.

5. Sound and Image compression uses lossy 5. Text compression uses lossless compression
compression.
6. More data can be accommodated in channel. 6. Less data can be accommodated in channel.

7. Distortion 7. Distortion less


Image Compression
Goal: Reduce amount of data, for transmission or storage
Try to preserve information, so that image can be reconstructed:
Exactly (loss-less compression)
Approximately (lossy compression)

3
Examples of
Redundancy
JPEG is an image compression standard
that was developed by the “Joint
Photographic Experts Group”.
JPEG Compression for color image
8x8 blocks Source
Image

DCT-based encoding

Entropy Compressed
FDCT Quantizer
Encoder image data

Table Table
JPEG Compression

Main Steps in JPEG Image Compression


❑ Transform RGB to YIQ or YUV and subsample color.
❑ DCT on image blocks.
❑ Quantization.
❑ Zig-zag ordering and run-length encoding.
❑ Entropy coding.
JPEG Compression

Image in RGB components is converted into Luminance-Chrominance components


Chrominance Components are Converting from RGB to YCb Cr

CB & CR can result in negative. To bring it to positive & representable in 8 bits

The inverse color transformation is


JPEG Compression

▪ Baseline JPEG supports the subsampling of CB & CR according to 4:2:2 or 4:4:4 color formats
▪ Choosing 4:2:2 would be the first lossy step in the baseline compression
▪ The color space conversion is not applicable for Grayscale images
▪ Dimension of each component Y, Cb and Cr could be different, due to subsampling
▪ Each component is divided into 8 x 8 non overlapping blocks
▪ In non interleaved scan, each data blocks are coded from left to right & top to bottom
▪ In Interleaved scan, Minimum coded Unit (MCU) consists data blocks from all the three
components
❑ Level shift each pixel in the 8 x 8 block & convert it to signed integer (subtract 128)
❑ Transform each pixel in the block into frequency domain via forward discrete cosine
transform (FDCT)
❑ The FDCT for 8 x 8 block is defined by
❑ Transformed 8 × 8 block now consists of 64 DCT
coefficients
❑ The first coefficient F(0, 0) is the DC component
of the block
❑ DC components is the sum of all the 64 pixels in
the input scaled by 1/8
QUANTIZATION

Remaining 63 coefficients are AC components ACu,v = F(u, v) of the block. Each of the 64
coefficients are uniformly quantized
• Quantization Matrix gives the 64 quantization step-size parameters for uniform quantization
of the 64 DCT coefficients
– Each element in the quantization matrix is an integer between 1 and 255.
– Each DCT coefficient F(u, v) is divided by the corresponding quantizer step-size
parameter Q(u, v) in the quantization matrix and rounded to the nearest integer as
The JPEG quantization are given as follows:

16 11 10 16 24 40 51 61  17 18 24 47 99 99 99 99 
12 12 14 19 26 58 60 55 
18 21 26 66 99 99 99 99 
 
14 13 16 24 40 57 69 56   24 26 56 99 99 99 99 99 
   
14 17 22 29 51 87 80 62 
=
47 66 99 99 99 99 99 99 
QCL
18 QCR =
22 37 56 68 109 103 77   99 99 99 99 99 99 99 99 
   
 24 35 55 64 81 104 113 92   99 99 99 99 99 99 99 99 
 49 101  99

64 78 87 103 121 120
 99 99 99 99 99 99 99 
 
 72 92 95 98 112 100 103 99   99 99 99 99 99 99 99 99 
 c( i , j ) k 
u( i , j ) k = Round 
 Q( i , j )  
 
Where c(i , j ) k is the frequency image signals at coordinates (i,j) in the k block.
9. Huffman Coding

Encoding AC Components
o Only the nonzero coefficients are encoded
that the runs of zeros preceding a nonzero
value are embedded into the encoding.
o Irregular ordering of the AC coefficients is
called zig-zag ordering
9. Huffman Coding
• This sequence of AC coefficients is mapped into an intermediate sequence of a combination of two
symbols, symbol1, symbol2
– symbol1 is represented by a pair (RUNLENGTH, CATEGORY)
RUNLENGTH is the number of consecutive zeros preceding the nonzero AC coefficient being
encoded
CATEGORY is the number of bits to represent the VLI code of this nonzero AC coefficient
o symbol2 is a single piece of information designated (AMPLITUDE) that is encoded by the VLI
code of the nonzero AC coefficient.
• Assume the zigzag ordering results in the sequence as follows
−6 6 −5 0 2 0 −1 0 0 0 0 0 −1 0 0 −1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
• This can be represented as (0, 3)(−6), (0, 3)(6), (0, 3)(−5), (1, 2)(2), (1, 1)(−1), (5, 1)(−1), (2, 1)(−1), (0, 1)(1),
9. Huffman Coding

• Two special symbols in encoding the zig-zag sequence of AC coefficients


• (0,0) → referred to as EOB (end-of-block), to indicate that the remaining
elements in the zig-zag block are zeros
• (15, 0)→referred to as ZRL (zero-run-length) to indicate a run of 16
zeros
• Maximum length of a run of zeros allowed in baseline JPEG is 16
• Runs of more than 16 zeros should be broken into the number of runs of
zeros of length 16.
17
9. Huffman Coding
Category Values Bits for the value
1 -1,1 0,1
2 -3,-2,2,3 00,01,10,11
3 -7,-6,-5,-4,4,5,6,7 000,001,010,011,100,101,110,111
4 -15,...,-8,8,...,15 0000,...,0111,1000,...,1111
5 -31,...,-16,16,...31 00000,...,01111,10000,...,11111
6 -63,...,-32,32,...63 000000,...,011111,100000,...,111111
7 -127,...,-64,64,...,127 0000000,...,0111111,1000000,...,1111111
8 -255,..,-128,128,..,255 ...
9 -511,..,-256,256,..,511 ...
10 -1023,..,-512,512,..,1023 ...
11 -2047,..,- ...
1024,1024,..,2047
• Figure . Table of values and bits for the value
18
Example of Zero Run Length Coding

Example 1
63 AC coefficience:
57, 45, 0, 0, 0, 0, 23, 0, -30, -16, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,..., 0
Run Length Coding :
(0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) ; EOB
Example 2
63 AC coefficience:
57, 0, 0, ... , 0, 3, 0, 0, 0, 0, 2, 0, 0, ... , 0, 895, EOB
Run Length Coding :
(0,57) ; (15,0) ; (2,3) ; (4,2) ; (15,0) ; (15,0) ; (1,895) ; (0,0)
Example
Run lenth coding of 63 AC coefficiences :
(0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-8) ; (2,1) ; (0,0)

Encode the right value of these pair as category and bits for the value, except the special markers
like (0,0) or (15,0) :
(0,6,111001) ; (0,6,101101) ; (4,5,10111);
(1,5,00001) ; (0,4,0111) ; (2,1,1) ; (0,0)

The difference of DC coefficience :


-511

Encode the value as category and bits for the value :


9, 000000000
What is Image Fusion

Image fusion
combines multiple images of the same scene into a single
image which is suitable for human perception and practical
applications.
Image fusion is applicable for numerous fields including:
remote sensing and geosciences, robotics and industrial
engineering, and medical imaging.
Image Fusion
• Merging two or more images of a scene obtained from the same sensor at different
times or from different sensors at the same instant to form a single composite image
that has the maximum information content.

• Example application of image fusion: multi-focus images

Focus on left Focus on right Fused image


Image Fusion

Multi-scale Transform (MST) = Obtain Pyramid from Image


Inverse Multi-scale Transform (IMST) = Obtain Image from Pyramid
Multi-spectral Image

• Multi-spectral (MS) image is a


four-band image (Red, Green,
Blue, and near Infrared) which
has lower spatial resolution.
• A color image is a very simple
example of MS that contains
three bands.
Types of resolution

Spatial Resolution

• The smallest feature that is distinguishable on an image is


determined by the spatial resolution, the XY dimensions of
each pixel.

Spectral Resolution

• It refers to the number of different electromagnetic wavelength


bands recorded by the sensor.
Multiview Fusion
• Images of the same modality, taken at
the same time but from different places
or under different conditions
Goal: to supply complementary
information from different views
Multimodal fusion with different
resolution

One image with high spatial resolution,


the other one with low spatial but higher
spectral resolution.
Goal: An image with high spatial and
spectral resolution
Method: Replacingbands in DWT
• Multi-temporal Fusion
Images of the same scene taken at
different times (usually of the same modality)
Goal: Detection of changes
Method: Subtraction
• Multi-focus fusion
The original image can be divided into regions such that every region is in
focus in at least one channel
Goal: Image everywhere in focus
Method: identify the regions in focus and combine them together
Fusion for image restoration

Idea: Each image consists of “true” part and “degradation”, which


can be
removed by fusion
Types of degradation:
– additive noise: image denoising
– convolution: blind deconvolution
– resolution decimation: super-resolution
Fusion Techniques

The most important issue concerning image fusion is to


determine how to combine the sensor images.
Fusion techniques are commonly divided into two categories:
Spatial Domain Techniques:
Transform Domain Techniques :
Spatial Spectral
Meaning of
Pan-
Sharpening Multi-spectral image
& low spatial
Panchromatic & resolution
high spatial resolution

Multi-spectral &
high spatial resolution
Block-diagram for DCT
fusion
Block-diagram for wavelet
fusion

You might also like