16
Image Transformation

Input image Output image Transform equation All pixels Transform equation

Embed Size (px)

Citation preview

Page 1: Input image Output image Transform equation All pixels Transform equation

Image Transformation

Page 2: Input image Output image Transform equation All pixels Transform equation

Image Transformationsimage transform:- mapping the image data from the spatial domain to the frequency (spectral) domain , were all the pixels in the input domain contribute to each value in the output domain with one – to – one correspondence between the pixels as showing in bellow figure

Input image

Output image

Transform equation

All pixels

Transform equation

Page 3: Input image Output image Transform equation All pixels Transform equation

• we use transform equation to make the transformation from spatial to frequency domain this equation use the inner product for getting the output image . The general form of transformation equation is A : output image matrix I : input image matrix H : transform matrix : inverse of transform matrix• The size of matrices are n*n were n is either 4 or 8 so the input image , output image and transform matrices are 4*4 block or 8*8 block

TH I HA

Page 4: Input image Output image Transform equation All pixels Transform equation

2. Discrete Fourier transform (DFT)

The fourier transform is the most well known and the most widely used transform .This transform allow us for the decomposition of an image into 2-D form, assuming N x N image, the equation for the 2-D discrete Fourier transform is

J is the imaginary part of the complex number equal to while

1

So we can write the discrete Fourier transform equation as

…1

Real part imaginary part…2

A complex number is a number consisting of a real part and an imaginary part

Page 5: Input image Output image Transform equation All pixels Transform equation

From equation )1( for DFT we can construct matrix F (u , v) as follow equation

Where u takes values 0,1,2, … N-1 along each column and v takes the same values along each raw

We need the following rules in construct the DFT matrix

Formula 1

Formula 2

Formula 3

Page 6: Input image Output image Transform equation All pixels Transform equation

Derive the DFT transform matrix of 4 * 4 image. The DFT of 4*4 image can be obtain with

u= 0,1,2,3 along columns , and v= 0,1,2,3 along rows

33231303

32221202

31211101

30201000

By apply formula 1 we obtain

3*34

2πj3*2

4

2πj3*1

4

2πj3*0

4

2πj

2*34

2πj2*2

4

2πj2*1

4

2πj2*0

4

2πj

1*34

2πj1*2

4

2πj1*1

4

2πj1*0

4

2πj

0*34

2πj0*2

4

2πj0*1

4

2πj0*0

4

2πj

eeee

eeee

eeee

eeee

4

1F

Page 7: Input image Output image Transform equation All pixels Transform equation

From apply formula 2 we obtain

2

πjjπ2

3πj

jπjπ

2

3πjjπ2

πj

eee1

e1e1

eee1

1111

2

1F

by apply formula 3 we obtain

j2

πsin j

2

πcose 2

πj

1sinπ jcosπe jπ

j2

3πsin j

2

3πcose 2

3πj

angle cos Sin

90(pi/2) 0 1

180(pi) -1 0

270(3pi/2) 0 -1

Page 8: Input image Output image Transform equation All pixels Transform equation

So the discrete fourier transform (DFT) matrix of 4*4 image is

j1j1

1111

j1j1

1111

4

1F

From the DFT matrix we can see the transformation matrices are symmetric this mean

TFF So the general transform equation for DFT is

F I FA

Page 9: Input image Output image Transform equation All pixels Transform equation

EX1: Calculate the DFT transform for the image I(4,4)

0100

0100

0100

0100

I

0100

0100

0100

0100

j1j 1

11 11

j 1j1

1 1 1 1

4

1A

j1j 1

11 11

j 1j1

1 1 1 1

F I F

j1j 1

11 11

j 1j1

1 1 1 1

4

1A

1111

1111

1111

1111 F IF F IF

0000

0000

0000

4444

A4

1

0000

0000

0000

1111

Page 10: Input image Output image Transform equation All pixels Transform equation

Compute the real and imaginary parts of discrete Fourier transform of the image

I

Page 11: Input image Output image Transform equation All pixels Transform equation

Derive the DFT transform matrix of 8 * 8 image

by apply formula 2 we obtain

by apply formula 1 we obtain

F =

F=

Page 12: Input image Output image Transform equation All pixels Transform equation

4πj-

e 2πj-

e 43πj-

e jπ-

e 45πj-

e 23πj-

e 47πj-

e 1

2πj-

e jπ-

e 23πj-

e 1 2πj-

e jπ-

e 23πj-

e 1

43πj-

e 23πj-

e 4πj-

e jπ-

e 47πj-

e 2πj-

e 45πj-

e 1

jπ-e

jπ-e 1

jπ-e 1

jπ-e 1

45πj-

e 2πj-

e 47πj-

ejπ-

e

23πj-

e jπ-

e 2πj-

e1

47πj-

e 23πj-

e 45πj-

e jπ-

e

1111

4πj-

e 23πj-

e

43πj-

e 1

23πj-

e jπ-

e2πj-

e1

43πj-

e 2πj-

e4πj-

e1

1111

8

1F

1

by apply formula 3 we obtain

anglecos

Sin

45 (pi/4)

90(pi/2) 0 1

135(3 pi/4)

180(pi) -1 0

225(5pi/4)

270(3pi/2)

0 -1

315(7pi/4)

21

21

21

21

21

21

21

21

2

j

2

1jsin(45)cos(45)e 4

πj

2

j

2

1jsin(135)cos(135)e 4

3πj

2

j

2

1jsin(225)cos(225)e 4

5πj

2

j

2

1jsin(315)cos(315)e 4

7πj

Page 13: Input image Output image Transform equation All pixels Transform equation

2

j

2

1

2

j

2

1

2

j

2

1

2

j

2

1

2

j

2

1

2

j

2

11-

2

j

2

1

2

j

2

1

1- 1 2

j

2

1j-

2

j

2

1j-

2

j

2

1

2

j

2

1

2

j

2

1j

2

j

2

11- j-

2

j

2

1j

2

j

2

1

j- - 1- - j 1

j- 1- j 1 j- 1- j 1

-j j- -1

1- 1 1- 1 1- 1

1-

j1-1

j- 1-

1111

- 1

j1

- 1

1 1 1 1

8

1F

So the discrete fourier transform (DFT) matrix of 8*8 image is

Page 14: Input image Output image Transform equation All pixels Transform equation

Original image DFT

Page 15: Input image Output image Transform equation All pixels Transform equation

Inverse discrete Fourier transform (IDFT)

The inverse of discrete Fourier transform use to get the original image from transform image by the equation

Nuvj2π

eN

1v)(u,F

So the IDFT matrix if N=4 is

j 1j-1

11 11

j-1 j1

1111

1F

4

And the general inverse transform

F AFI

Page 16: Input image Output image Transform equation All pixels Transform equation

j 1j-1

11 11

j-1 j1

1111

1I4

Calculate the IDFT of example 1 when N=4

0000

0000

0000

1111

j 1j-1

11 11

j-1 j1

1111

F A F

j 1j-1

11 11

j-1 j1

1111

1I4

0000

0000

0000

0400

0400

0400

0400

0400

4

1I

0100

0100

0100

0100

I