How to detect Edges of an Image using Matlab

The below is the code to detect edges of an image using different filters


B=rgb2gray(A);
% sobel Edge Detection
A_Sobel=edge(B,'sobel');

%prewitt Edge detection
A_prewitt=edge(B,'prewitt');

% canny Edge Detection
A_Canny=edge(B,'canny');

% Plotting the output Images
subplot (2,2,1)
 imshow(A), title ('Origional Image');
subplot(2,2,2)
imshow(A_Sobel), title ('sobel');
subplot(2,2,3)
 imshow(A_prewitt), title ('prewitt');
subplot (2,2,4)
imshow(A_Canny), title ('canny');


Comments

Popular Posts