Edge detection in gradient images
Afficher commentaires plus anciens
Hello,
I am trying to detect a smooth boundary of an image (attached) to find contact angles of each component in contact (the whole image is not attached).
Firstly, I averaged 3*3 pixels to reduce noises and then, used 'imgradient()' to detect the boundary (subplot(2,2,3)).
To get a single boundary line, I used 'edge()' and tried different methods (Solbel, Canny, etc.), but I am getting two boundaries, which I didn't intend... Is there any way that I can get only the inner line (orange arrows are indicating) in the last picture (subplot(2,2,4))?
I googled and searched but I could not find clear solutions on this so far. I really appreciate your time and comments in advance.

Réponse acceptée
Plus de réponses (1)
Simon Chan
le 1 Sep 2021
Try Otsu's method
rawdata=imread('capture 1.png');
I = rgb2gray(rawdata);
level = graythresh(I);
BW = imbinarize(I,level);
J = edge(BW);
imshow(J);

1 commentaire
autumn
le 4 Sep 2021
Catégories
En savoir plus sur Object Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
