% demonstrate edge detection

% get image from MATLAB image
load('gatlin');

% show original image
figure(1);
imshow(X,[]);
drawnow;


% construct convolution masks
g = [1 -1]; 
h = [1 -1]; 

% filter
Wg = circconv2(X,g);   %horizontal
Wh = circconv2(X,h');  %vertical
Wgh = circconv2(X,h'*g);
  
% show transformed images
figure(2);
imshow(Wg,[]);
drawnow;


figure(3)
imshow(Wh,[]);
drawnow;


figure(4)
imshow(Wgh,[]);
drawnow;


figure(5)
imshow(abs(Wg)+abs(Wh)+abs(Wgh),[]);
drawnow;


