Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory...

14
Digital Image Processing Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂呂呂 ) Visual Communications Laboratory Department of Communication Engineering National Central University ChungLi, Taiwan

description

3 N : 1-D Sequence Length : 0,1,2…N-1 (u=0 -> DC) f(x) : Spatial Domain Intensity C(u) : Frequency Domain intensity            )12( cos)()()( N x N ux xfuauC  u

Transcript of Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory...

Page 1: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

Digital Image Processing

Homework II Fast Discrete Cosine TransformJain-Yi Lu (呂健益 )

Visual Communications Laboratory Department of Communication Engineering

National Central University ChungLi, Taiwan

Page 2: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

2

Implement Fast Discrete Cosine Transform Implement Fast Discrete Cosine Inverse Transform

The Goal of This Homework

Page 3: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

3

Discrete Cosine Transform (DCT)

1

0 2)12(cos)()()(

N

u NuxuCuaxf

00

2

1

)(

uforufor

N

Nua

N : 1-D Sequence Length : 0,1,2…N-1 (u=0 -> DC)f(x) : Spatial Domain IntensityC(u) : Frequency Domain intensity

1

0 2)12(cos)()()(

N

x NuxxfuauC

u

Page 4: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

4

Discrete Cosine Transform

DCT

Spatial Domain

Frequency Domain

Spatial Domain

IDCT

Page 5: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

5

Discrete Cosine Transform (8 ×8 Blocks)

Page 6: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

W. H. Chen, C. H. Smith and S. C. Fralick, “A Fast Computational Algorithm for the Discrete Cosine Transform,” IEEE Trans. Communications, Vol. COM-25, No. 9, September 1977

Fast Discrete Cosine Transform(FDCT)

Page 7: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

7

Fast Discrete Cosine Transform 8×8 Block

0i1i2i3i4i5i6i7i

j k F

Stage1 Stage2 Stage3 Stage4

fInitial Signal

Result

Page 8: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

8

Fast Discrete Cosine Transform 8×8 Block Stage1

f i707

616

525

434

433

522

611

700

ffiffiffiffiffiffiffiffi

Stage1 Stage2 Stage3 Stage4

Page 9: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

9

Fast Discrete Cosine Transform 8×8 Block Stage2

Stage1 Stage2 Stage3 Stage4

i j77

566

565

44

303

212

211

300

)4

cos()(

)4

cos()(

ij

iij

iij

ijiijiijiijiij

Page 10: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

Fast Discrete Cosine Transform 8×8 Block Stage3

Stage1 Stage2 Stage3 Stage4

j k

677

676

545

544

233

322

101

100

)83sin()

8sin(

)83sin()

8sin(

)4

cos()(

)4

cos()(

jjkjjkjjkjjk

jjk

jjk

jjk

jjk

Page 11: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

Fast Discrete Cosine Transform 8×8 Block Stage4

Stage1 Stage2 Stage3 Stage4

k F

2/))167sin()

167cos((

2/

2/))165sin()

165cos((

2/

2/))163sin()

163cos((

2/

2/))16

cos()16

sin((

2/

477

36

655

14

563

22

741

00

kkF

kF

kkF

kF

kkF

kF

kkF

kF

Page 12: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

12

Result

Page 13: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

13

We will provide grayscale Lena 512×512 pixels image.

Your program (Image size, bugs, some questions) (2 points)

The accuracy (2 points)

Computation perplexity (Bonus) Other comment (Bonus)

Note and Report

Page 14: Homework II Fast Discrete Cosine Transform Jain-Yi Lu ( 呂健益 ) Visual Communications Laboratory Department of Communication Engineering National Central.

14

Appendix-A