?????? Digital Image Processing ???? Image Transformation - PowerPoint PPT Presentation

1 / 71
About This Presentation
Title:

?????? Digital Image Processing ???? Image Transformation

Description:

Digital Image Processing Image Transformation Dr.Ji Zhen Faculty of Information Engineering, SZU 2003.01 – PowerPoint PPT presentation

Number of Views:708
Avg rating:3.0/5.0
Slides: 72
Provided by: dspSzuEd
Category:

less

Transcript and Presenter's Notes

Title: ?????? Digital Image Processing ???? Image Transformation


1
?????? Digital Image Processing???? Image
Transformation
  • ????Dr.Ji Zhen
  • Faculty of Information Engineering, SZU
  • 2003.01

2
Basic Concepts
  • Image information can be transformed into
    different spaces by different transforms
  • T X Y
  • X is source space Y is object space
  • Reversible
  • Computation is simple in Transformed space
  • Transform algorithm is simple

3
Properties of Image Transforms
  • Simplify algorithm. For example
  • Convolution in spatial space Multiplication in
    frequency space
  • Some characteristics of image can be recognized
    easily in transformed space. For example
  • In Transformed space, image energy can be more
    concentrated, which can be used to compress the
    image.
  • Several transformation can be used to extract
    features of images. For example
  • K-L Transformation

4
Contents of Image Transformation
  • Basis Images
  • The Discrete Fourier Transform (DFT)
  • The Discrete Cosine Transform (DCT)
  • The Hadamard-Walsh Transform
  • The Haar Transform
  • The Karhumen-Loeve Transform
  • The Discrete Wavelet Transform (DWT)

5
Basis Images (??)
  • The inverse tow-dimensional transform can be
    viewed as reconstructing the image by summing a
    set of properly weighted basis images.
  • A basis image can be generated by inverse
    transforming a coefficient matrix containing only
    one nonzero element, which is set to unity.
  • Image transform can be written as
  • F(u,v)A f (x,y)
    BT
  • f (u,v)A F(x,y) BT
  • Where ,ATa1, a2, ,aN, BTb1, b2, ,bN,
  • ai, bi is N1 vector

6
Basis Images
  • Then

  • is a NN matrix

7
Basis Images
  • The basis images can be thought of as a set of
    basic components into which any image can be
    decomposed. They are also the building blocks
    from which any image can be reassembled.
  • The forward transform does the decomposition by
    determining the coefficients.
  • The inverse transform does the reconstitution by
    summing the basis images, weighted by those
    coefficients aij.

8
Basis Matrix, Basis Image
  • Basis matrix is the matrix aibjTN N
  • basis image is a matrix defined as

9
?????????
  • ???? NN ???,?????? N2N 2???????? N N ,?????
    NN ???????
  • ?????????????????????????????,????????????????????
    ?????????,????????
  • ??????????????????????????????????????????
  • ????????????????????????????????????????,??????,?
    ????????(??????????)??? K-L ??,????????????,??????
    ?????,?? K-L ???????????

10
Discrete Fourier Transform (DFT)
  • Image f(x,y),0xM-1,0yN-1
  • Transform kernel
  • Discrete Fourier Transform of f(x,y)is

11
Discrete Fourier Transform (DFT)
  • In generally, MN. Transform kernel can be
    represented as
  • Discrete Fourier Transform of f(x,y) can be
    represented as

12
Modulus?Phase?Power Spectrum
  • Let R(u,v)?I(u,v) be real part and imaginary part
    of F(u,v)
  • Modulus
  • Phase
  • Power Spectrum

13
Basis Matrix of The Fourier Transform
  • The Fourier TransformABATBTW where
  • Basis Matrix

14
Basis Images of The Fourier Transform(N8 Phase
Image)
15
Transform (Example)
  • imgimread('lena.bmp','bmp')
  • subplot(121)imshow(img)
  • title('original image ')
  • fimgfftshift(fft2(img))
  • subplot(122) imshow(abs(fimg)/10000)
  • title(' transformed image ')

16
Transform (Example)
  • Azeros(128)
  • A(333363,333363)255ones(64)
  • Aimread('lena.bmp','bmp')
  • m fft2(A)
  • m fftshift(m)
  • subplot(2,2,1)imshow(A)
  • title('Original Image')
  • subplot(2,2,3)
  • mm log(1abs(m))
  • mm mm/max(max(mm))255
  • imshow(uint8(mm))
  • title('Modulus')

17
Transform (Example)
  • (cont.)
  • subplot(2,2,4)
  • ma angle(m)
  • ma (ma-min(min(ma)))/(max(max(ma)) -
    min(min(ma)) )255
  • imshow(uint8(ma))
  • title('Phase')
  • i,j find(abs(m)max(max(abs(m))))
  • m(i,j) m(i,j)2
  • s ifft2(m)
  • subplot(2,2,2)
  • imshow(uint8(abs(s)))
  • title('Reconstruction Image')

18
Transform (Example)
19
Transform (Example)
20
Properties of 2-Dimensional Fourier Transform
  • 1.Separability
  • 2.Linearity
  • 3.Scality
  • 4.Shift Theorem
  • 5.Rotation
  • 6.Periodicity and conjugation
  • 7.Convolution
  • 8.Correlation
  • 9.Average

21
1.Separability
  • Transform kernel of 2-Dimensional DFT is
  • Separating the transformation into horizontal
    and vertical operations. At first,
    one-dimensional DFTs can be computed on the rows
    of the image. Next, performs columnwise
    one-dimensional DFTs on the resulting array.

22
1.Separability
  • The implementation steps for the two-dimensional
    DFT may be visualised as shown in the diagram
    below

Column Transforms
Row Transforms
f(x,y)
F(x,v)
F(u,v)
Multiply by N
23
1.Separability
24
2.Linearity
  • DFT is a linear operator
  • a f1(x,y)b f2(x,y)
    aF1(u,v)bF2(u,v)

25
3.Scality
26
3.Scality
27
4.Shift Theorem
28
4.Shift Theorem
  • In digital image processing, it is necessary to
    shift the origin of F(u,v) to the center of NN
    frequency domain.
  • Letu0v0N/2,then

29
4.Shift Theorem
30
4.Shifting Sample(Frequency Shifting)
31
5.Rotation
  • In polar coordinates, f (x,y) and F(u,v) can be
    represented by f(r, ?) and F(w,f) alternatively.
    Then
  • f (r, ? ?0)
    F(w,f ?0)

32
5.Rotation Sample
33
6.Periodicity and conjugation
  • Periodicity
  • F(u,v) F(uaN,vbN)
  • f (x,y) f (xaN,ybN)
  • Where a,b 0, 1, 2,
  • Conjugation
  • F(u,v) F(-u,-v)
  • F(u,v) F(-u,-v)

34
7.Convolution
  • 2-D convolution is defined as
  • Thenf(x,y)g(x,y)? F(u,v)G(u,v)
  • f(x,y)g(x,y)?F(u,v)G(u,v)

35
8.Correlation
  • 2-D correlation is defined as
  • Correlation Theorems

36
9.Average
  • Average of 2D image f (x,y) is defined as
  • Let uv0 , then

37
?????????????
  • ??????,????????????????????????????????,??????????
    ???????,???????????????????????,????????,????????
    ????
  • ??,k ?????,?? 1k40,?? k1
  • ????? F(0,0) ?????????,?????,???? F(0,0)
    ??,????,????????????

38
?????????????
  • ???????????,??????
  • ???????????,?????????????????,?????????????????,??
    ?????????????????
  • ????????????????????,????????????,????????????????
    ?????????????????????????????????,????????????

39
Discrete Cosine Transform(DCT)
  • Transform kernel of two-dimensional DCT is
  • where
  • Clearly,the kernel for the DCT is both separable
    and symmetric, and hence the DCT may be
    implemented as a series of one dimensional DCTs.

40
Discrete Cosine Transform(DCT)
  • Forward transform and Inverse transform
  • where u, v, x, y 0, 1, 2, , N-1

41
Discrete Cosine Transform(DCT)
  • To enable an application of the concept of the
    DCY and its relation to the DFT discussed
    earlier, consider the modified basis function
    gdctmod(x,u) defined below

As compared to the (unmodified) DFT basis
function
It can be seen that, neglecting the scaling
factors, the modified DCT is similar in form to
the real part of the DFT, but is not identical
due to the extra 2 on the denominator of the cos
argument. In fact we can see that the modified
DCT would be identical (again neglecting the
scaling factors) to the first half (i.e. from u0
to N-1) of the real part of a DFT of size 2N.
Hence it can be seen, as stated earlier, that DCT
analysis implies periodicity of period 2N points
(for a DCT analysis of an N-point signal).
42
Transform Matrix of DCT
where
43
Transform Matrix of DCT (N8)
44
Transform Matrix of DCT (N8)
  • N8
  • u zeros(N,N)
  • u(1,1N) 1.0/sqrt(2.0)
  • for i2N
  • for j1N
  • u(i,j) cos((2j-1)(i-1)pi/(2.0N))
  • end
  • end
  • u sqrt(2.0/N)u
  • imagesc(u)
  • colormap(gray)axis off

45
Basis Images of DCT(N8)
46
Example of DCT
  • a,map imread('lena.bmp','bmp')
  • subplot(1,2,1)
  • J dct2(a)
  • imshow(log(abs(J)),) colormap(jet)
  • J(abs(J)lt50) 0
  • K idct2(J)
  • subplot(1,2,2)
  • imshow(K,0 255)

47
Example of DCT
imgimread('lena.bmp','bmp') subplot(121) imshow
(img) title('original image') dcimgdct2(img) s
ubplot(122) imshow(100dcimg/dcimg(1,1)) title('D
CT coefficients')
48
Example of DCT
49
Example of DCT
  • N 8
  • I imread('e\cameraman.bmp')I double(I)/255
  • N 16
  • dctm dctmtx(N)
  • mask ones(N,N)
  • imageDCT blkproc(I,N N,'P1xP2',dctm,dctm.')
  • th max(max(imageDCT))/80
  • index find(imageDCTltth)
  • imageDCT(index) 0

50
Example of DCT
  • cont.
  • newImage blkproc(imageDCT,N N,'P1(x.P2)P3',
    dctm.', mask(1N,1N),dctm)
  • index find(newImagegt1)
  • newImage(index) 1
  • index find(newImagelt0)
  • newImage(index) 0
  • figure
  • imshow(newImage)

51
Example of DCT
52
Example of DCT
  • dctdemo

53
???????????
  • DCT?????????????????????,????DCT????
  • DCT?????,?????????,?????????
  • DCT?????
  • DCT?IDCT????????,???????????,?????????????????
  • DCT???????????,?????????????????

54
The Walsh-Hadamard Transform
  • Transform kernel of Two-Dimensional DWT
  • Transform kernel of Two-Dimensional DHT
  • Where bi(x) is the ith number of binary number x
  • N 2n

55
The Walsh-Hadamard Transform
  • The kernel matrix of DHT can be generated from
    the block matrix form
  • The sign change count is called sequency.
  • Reorder the rows to make sequency increase
    uniformly with row number. This yields a
    transform DWT
  • The sequency of DWT increases uniformly with row
    number, much as frequency increases with the
    Fourier kernel, which is somewhat easier to
    interpret.

56
The Walsh Kernel matrix(N8)
57
The basis images of DWT(N8)
58
The Hadamard kernel matrix(N8)
59
The basis images of DHT(N8)
60
???-???????
  • WHT??????1?-1???,????????????????????????????????
    ????????,????????????
  • WHT???????,??????,??????,??,????????
  • WHT????????
  • WHT???????,????????,????????????????,DSP?????,???
    ????????????,?????????????????????????????????,???
    ?????????????

61
The Haar Transform
  • The Haar transform is a symmetric, separable
    unitary transformation that uses Haar funcitons
    for its basis. It exists for N2n,where n is an
    integer.
  • Whereas the Fourier transform basis functions
    differ only in frequency, the Haar functions vary
    in both scale(width) and position. This gives the
    Haar transform a dual scale-position nature that
    is evident in its basis functions.

The Haar functions
62
The kernel matrix for the Haar transform(N4)
63
The kernel matrix for the Haar transform(N8)
64
The Haar transform basis images(N8)
65
The K-L Transform(Hotelling)
  • The K-L transform is variously called Hotelling
    transform, the eigenvector transform, or the
    method of principal componets.
  • Suppose image set f1(x,y), f2(x,y), ,
    fi(x,y), , fL(x,y) \
  • Where the correlation between fi(x,y) is commonly
    rather high.
  • fi(x,y) can be represented as N2-by-1 vector Xi
  • xij is the jth row of
    image fi(x,y) .
  • i1,2,,L

66
The K-L Transform
  • The covariance matrix of vector X is defined as,
  • Cf E(X-mf)(X-mf)T
  • The mean vector mf is mf EX
  • mf is N2-by-1 vector, Cf is N2N2 matrix.
  • In generally, mf and Cf can be represented
    approximately as,

67
The K-L Transform
  • Let ei and ?i be the eigenvectors and
    eigenvalues of Cf . Where i1,2,,N2, Suppose
  • The K-L transform is g A(X-mf)

68
The Properties of the K-L transform
  • A)The mean vector of g, mg0
  • mg EgEA(X-mg)A EX-A mg0
  • B) The covariance matrix of g,
  • CgA Cf AT
  • Cg E(Y-mg)(Y-mg)T EggT
  • E(AX-Amg)(AX-Amg)T
  • EA(X-mg)(X-mg)TAT
  • AE(X-mg)(X-mg)T AT
  • A Cf AT

69
The Properties of the K-L transform
  • C)Cg is a diagonal matrix having the eigenvalues
    of Cg along its diagonal. The elements of g are
    uncorrelated.
  • D) The K-L transform is invertible.The original
    image can be reconstructed by
  • A-1 AT
  • f A-1f mf

70
K-L???????
  • K-L???????????,?????????????(???)????????????,????
    ???????????
  • ????,K-L???????,??????????????????
  • ????????,??????,???????,????????????
  • ???????????????

71
K-L???????
  • ?????????????k?????????????Cf??A,??g????k??,??
  • ????????????,????????f,?????
  • ??????
Write a Comment
User Comments (0)
About PowerShow.com