%Example10_4
f=imread('building.tif');
f=double(f);
imshow(f,[])
pause
f=mat2gray(f);
[g_sobel_default ts]=edge(f,'sobel');
ts
T=0.3*max(abs(g_sobel_default(:)));
g_sobel_default=(g_sobel_default>=T);
figure; imshow(g_sobel_default);
pause

g_sobel_best=edge(f,'sobel',0.05);
T=0.3*max(abs(g_sobel_best(:)));
g_sobel_best=(g_sobel_best>=T);
figure; imshow(g_sobel_best);
pause

[g_log_default ts]=edge(f,'log');
ts
T=0.3*max(abs(g_log_default(:)));
g_log_default=(g_log_default>=T);
figure; imshow(g_log_default);
pause

g_log_best=edge(f,'log',0.003,2.25);
T=0.3*max(abs(g_log_best(:)));
g_log_best=(g_log_best>=T);
figure; imshow(g_log_best);
pause

[g_canny_default ts]=edge(f,'canny');
ts
T=0.3*max(abs(g_canny_default(:)));
g_canny_default=(g_canny_default>=T);
figure; imshow(g_canny_default);
pause

g_canny_best=edge(f,'canny',[0.04 0.10],1.5);
T=0.3*max(abs(g_canny_best(:)));
g_canny_best=(g_canny_best>=T);
figure; imshow(g_canny_best);
pause


close all
