clear;load imagefile.mat;T=0.5;
figure,imagesc(X),axis off,title('ORIGINAL'),
H=[1 2 1;0 0 0;-1 -2 -1];
YH=conv2(X,H);YV=conv2(X,H');Y=sqrt(YH.*YH+YV.*YV);
Y(abs(Y)>T)=1;Y(abs(Y)<T)=0;
figure,imagesc(Y),colormap(gray),axis off,title('EDGE IMAGE')



