spandana image processing and compression techniques (7840228)
DESCRIPTION
this is my technical seminar....TRANSCRIPT
1
IMAGE PROCESSING AND COMPRESSION
TECHNIQUES
By T. Spandana094D1A0426
E.C.ESSIET,Vadiyampeta.
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).
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.
4
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.
Terminology
5
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 ”
Definition
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.
7
Digital image processing sequence
8
Key Stages in Digital Image Processing
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
9
Key Stages in Digital Image Processing:Image acquisition
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
10
Key Stages in Digital Image Processing:Image Enhancement
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
11
Key Stages in Digital Image Processing:Image Restoration
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
12
Key Stages in Digital Image Processing:Morphological Processing
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
13
Key Stages in Digital Image Processing:Segmentation
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
14
Key Stages in Digital Image Processing:Object Recognition
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
15
Key Stages in Digital Image Processing:Representation & Description
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
16
Key Stages in Digital Image Processing:Image Compression
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
17
Key Stages in Digital Image Processing:Colour Image Processing
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
Processing
Image Compression
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.
19
Goal of Image CompressionDigital 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.
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
Encoder 0101100111... Decoder
Original Image Decoded ImageBitstream
Figure: Flow of compression
21
Different Compression Techniques Mainly two types of data Compression techniques are
there.
Loss less Compression.
Lossy Compression.
22
Figure : Data compression methods
23
24
Lossless Compression
25
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.
27
Figure : Run-length encoding example
For instance,
28
29
Huffman coding
Huffman coding assigns shorter codes to symbols that occur more
frequently and longer codes to those that occur less frequently.
30
Figure Huffman coding
31
Figure Final tree and code
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.
32
Encoding
Figure Huffman encoding
Let us see how to encode text using the code for our five
characters. Figure shows the original and the encoded text.
33
Decoding
Figure : Huffman decoding
The recipient has a very easy job in decoding the data it receives.
Figure shows how decoding takes place.
34
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.
36
The LZW Algorithm (Compression) Flow ChartSTART
W= NULL
IS EOF?
K=NEXT INPUT
IS WKFOUND
?
W=WK
OUTPUT INDEX OF W
ADD WK TO DICTIONARY
STOP
W=K
YES
NO
YES
NO
37
The LZW Algorithm (Compression) ExampleInput string is
The Initial Dictionarycontains symbols like a, b, c, d with their index values as 1, 2, 3, 4 respectively.
Now the input string is read from left to right. Starting from a.
a b d c a d a c
a 1
b 2
c 3
d 4
38
The LZW Algorithm (Compression) Example
W = NullK = aWK = aIn the dictionary.
a b d c a d a c
a 1
b 2
c 3
d 4
K
39
The LZW Algorithm (Compression) Example
K = b.WK = ab is not in the
dictionary.Add WK to
dictionaryOutput code for
a. Set W = b
a b d c a d a c
K
1
ab 5a 1
b 2
c 3
d 4
40
The LZW Algorithm (Compression) Example
K = dWK = bdNot in the
dictionary.Add bd to
dictionary.Output code bSet W = d
a b d c a d a c
1
K
2
ab 5a 1
b 2
c 3
d 4
bd 6
41
The LZW Algorithm (Compression) Example
K = aWK = da not in the
dictionary.Add it to
dictionary.Output code dSet W = a
a b d a b d a c
1
K
2 4
ab 5a 1
b 2
c 3
d 4
bd 6
da 7
42
The LZW Algorithm (Compression) Example
K = bWK = ab It is in the
dictionary.
a b d a b d a c
1
K
2 4
ab 5a 1
b 2
c 3
d 4
bd 6
da 7
43
The LZW Algorithm (Compression) Example
K = dWK = abd Not in the
dictionary.Add W to the
dictionary.Output code for
W.Set W = d
a b d a b d a c
1
K
2 4 5
ab 5a 1
b 2
c 3
d 4
bd 6
da 7
abd 8
44
• K = a• WK = da In the dictionary.
a b d a b d a c
1
K
2 4 5
ab 5a 1
b 2
c 3
d 4
bd 6
da 7
abd 8
The LZW Algorithm (Compression) Example
45
The LZW Algorithm (Compression) Example• K = c• WK = dac Not in the
dictionary.• Add WK to the
dictionary.• Output code for
W.• Set W = c• No input left so
output code for W.
a b d a b d a c
1
K
2 4 5
ab 5a 1
b 2
c 3
d 4
bd 6
da 7
abd 8
7
dac 9
46
• The final output string is
1 2 4 5 7 3• Stop.
cadbadba
1
K
2 4 5
5ab
4d
3c
2b
1a
6bd
7da
8abd
7
9dac
3
The LZW Algorithm (Compression) Example
47
LZW Decompression Algorithm Flow Chart
START
Output K
IS EOF?
K=NEXT INPUT
ENTRY=DICTIONARY INDEX (K)
ADD W+ENTRY[0] TO DICTIONARY
STOP
W=ENTRY
K=INPUT
W=K
YES
NO
Output ENTRY
48
The LZW Algorithm (Decompression) Example
• K = 1• Out put K (i.e. a)• W = K
1
K
2 4 5
4d
3c
2b
1a
7 3
a
49
• K = 2• entry = b• Output entry• Add W + entry[0]
to dictionary• W = entry[0] (i.e.
b)
1
K
2 4 5
4d
3c
2b
1a
7 3
a b
5ab
The LZW Algorithm (Decompression) Example
50
• K = 4• entry = d• Output entry• Add W + entry[0]
to dictionary• W = entry[0] (i.e.
d)
1
K
2 4 5
4d
3c
2b
1a
7 3
a b
5ab
6bd
d
The LZW Algorithm (Decompression) Example
51
• K = 5• entry = ab• Output entry• Add W + entry[0]
to dictionary• W = entry[0] (i.e.
a)
1
K
2 4 5
4d
3c
2b
1a
7 3
a b
5ab
6bd
d a b
7da
The LZW Algorithm (Decompression) Example
52
• K = 7• entry = da• Output entry• Add W + entry[0]
to dictionary• W = entry[0] (i.e.
d)
1
K
2 4 5
4d
3c
2b
1a
7 3
a b
5ab
6bd
d a b
7da
d a
8abd
The LZW Algorithm (Decompression) Example
53
• K = 3• entry = c• Output entry• Add W + entry[0]
to dictionary• W = entry[0] (i.e.
c)
1
K
2 4 5
4d
3c
2b
1a
7 3
a b
5ab
6bd
d a b
7da
d a
8abd
c
9dac
The LZW Algorithm (Decompression) Example
54
55
Information loss is tolerable.
Many-to-1 mapping in compression eg. Quantization
LOSSY COMPRESSION METHODS
56
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.
LOSSY COMPRESSION METHODS
57
58
JPEG Compression
image, ~150KB
JPEG compressed, ~14KB
59
Image compression – JPEG encoding
JPEG encoding is done in four steps:
1. Image preparation
2. Discrete Cosine Transform (DCT)
3. Quantization
4. Entropy Encoding
60
Figure : JPEG grayscale example, 640 × 480 pixels
61
Block diagram for JPEG encoder.
The JPEG compression process
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.
63
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.
.
65
Reading the table
Zig zag recording
66
Block diagram for JPEG Decoder.
67
Examples of varying JPEG compression ratios
500KB image, minimum compression
40KB image, half compression
11KB image, max compression
68
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.
70
Spatial compressionThe 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.
71
Figure MPEG frames
72
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.
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).
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.
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.
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
78
ApplicationsOne of the most common uses of DIP techniques: improve quality,
remove noise etc
79
The Hubble TelescopeLaunched in 1990 the Hubble telescope can take images of very distant objectsHowever, an incorrect mirror made many of Hubble’s images uselessImage processing techniques were used to fix this
80
MedicineTake slice from MRI scan of canine heart, and find boundaries between types of tissues
Original MRI Image of a Dog Heart Edge Detection Image
81
GIS Geographic Information Systems
Digital image processing techniques are used extensively to manipulate satellite imagery
Terrain classificationMeteorology
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
83
HCITry to make human computer interfaces
more natural
Face recognition
Gesture recognition
84
Inserting Artificial Objects into a Scene
85
Human Activity Recognition
86
CONCLUSION: Image processing plays a vital role in many applications such
asFingerprint Identification SystemMedicineGeographic Information SystemsPrinted Circuit Board (PCB) inspectionhuman computer interfacesInserting Artificial Objects into a SceneHuman Activity Recognitionsoon…….
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
88
89