Write a Matlab program for Edge Detection- use of Sobel, Prewitt and Roberts Operators


Code:

clear;
clc;
a = imread('d:/matimage/baby.jpg'); % Read image from graphics file
a=rgb2gray(a); % Convert RGB color image or color map to grayscale
b=edge(a,'roberts'); % Find edges in grayscale image using Robert operator
c=edge(a,'sobel'); % Find edges in grayscale image using sobel operator
d=edge(a,'prewitt'); % Find edges in grayscale image using prewitt operator
subplot(2,2,1),imshow(a),title('Original Image');
subplot(2,2,2),imshow(b),title('Roberts');
subplot(2,2,3),imshow(c),title('Sobel');
subplot(2,2,4),imshow(d),title('Prewitt');

Output:



1 comment:

  1. nice but laplacian oparetor code needed towmorow plzzzzzz

    ReplyDelete

Powered by Blogger.