Upload
others
View
19
Download
0
Embed Size (px)
Citation preview
EEM 463 Introduction to Image Processing
Week 10: Wavelets and Multiresolution Precessing
Fall 2013
Instructor: Hatice Çınar Akakın, Ph.D.
Anadolu University
24.12.2013
Motivation for Multiresolution Processing
• If the objects are small in size or low in contrats: examine them in high resolutions
• If they are large in size or high in contrast: a coarse view is required
• If they are present simultaneously: study at several resolutions• Analyze large structures or overall image context at lower-resolution levels
• Analyze individual object characteristics at higher-resolution levels
24.12.2013
24.12.2013
Image Pyramids
24.12.2013
Represents imagesat more than one
resolution
24.12.2013
Lower resolution is suitable for the analysisof large structures andapverall image context
High resolution is appropriate for the
analysis of individualobject characteristics!
Subband Coding• An image is decomposed into a set of bandlimited components called
subbands.
• Each subband is generated by bandpass filtering the input image
24.12.2013
24.12.2013
24.12.2013
24.12.2013
24.12.2013
24.12.2013
The Haar Transform
• H2 =1
2
1 11 − 1
• T = HFHT
Where F is an NxN image
matrix
24.12.2013
Haar basisfunctions
24.12.2013
24.12.2013
24.12.2013
24.12.2013
24.12.2013
24.12.2013
24.12.2013
EEM 463 Introduction to Image Processing
Week 10: Image Compression
Fall 2013
Instructor: Hatice Çınar Akakın, Ph.D.
Anadolu University
24.12.2013
Goal of Image Compression
• Everyday an enormous amount of information is stored, processedand transmitted
• Goal : Reducing the amount of data required to represent a digitalimage while keeping information as much as possible• Data storage• Data transmission
• It plays an important role in video conferencing, remote sensing, medical imaging…
24.12.2013
Fundamentals
• Data and information are not synonymous terms!
• Data is the means by which information is conveyed
Coding Redundancy: Most 2-D intensity arrays contain more bits than are needed to represent the intensities
Spatial and temporal redundancy: Pixels of most 2-D intensity arrays are correlated spatially and video sequences are temporally correlated
Irrelevant information: Most 2-D intensity arrays contain information that is ignored by the human visual system
24.12.2013
24.12.2013
• Where b an b’ denote the number of bits in two representations of the same information
24.12.2013
CR
11
Relative Data Redundancy
Compression Ratio
'b
bC
Coding Redundancy
84.42
1.81
1 1/ 4.42 0.774
C
R
24.12.2013
n
n
n
rhrp kkk
)()(
1
0
The average number of bits required to represent each pixel is
( ) ( ) 0.25(2) 0.47(1) 0.24(3) 0.03(3) 1.81L
avg k r k
k
L l r p r bits
84.42
1.81
1 1/ 4.42 0.774
C
R
Spatial and Temporal Redundancy
• All 256 intensities are equally probable (Uniform histogram)
• The pixels of each line are independent of another in the verticaldirection
• Since pixels along each line are identical, they are maximallycorrelated in the horizontal direction
24.12.2013
Irrelevant Information
• 256x256x8/8 = 65536:1
24.12.2013
Afterhistogram
equalization
• Is there a minimum amount of data that is sufficient to describe an imagewithout losing information?
• Answer: Information theory
A random event E with probability P(E) is said to contain
units of information! (Note: I(E)=0 when P(E)=1 )
(P(E)=1/2 ⇒I(E)=1 bit )
Measuring Image Information
A random event E with probability P(E) is said to contain
1 ( ) log -log ( )
( )
units of information.
I E P EP E
24.12.2013
• Possible events (source symbols) {a1, a2, …, aj}
• Associated probabilities {P(a1), . . . , P(aj) }
• The average information per source output
24.12.2013
j
jj aPaPH ))(log()(
H is the uncertainty or entropy of the source or the average amount of information (in m-ary units) obtained by observing a single source output
• If an image is considered to be the output pf an imaginary zero-memory intensity source, the intensity source’s entropy becomes
• is the normalized histogram
• For the Fig. 8.1(a),
24.12.2013
1
0
2 )(log)(~ L
k
krkr rprpH
)( kr rp
It is not possible to code theintensity values of the imaginary
source with fewer thanbits/pixel
H~
2 2 2 2
For the fig.8.1(a),
[0.25log 0.25 0.47 log 0.47 0.25log 0.25 0.03log 0.03]
1.6614 bits/pixel
H
H~
Fidelity Criteria
24.12.2013
1/221 1
0 0
Let ( , ) be an input image and ( , ) be an approximation
of ( , ). The images are of size .
The - - is
1 ( , ) ( , )
M N
rms
x y
f x y f x y
f x y M N
root mean square error
e f x y f x yMN
ms
21 1
0 0
ms 21 1
0 0
The - - - of the output image,
denoted SNR
( , )
SNR
( , ) ( , )
M N
x y
M N
x y
mean square signal to noise ratio
f x y
f x y f x y
24.12.2013
• The mean-square-signal to noise ratio of the output image is:
24.12.2013
RMSE = 5.17 RMSE = 15.67 RMSE = 14.17
24.12.2013
24.12.2013
24.12.2013
Some Basic Compression Methods• Huffman Coding : one of the most popular algorithms
• The resulting code is optimal
24.12.2013
1st step: source reduction
24.12.2013
The average length of this code is
0.4*1 0.3*2 0.1*3 0.1*4 0.06*5 0.04*5
= 2.2 bits/pixel
avgL
Arithmetic Coding• Unlike the variable
length codes, it generates nonblockcodes• There is no one to
one correspondencebetween sourcesymbols and codewords!
• Entire seuence of symbols is assigned a single arithmetic codeWord.
24.12.2013
How to code a1a2a3a3a4 ?
LZW Coding (formulated in 1984)
• LZW (Lempel-Ziv-Welch) coding, assigns fixed-length code words to variable length sequences of source symbols, but requires no a priori knowledge of the probability of the source symbols.
• LZW is used in:
• Tagged Image file format (TIFF)
• Graphic interchange format (GIF)
• Portable document format (PDF)
24.12.2013
• Example
24.12.2013
39 39 126 126
39 39 126 126
39 39 126 126
39 39 126 126
Run-Length Coding (RLE)
• Encodes repeating string of symbols (i.e., runs) using a few bytes: (symbol, count)
1 1 1 1 1 1 0 0 0 0 1 1 (1,6) (0, 4) (1,2)
a a a a b b b b c c c (a,4) (b, 4) (c, 3)
Can compress any type of data but cannot achieve high compression ratios compared to other compression methods.
Run-length encoding is supported by most bitmap file formats such as TIFF, BMP and PCX
Read the rest of Chapter 8 for details!
24.12.2013
Transform Coding
• Energy packing• 2D transforms pack most of the energy
into small number of coefficients located
at the upper left corner of the 2D array
2D Transforms
EnergyPacking
• Consider an image f(x,y) of size N x N
Forward transform
g(x,y,u,v) is the forward transformation kernel or basis functions
2D Transforms
.1,...,2,1,0,
),,,(),(),(1
0
1
0
Nvu
vuyxgyxfvuTN
x
N
y
2D Transforms
• Inverse transform
h(x,y,u,v) is the inverse transformation kernel or basis functions
.1,...,2,1,0,
),,,(),(),(1
0
1
0
Nyx
vuyxhvuTyxfN
u
N
v
Discrete Cosine Transform
• One of the most frequently used transformations for image compression is the DCT.
N
Nu
N
vy
N
uxvu
vuyxhvuyxg
2
1
)(
2
)12(cos
2
)12(cos)()(
),,,(),,,(
for u=0
for u=1, 2, …, N-1
Discrete Cosine Transform
Software Research
2D Transforms
Effect of Window Size