Monday, August 2, 2010

Roberts Edge Detection

clear all; close all; clc;
I = imread('lena.gif');
%I = rgb2gray(I);
I = im2double(I);
h = [-1 0;0 1]; % 45 degree Mask
h1 = [0 -1;1 0]; % -45 degree Mask
f1 = imfilter(I,h,'replicate');
f2 = imfilter(I,h1,'replicate');
figure(1),imshow(I),title('Original Image');
figure(2);
subplot(1,2,1),imshow(f1),title('45 Degree Edge');
subplot(1,2,2),imshow(f2),title('-45 Degree Edge');

No comments: