
ftest = [zeros(1,7),ones(1,8)]

cannysimple(ftest)

pause;

randoptcanny(ftest,10000)

plot(ans)

pause;

help fspecial

pause;

h = fspecial('gaussian',9,1.5)
h1 = fspecial('gaussian',11,2)
h2 = fspecial('gaussian',15,3)

mesh(h);

pause;

im = double(imread('../images/calibleft.0.tif'))/255;

imshow(im);

pause;

subim = imcrop(im);

mesh(subim)

pause

imshow([conv2(subim,h,'same'),conv2(subim,h1,'same'),conv2(subim,h2,'same')]);

pause

mesh([subim,conv2(subim,h2,'same')]);

gx = conv2(h,[0.5,0,-0.5],'same');

gy = gx';

dx = conv2(im,gx);
dy = conv2(im,gy);

imshow(mat2gray([abs(dx),abs(dy)]));

pause;

imshow(mat2gray(sqrt(dx.^2 + dy.^2)));

pause;

disp('threshold .05');
imshow(mat2gray(sqrt(dx.^2 + dy.^2))> .05);

pause;
disp('threshold .1');
imshow(mat2gray(sqrt(dx.^2 + dy.^2))> .1);

pause;
disp('threshold .2');
imshow(mat2gray(sqrt(dx.^2 + dy.^2))> .2);

pause

disp('canny');
bw = edge(im,'canny',[.05,.2],1.5);

imshow(bw);

