Edge detection using morphology in Matlab

I'm trying to figure out how to detect edges using morphology in Matlab. I have this image:
and I'm trying to get the following results:
but I can't get anything close to that. The only thing I was able to do is this:
a = imread("mri.png");
SEedge = strel('square',5);
b = imdilate(a, SEedge);
c=b-a;
imshow(c),title("1");
And I got the following results:
But this is not good enough. I know about built-in functions in Matlab but I don't want to use them, I want to do it with erosion or dilation and my own structuring element. Could anyone help me figure this out or provide some useful resources?

1 Commento

what are built-in functions? Did you find any answer? If you found please share it here I need it. Thank you

Accedi per commentare.

Risposte (0)

Richiesto:

il 16 Giu 2020

Commentato:

il 18 Giu 2021

Community Treasure Hunt

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

Start Hunting!

Translated by