How to detect the edges in the picture using Robert, Sobel and Prewitt's operator?

49 views (last 30 days)
Hi, I'm pretty new to Matlab and I need help in the task. It is necessary to apply Robert's, Sobel's and Prewitt's edge detectors to a picture, then interruptions in the contour edges fill and connect the contour.
Any help would be greatly appreciated.
Thank you

Accepted Answer

Mark Sherstan
Mark Sherstan on 15 Dec 2018
Refer to some of the tutorials found here and here then come back with specific quesitons you might have.
  4 Comments
Miralem Ikanovic
Miralem Ikanovic on 15 Dec 2018
i=imread('slika64_1.jpg');
subplot(2,2,1);
I=rgb2gray(i);
imshow(I);
title('Orginal');
BW1=edge(I,'prewitt');
subplot(2,2,2);
imshow(BW1);
title('Prewitt');
se90 = strel('line', 6, 90);
se0 = strel('line', 6, 0);
BW2dil = imdilate(BW1, [se90 se0]);
subplot(2,2,3);
imshow(BW2dil);
title('Dilation');
BW3fill = imfill(BW2dil, 'holes');
subplot(2,2,4);
imshow(BW3fill);
title('Impact zone');
Done !

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!