function h=mycanny(x,thresh,n)
x=double(x);
f=smooth_gray(x);
[f t]=sobel_gray(f);
y=non_max(f,t);
g=thresh_gray(y,thresh);
h=edge_track(g,n);
h=tresh_gray2(h);
imshow(x,[]);
figure
imshow(f*5)
figure
imshow(g)
figure
imshow(h)
% image smoothing by Gaussian mean wight mask :5*5
% the image must be in gray level
function y=smooth_gray(x)
h=[2 4 5 4 2;4 9 12 9 4;5 12 15 12 5;4 9 12 9 4;2 4 5 4 2];
%Convolution
y=imfilter(x,h, 'replicate');
y=y/max(y(:));
end
.
.
.
.
.
.