Skip to content

Instantly share code, notes, and snippets.

@egurbuz
Created November 1, 2010 13:33
Show Gist options
  • Save egurbuz/658166 to your computer and use it in GitHub Desktop.
Save egurbuz/658166 to your computer and use it in GitHub Desktop.
I = imread('apartman.jpg');
fxI = imfilter(I, [-1 0 1]);
fyI = imfilter(I, [-1; 0; 1]);
topI = fxI + fyI;
H1 = fspecial('sobel');
H2 = [-1 0 0 0 1;-2 0 0 0 2;-1 0 0 0 1;-2 0 0 0 2;-1 0 0 0 1];
% H3 = fspecial('sobel',7);
H4 = fspecial('prewitt');
% H5 = fspecial('prewitt',5);
% H6 = fspecial('prewitt',7);
H1I = imfilter(I,H1);
H2I = imfilter(I,H2);
% H3I = imfilter(I,H3) ;
H4I = imfilter(I,H4);
% H5I = imfilter(I,H5);
% H6I = imfilter(I,H6);
% subplot(3,3,1), imshow(H1I)
% subplot(3,3,2), imshow(H2I)
% % subplot(3,3,3), imshow(H3I)
% subplot(3,3,4), imshow(H4I)
% % subplot(3,3,5), imshow(H5I)
% % subplot(3,3,6), imshow(H6I)
% subplot(3,3,7),
subplot(2,2,1), imshow(I);
subplot(2,2,2), imshow(fxI);
subplot(2,2,3), imshow(fyI);
subplot(2,2,4), imshow(topI);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment