50
EEM 463 Introduction to Image Processing Week 10: Wavelets and Multiresolution Precessing Fall 2013 Instructor: Hatice Çınar Akakın, Ph.D. [email protected] Anadolu University 24.12.2013

EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

  • Upload
    others

  • View
    19

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

EEM 463 Introduction to Image Processing

Week 10: Wavelets and Multiresolution Precessing

Fall 2013

Instructor: Hatice Çınar Akakın, Ph.D.

[email protected]

Anadolu University

24.12.2013

Page 2: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 3: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 4: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

Image Pyramids

24.12.2013

Represents imagesat more than one

resolution

Page 5: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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!

Page 6: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 7: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 8: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 9: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 10: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 11: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 12: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

The Haar Transform

• H2 =1

2

1 11 − 1

• T = HFHT

Where F is an NxN image

matrix

24.12.2013

Haar basisfunctions

Page 13: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 14: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 15: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 16: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 17: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 18: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 19: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 20: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

EEM 463 Introduction to Image Processing

Week 10: Image Compression

Fall 2013

Instructor: Hatice Çınar Akakın, Ph.D.

[email protected]

Anadolu University

24.12.2013

Page 21: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 22: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 23: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 24: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

• 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

Page 25: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 26: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 27: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

Irrelevant Information

• 256x256x8/8 = 65536:1

24.12.2013

Afterhistogram

equalization

Page 28: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

• 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

Page 29: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

• 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

Page 30: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

• 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~

Page 31: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 32: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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:

Page 33: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

RMSE = 5.17 RMSE = 15.67 RMSE = 14.17

Page 34: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 35: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 36: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

24.12.2013

Page 37: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

Some Basic Compression Methods• Huffman Coding : one of the most popular algorithms

• The resulting code is optimal

24.12.2013

1st step: source reduction

Page 38: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 39: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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 ?

Page 40: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 41: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

• Example

24.12.2013

39 39 126 126

39 39 126 126

39 39 126 126

39 39 126 126

Page 42: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 43: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

Transform Coding

Page 44: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

• 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

Page 45: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

• 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

Page 46: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 47: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

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

Page 48: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

Discrete Cosine Transform

Page 49: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

Software Research

2D Transforms

Page 50: EEM 463 Introduction to Image Processing Week 10: Wavelets ...eem.eskisehir.edu.tr/haticecinarakakin/EEM 463/icerik/EEM463_10w… · EEM 463 Introduction to Image Processing Week

Effect of Window Size