Spandana image processing and compression techniques (7840228)
1. IMAGE PROCESSING AND
COMPRESSION
TECHNIQUES
By T. Spandana
094D1A0426
E.C.E
SSIET,Vadiyampeta.
1
2. Objective
The objective of image processing is to sharpen, minimize the
effect of degradation, reduce the amount of memory to store the image
information (image compression).
2
3. Introduction
Image processing pertains to the alteration and analysis
of pictorial information.
Common case of image processing is the adjustment
of brightness and contrast controls on a television set by
doing this we enhance the image until its subjective
appearing to us is most appealing.
3
4. Terminology
What is the Digital Image Processing?
Digital:
Operating by the use of discrete signals to represent data in the
form of numbers.
Image:
An image (from Latin imago) or picture is an artefact, usually
two-dimensional.
Processing:
To perform operations on data according to programmed
instructions.
4
5. Definition
Thus the definition of the digital image processing may be given
as:
“Digital image processing is the use of
computer algorithms to perform image
processing on digital images ”
5
6. Digital image:
An image may be defined as a two-
dimensional function, f(x, y).
A digital image is composed of a finite
number of elements.
These elements are referred to as picture
elements, image elements, pels, and pixels.
6
18. Image Compression
Image compression addresses the problem of reducing the
amount of data required to represent a digital image.
It is the sub areas of image processing.
The underlying basis of the reduction process is the removal of
the redundant data.
18
19. Goal of Image Compression
Digital images require huge amounts of space for storage and large
bandwidths for transmission.
The goal of image compression is to reduce the amount of data
required to represent a digital image.
19
20. The Flow of Image Compression
To store the image into bit-stream as compact as possible
and to display the decoded image in the monitor as exact
as possible
Original Image Decoded Image
Bitstream
Encoder 0101100111... Decoder
Figure: Flow of compression
20
21. Different Compression Techniques
Mainly two types of data Compression techniques are
there.
Loss less Compression.
Lossy Compression.
21
26. Run-length:
•Simplest method of compression.
• It can be used to compress data made of any combination of symbols.
•It does not need to know the frequency of occurrence of symbols and
can be very efficient if data is represented as 0s and 1s.
•The general idea behind this method is to replace consecutive
repeating occurrences of a symbol by one occurrence of the symbol
followed by the number of occurrences.
26
27. For instance,
Figure : Run-length encoding example
27
31. A character’s code is found by starting at the root and following the
branches that lead to that character. The code itself is the bit value of each
branch on the path, taken in sequence.
Figure Final tree and code
31
32. Encoding
Let us see how to encode text using the code for our five
characters. Figure shows the original and the encoded text.
Figure Huffman encoding
32
33. Decoding
The recipient has a very easy job in decoding the data it receives.
Figure shows how decoding takes place.
Figure : Huffman decoding
33
35. Lempel Ziv encoding
Lempel Ziv (LZ) encoding is an example of a category of algorithms
called dictionary-based encoding.
The idea is to create a dictionary (a table) of strings used during the
communication session.
35
36. The LZW Algorithm (Compression)
Flow Chart START
W= NULL
YES
IS EOF STOP
? N
O
K=NEXT INPUT
YES
IS WK
W=WK
FOUND?
N
O
OUTPUT INDEX OF W
ADD WK TO DICTIONARY
W=K
36
37. The LZW Algorithm (Compression)
Example
Input string is
a b d c a d a c
The Initial Dictionary
contains symbols like
a, b, c, d with their
index values as 1, 2, 3,
4 respectively.
a 1
Now the input string b 2
is read from left to c 3
right. Starting from a.
d 4
37
38. The LZW Algorithm (Compression)
Example
W = Null a b d c a d a c
K=a
WK = a
K
In the dictionary.
a 1
b 2
c 3
d 4
38
39. The LZW Algorithm (Compression)
Example
K = b. a b d c a d a c
WK = ab
is not in the dictionary.
K
Add WK to
dictionary 1
Output code for a.
a 1 ab 5
Set W = b
b 2
c 3
d 4
39
40. The LZW Algorithm (Compression)
Example
K=d a b d c a d a c
WK = bd
Not in the dictionary.
K
Add bd to dictionary.
Output code b 1 2
Set W = d
a 1 ab 5
b 2 bd 6
c 3
d 4
40
41. The LZW Algorithm (Compression)
Example
K=a a b d a b d a c
WK = da
not in the dictionary. K
Add it to dictionary.
Output code d
1 2 4
Set W = a
a 1 ab 5
b 2 bd 6
c 3 da 7
d 4
41
42. The LZW Algorithm (Compression)
Example
K=b a b d a b d a c
WK = ab
It is in the dictionary. K
1 2 4
a 1 ab 5
b 2 bd 6
c 3 da 7
d 4
42
43. The LZW Algorithm (Compression)
Example
K=d a b d a b d a c
WK = abd
Not in the dictionary. K
Add W to the
dictionary. 1 2 4 5
Output code for W.
a 1 ab 5
Set W = d
b 2 bd 6
c 3 da 7
d 4 abd 8
43
44. The LZW Algorithm (Compression)
Example
• K=a a b d a b d a c
• WK = da
In the dictionary. K
1 2 4 5
a 1 ab 5
b 2 bd 6
c 3 da 7
d 4 abd 8
44
45. The LZW Algorithm (Compression) Example
• K=c a b d a b d a c
• WK = dac
Not in the dictionary. K
• Add WK to the
dictionary. 1 2 4 5 7
• Output code for W.
a 1 ab 5 dac 9
• Set W = c
b 2 bd 6
• No input left so
output code for W. c 3 da 7
d 4 abd 8
45
46. The LZW Algorithm (Compression)
Example
• The final output a b d a b d a c
string is
124573
K
• Stop.
1 2 4 5 7 3
a 1 ab 5 dac 9
b 2 bd 6
c 3 da 7
d 4 abd 8
46
47. LZW Decompression Algorithm Flow Chart
START
K=INPUT
Output K
W=K
YES
IS EOF STOP
?
NO
K=NEXT INPUT
ENTRY=DICTIONARY INDEX (K)
Output ENTRY
ADD W+ENTRY[0] TO DICTIONARY
W=ENTRY
47
48. The LZW Algorithm (Decompression) Example
1 2 4 5 7 3
• K=1
• Out put K (i.e. a)
K
• W=K
a
a 1
b 2
c 3
d 4
48
49. The LZW Algorithm (Decompression) Example
1 2 4 5 7 3
• K=2
• entry = b
K
• Output entry
• Add W + entry[0] to a b
dictionary
• W = entry[0] (i.e. b)
a 1 ab 5
b 2
c 3
d 4
49
50. The LZW Algorithm (Decompression) Example
1 2 4 5 7 3
• K=4
• entry = d
K
• Output entry
• Add W + entry[0] to a b d
dictionary
• W = entry[0] (i.e. d)
a 1 ab 5
b 2 bd 6
c 3
d 4
50
51. The LZW Algorithm (Decompression) Example
1 2 4 5 7 3
• K=5
• entry = ab
K
• Output entry
• Add W + entry[0] to a b d a b
dictionary
• W = entry[0] (i.e. a)
a 1 ab 5
b 2 bd 6
c 3 da 7
d 4
51
52. The LZW Algorithm (Decompression) Example
1 2 4 5 7 3
• K=7
• entry = da
K
• Output entry
• Add W + entry[0] to a b d a b d a
dictionary
• W = entry[0] (i.e. d)
a 1 ab 5
b 2 bd 6
c 3 da 7
d 4 abd 8
52
53. The LZW Algorithm (Decompression) Example
1 2 4 5 7 3
• K=3
• entry = c
K
• Output entry
• Add W + entry[0] to a b d a b d a c
dictionary
• W = entry[0] (i.e. c)
a 1 ab 5 dac 9
b 2 bd 6
c 3 da 7
d 4 abd 8
53
56. LOSSY COMPRESSION
METHODS
Several methods have been developed using lossy compression
techniques.
JPEG (Joint Photographic Experts Group) encoding is used to
compress pictures and graphics.
MPEG (Moving Picture Experts Group) encoding is used to compress
video.
MP3 (MPEG audio layer 3) for audio compression.
56
62. Discrete cosine transform (DCT)
In this step, each block of 64 pixels goes through a transformation
called the discrete cosine transform (DCT).
The transformation changes the 64 values so that the relative
relationships between pixels are kept but the redundancies are
revealed.
P(x, y) defines one value in the block, while T(m, n) defines the
value in the transformed block.
62
64. Quantization
After the T table is created, the values are quantized to reduce the
number of bits needed for encoding.
Quantization divides the number of bits by a constant and then drops
the fraction. This reduces the required number of bits even more.
.
64
69. Video compression – MPEG encoding
The Moving Picture Experts Group (MPEG) method is used to
compress video.
Principle, a motion picture is a rapid sequence of a set of frames in
which each frame is a picture.
Compressing video, then, means spatially compressing each frame
and temporally compressing a set of frames.
69
70. Spatial compression
The spatial compression of each frame is done with JPEG, or a
modification of it. Each frame is a picture that can be independently
compressed.
Temporal compression
In temporal compression, redundant frames are removed. When we
watch television, for example, we receive 30 frames per second.
However, most of the consecutive frames are almost the same.
70
73. Audio compression
Audio compression can be used for speech or music. For speech
we need to compress a 64 kHz digitized signal, while for music we
need to compress a 1.411 MHz signal.
Two categories of techniques are used for audio compression:
predictive encoding and perceptual encoding.
73
74. Predictive encoding
In predictive encoding, the differences between samples are
encoded instead of encoding all the sampled values.
This type of compression is normally used for speech. Several
standards have been defined such as GSM (13 kbps), G.729 (8 kbps),
and G.723.3 (6.4 or 5.3 kbps).
74
75. Perceptual encoding: MP3
The most common compression technique used to create CD-
quality audio is based on the perceptual encoding technique.
This type of audio needs at least 1.411 Mbps, which cannot be sent
over the Internet without compression. MP3 (MPEG audio layer 3)
uses this technique.
75
76. Advantages:
In medicine
Vision Systems are flexible, inexpensive, powerful tools that can
be used with ease.
In Space Exploration the robots play vital role which in turn use
the image processing techniques
Astronomical Observations.
Used in Remote Sensing, Geological Surveys for detecting
mineral resources etc.
Also used for character recognizing techniques, inspection for
abnormalities in industries.
76
77. Disadvantages:
A Person needs knowledge in many fields to develop an application /
or part of an application using image processing.
Calculations and computations are difficult and complicated so needs
an expert in the field related. Hence it’s unsuitable and unbeneficial to
ordinary programmers with mediocre knowledge
77
78. Applications
One of the most common uses of DIP techniques: improve quality,
remove noise etc
78
79. The Hubble Telescope
Launched in 1990 the Hubble
telescope can take images of
very distant objects
However, an incorrect mirror
made many of Hubble’s
images useless
Image processing
techniques were
used to fix this
79
80. Medicine
Take slice from MRI scan of canine heart, and find boundaries
between types of tissues
Original MRI Image of a Dog Heart Edge Detection Image
80
81. GIS
Geographic Information Systems
Digital image processing techniques are used extensively to
manipulate satellite imagery
Terrain classification
Meteorology
81
82. PCB Inspection
Printed Circuit Board (PCB) inspection
Machine inspection is used to determine that all components are
present and that all solder joints are acceptable
Both conventional imaging and x-ray imaging are used
82
83. HCI
Try to make human computer interfaces
more natural
Face recognition
Gesture recognition
83
86. CONCLUSION:
Image processing plays a vital role in many applications such
as
Fingerprint Identification System
Medicine
Geographic Information Systems
Printed Circuit Board (PCB) inspection
human computer interfaces
Inserting Artificial Objects into a Scene
Human Activity Recognition
soon…….
86
87. Future scope
The digital Image Processing is now finding wide range of uses in
different modern applications. Few of them (in which researcher are
trying developments)include:
Expert Systems
Parallel Processing
Neural Networks
87