//Ex4_23 // Reduction of Moire Pattern Using Notch Filtering // Version : Scilab 5.4.1 // Operating System : Window-xp, Window-7 //Toolbox: Image Processing Design 8.3.1-1 //Toolbox: SIVP 0.5.3.1-2 //Reference book name : Digital Image Processing //book author: Rafael C. Gonzalez and Richard E. Woods clc; close; clear; xdel(winsid())//to close all currently open figure(s). function[H]=notchfilter(type1,M,N,D0,n)//notchfilter is used to filter an image . u=0:(M-1); v=0:(N-1); idx=find(u>M/2); u(idx)=u(idx)-M; idy=find(v>N/2); v(idy)=v(idy)-N; [U,V]=meshgrid(v,u); D=sqrt(U.^2+V.^2); x=[41 45 82 86 162 166 203 207]; y=[112 55 112 56 114 58 115 58]; select type1 case'ideal' //H=double(D<=D0); H=ones(M,N); for a=1:M for b=1:N for i=1:length(x) d=sqrt((a-x(i))*(a-x(i))+(b-y(i))*(b-y(i))); if (d