1、Digital Image Processing,Prof. Dr.Chen HuiSchool of ISE, Shandong University email: ,Lecture 10,Image Transforms,Fourier Transform Properties of 2D Fourier Transform Convolution and Correlation Other Transforms,Image transform no. 1,Transform theory has played a key role in image processing for many
2、years, we emphasize the Fourier transform because of its wide range of applications in image processing problems (for either speed or propertiesin the transformed spaces). Other transforms include Walsh, Hadamard,discrete cosine, Haar and Hotelling, etc,Convolution,The convolution of two continuous
3、functions is defined by,Image transform no.2,Important relationship: Fourier transform pair,where, F(u) and G(u) are Fourier transforms of f(x) and g(x), respectively.,Example of Convolution,Image transform no.3,Two functions f(z) and g(z) are shown in (a) and (b), the folding g(-z) of g(z) and the
4、thereafter translation g(x-z) are shown in (c) and (d).The integration of the product is the shaded region in (e) and (d), i.e. x/2 , 1-x/2, 0. Figure (g) shows the result.,2D Convolution,Analogous to 1D case, the 2D convolution is defined by,Image transform no.4,The convolution theorem in 2D ,then,
5、 is expressed by,Applications:a.) perform processing in frequency domain, using FFT transform to and back; b.) analysis in frequency domain, perform processing in spatial domain.,A stepped Example of 2D Convolution,Below is a portion of an image, with a fragment of it highlighted and the grayscale v
6、alues shown. To the right of that is our convolution kernel.,Image transform no.5,So to calculate our convolution value: f(x,y)*g(x,y) = (-1 222) + ( 0 170) + ( 1 149) + (-2 173) + ( 0 147) + ( 2 205) +(-1 149) + ( 0 198) + ( 1 221) = 63,Correlation,Image transform no. 6,The 2D correlation of two co
7、ntinuous functions is defined by,The correlation theorem in 2D is expressed by,Example of Correlation,Image transform no.7,Correlation is nearly identical to convolution bar one minor difference. The convolution of two functions is equivalent to the correlation between one of the functions and the o
8、ther function mirrored in the origin. For symmetrical functions, convolution and correlation are equivalent.,Application of Correlation,Image transform no.8,One of the principal applications of correlation is area or templatematching, where the problem is to find the closest match between an unknown
9、 image and a set of known images, that yields the correlation function with largest value.,Template matching,Image transform no.9,Problem: locate an object, described by a template t(x,y), in the image s(x,y)Example,Template matching(cont.),Image transform no.10,Search for the best match by minimizi
10、ng mean-squared error,Equivalently, maximize area correlation,Area correlation is equivalent to convolution of image s(x,y) with impulse response t(-x,-y),Other Image transforms,Image transform no.11,where, g(x,y,u,v) and h(x,y,u,v) are called the forward and inverse transformation kernels, respecti
11、vely.(such as Fourier transform),Separable transform: A class of 2D discrete transforms that can be expressed in terms of general relation,Separable property,Image transform no.12,The forward kernel is said to be separable if,In addition, the kernel is symmetric if g1 is functionally equal to g2, i.
12、e.,A transform with a separable kernel can be computed in two steps, each requiring a 1D transform. Firstly,Next,Walsh Transform,Image transform no.13,Walsh transform is a separable transform, when N=2n, its kernel is denoted by,The discrete Walsh transform of a function f(x) is obtained by,where bk
13、(z) is the kth bit in the binary representation of z, see, if n = 3 and z = 6(110 2), b0(z) = 0,b1(z) = 1,b2(z) = 1.,Table Values of the 1D Walsh transformation kernel for N=8.,Image transform no.14,The array formed by the Walsh transformation kernel is a symmetric matrix having orthogonal rows and
14、columns. So, lead to an identical inverse kernel except for a constant multiplication factor of 1/N; i.e.,The inverse Walsh transform is,2D Walsh transform,Image transform no.15,The 2D forward and inverse Walsh kernels are given by the relations,which are identical. Thus, the 2D forward and inverse
15、Walsh transforms are equal in form,FWT: fast Walsh transform, special case of FFT, where all exponential terms are equal to 1,Figure Walsh basis functions for N=4,Image transform no.16,The kernels depend only on the indexes u,v,x and ynot on the values of the image or transformso fixed basis functio
16、ns once image dimensions are fixed.,Total 44 blocks corresponding to u and v varying from 0 to 3, while each block consists of 44 elements corresponding to x and y varying from 0 to 3. White and black denote +1 and 1, respectively.,2D Hadamard transform,Image transform no. 17,Similarly, the 2D forwa
17、rd and inverse Hadamard kernels are separable, given by the relations,which are identical, modulo 2 summation. The 2D forward and inverse Hadamard transforms are,Figure Ordered Hadamard basis functions for N=4,Image transform no. 18,Similar to Walsh transform.,The Hardamard matrix of lowest order (N
18、=2) and higher order (2N) are given, respectively,2D Discrete Cosine transform,Image transform no.19,2D DCT forward kernel is represented by,where,The 2D discrete cosine transform(DCT) and its inverse are defined by,2D DCT kernels are separable and symmetric,Figure Discrete cosine transform basis fu
19、nctions for N=4,Image transform no.20,Total 44 blocks corresponding to u and v varying from 0 to 3, while each block consists of 44 elements corresponding to x and y varying from 0 to 3. Different gray shade represents different value.,Demo Discrete cosine transform,Image transform no.21,Image Lana
20、and its the log magnitude of its discrete cosine transform.In recent years the discrete cosine transform has become the method of choice for image data compression.,Review Questions,Explain convolution and its application Explain correlation and its application What is Walsh Transform? What is Hadamard Transform?,Recommended Reading,Gonzalez + Woods: Chapter 6,Image transform no.24,