Hey, everyone! My goal on this code is making non ideal filter with doing convolution of the notch filter and average filter. My teacher said this method. However,I do not know how to use 'C' part (convolution) to show as 'Output of Notch Filter'. (I know it will not be notch filter anymore after convolution but don't mind the name of the output). Please help me, this is for lab report and so important. I've tried to replace filt to C in 'imshow(log(1+abs( fftshift(I2).*filt)),[]);' part but I've got a error, can you fix this problem? Thanks for your attention.
Image is attached.
I = imread('woman-1_3.bmp');I2=fft2(I);imshow(log(1+abs(fftshift(I2))),[]);%Notch Filter (Ideal Filter)
filt=ones(200);filt(87:1:91,87:1:91)=0;filt(112:1:116,87:1:91)=0;filt(113:1:115,111:1:113)=0;filt(87:1:91,111:1:113)=0;imshow(filt);% Making non-ideal filter using convolution
filter_av = ones(3,3)/9;C = conv2(filter_av,filt,'same');imshow(log(1+abs( fftshift(I2).*filt)),[]);subplot(121),imshow(I),title('Noisy Image');subplot(122),imshow(log(1+abs(ifft2( fftshift(I2).*filt))),[]),title('Output of Notch Filter');
Best Answer