Exercise 3e picture “Fig0401.tif” to do the following questions:①Read the picture, and write down the Fourier transform program of it. >> f=imread('Fig0401.tif');>> g=fft2(f);Warning: FFTN on values of class UINT8 is obsolete.Use FFTN(DOUBLE(X)) or FFTN(SINGLE(X)) instead.> In uint8.fftn at 10In fft2 at 19>> s=abs(g);>> imshow(s,[])②Use the function fftshift to center the spectrum.>> fc=fftshift(g);>> imshow(abs(fc),[])③Use logarithmic transformation to enhance the centered spectrum. >> s2=log(1+abs(fc));>> imshow(s2,[])④Visualize the dealing results of step②and step③.结果如上2.Generate a filter function H①Use function fspecial to generate a ‘laplacian’ spatial domain filter h>> h=fspecial('laplacian',0.5)h=0.3333 0.3333 0.33330.3333 -2.6667 0.33330.3333 0.3333 0.3333②Use function freqz2 to convert the spatial domain filter h to frequency domain filter H.>>h= freqz2(h);③Use function freqz2 to show a 3-D perspective plot of H and give the result. >> freqz2(h)e function dftfilt to do the DFT Filtering with picture “lena.bmp”①Obtain the padding parameters of the picture use function paddedsize.> f=imread('lena.bmp');>> imshow(f)>> [m ,n]=size(f)m =256n =256>> PQ=paddedsize(size(f))PQ =512 512②Use function fspecial to generate a ‘unsharp’ spatial domain filter.>> h=fspecial('unsharp',0.2)h =-0.1667 -0.6667 -0.1667-0.6667 4.3333 -0.6667-0.1667 -0.6667 -0.1667③Use function freqz2 to convert the spatial domain filter h to frequency domain filter H of >> freqz2(h)④Get the uncentered form of frequency domain filter H.>>H=freqz2(h,PQ(1),PQ(2));>>W=ifftshift(H);>> imshow(abs(H),[])>> imshow(abs(w),[])⑤Use function dftfilt to do the DFT Filtering and give the final result. >> s=imfilter(double(f),h);>> d=dftfilt(f,W);Warning: FFTN on values of class UINT8 is obsolete.Use FFTN(DOUBLE(X)) or FFTN(SINGLE(X)) instead. > In uint8.fftn at 10In fft2 at 21In dftfilt at 17>> imshow(s,[])>> imshow(d,[])4.Try to compute the distance squared from every point in a rectangle of size 7×7 tothe origin of the rectangle with command dftuv and give the result.>> [u,v]=dftuv(7,7);>> d=u.^2+v.^2d =0 1 4 9 9 4 11 2 5 10 10 5 24 5 8 13 13 8 59 10 13 18 18 13 109 10 13 18 18 13 104 5 8 13 13 8 51 2 5 10 10 5 25.Assuming M=200,N=200,D0=20, use function lpfilter to do the following questions:①Generate a ‘ideal’ lowpass filter.②Generate a ‘btw’ lowpass filter.③Show the centered result of the filters which were generated in ①and ②, and then tell the differences between them.>> h=lpfilter('ideal',200,200,20);>> p=fftshift(h);>> iimshow(p)>> f=lpfilter('btw',200,200,20);>> k=fftshift(f);>> imshow(k)6.3-D Visualize the filter H generated in question 5②.①Use function mesh to draw the centered wireframe plot. >> mesh(k)②Use function colormap to get a gray wireframe plot and a blue wireframe plot separately. >> colormap(gray)>>colormap([0 0 1])③Get ride of the axis and grid of gray wireframe plot.>> grid off>> axis off7.Assuming M=200,N=200,D0=20, use function hpfilter to do the following questions:①Generate a ‘ideal’ highpass filter.②Generate a ‘gaussian’ highpass filter.③Show the centered result of the filters which were generated in ①and ②, and then tell the differences between them.>> h=hpfilter('ideal',200,200,20);>> d=fftshift(h);>> imshow(d)>> t=hpfilter('gaussian',200,200,20); >> g=fftshift(t);>> imshow(g)8. 3-D Visualize the filter H generated in question 7②.①Use function surf to draw the centered surface plot. >> t=hpfilter('gaussian',200,200,20);>> g=fftshift(t);>> surf(g)②Smooth and eliminate the mesh line of the surface plot. >> shading interp9. Use ideal lowpass filter to do DFT with picture “lena.bmp” (D0=50). >> f=imread('lena.bmp');>> PQ=paddedsize(size(f));>> y=lpfilter('ideal',PQ(1),PQ(2),50);>> l=dftfilt(f,y);Warning: FFTN on values of class UINT8 is obsolete.Use FFTN(DOUBLE(X)) or FFTN(SINGLE(X)) instead.> In uint8.fftn at 10In fft2 at 21In dftfilt at 17>> imshow(l,[])10. Use ideal highpass filter to do DFT with the same picture “lena.bmp” (D0=50).>> p=hpfilter('gaussian',PQ(1),PQ(2),50);>> r=dftfilt(f,p);Warning: FFTN on values of class UINT8 is obsolete.Use FFTN(DOUBLE(X)) or FFTN(SINGLE(X)) instead.> In uint8.fftn at 10In fft2 at 21In dftfilt at 17>> imshow(r,[])。