第四章 图像变换及应用(2017C)
Example: given an image f and an 9×9 spatial filter imfilter(f, h,’conv’ ,’circular’,’ same’) is shown below. we would like to perform the same filtering but in the frequency domain. Build frequency domain filters from spatial domain filters 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Step 1: zero-padding the spatial domain filter h to make the size the same as the size of the image f (300×300). How? 300 9 9 300 300 9 9 300 Option 1 the filter is located at the center of the expanded filter (h_exp1) Option 2 the filter is located at the top-left corner (h_exp2) Which one is correct ? Build frequency domain filters from spatial domain filters Step 2: obtain the frequency domain representation of the expanded spatial domain filter by taking the DFT h_exp1 h_exp2 Results using the following MATLAB commands are shown below H=fft2(h_exp);imshow(log(1+abs(H)), [ ]); imshow(log(1+abs(fftshift(H))), [ ]); imshow(angle(H), [ ]); Notice the spectra are the same for h_exp1 and h_exp2 (from shift property). The difference lies in the phase spectrum Build frequency domain filters from spatial domain filters Step 3: multiply the DFT of the image (not centered) by the DFT of expanded h. F H F?H Centered F Centered F?H Notice that, overall speaking, the high frequency parts of F are attenuated. Build frequency domain filters from spatial domain filters Step 4: take the real part of the IDFT of the results of step 3. From h_exp1 From h_exp2 From spatial domain filtering Build frequency domain filters from spatial domain filters Spatial filtering in terms of correlation and convolution Correlation Convolution Convolution theorem The origin of spatial filter is at the center for spatial filtering while the origin of the filter in convolution theory is at the top, left corner. Spatial filtering vs. Convolution theory wavedec2()函数 功能:2-D信号的多层小波分解 格式: [C,S]=wavedec2