You are on page 1of 1

%% Edge Detection % [g, t] = edge(f, 'method', parameters); %% Sobel Edge Detection % automatic threshold [v, t] = edge(f, 'sobel' , 'vertical');

imshow(v);title(sprintf('Sobel Edge Dectection [auto vertical t = %0.2f]',t)); pause % manual threshold t = 0.15; v = edge(f, 'sobel', t, 'vertical'); imshow(v);title(sprintf('Sobel Edge Dectection [manual vertical t = %0.2f]',t)); pause% % Sobel edge +45 degree %w = [-2 -1 0; -1 0 1; 0 1 2]; %v = imfilter(f, w, 'replicate'); %t = 0.3*max(abs(v(:))); %v = v >= t; %imshow(v);title(sprintf('Sobel Edge Dectection [manual +45 t = %0.2f]',t)); %pause % Sobel edge -45 degree %w = [0 1 2; -1 0 1; -2 -1 0]; %v = imfilter(f, w, 'replicate'); %t = 0.3*max(abs(v(:))); %v = v >= t; %imshow(v);title(sprintf('Sobel Edge Dectection [manual -45 t = %0.2f]',t)); %pause

You might also like