![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1603401/image.png)
How to highlight lines on the coin.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I am having a coin image but I'm unable to highlight the lines or the curves.
![](/matlabcentral/answers/uploaded_files/1603136/coin_data.png)
0 commentaires
Réponse acceptée
Morgan
le 29 Jan 2024
Modifié(e) : Morgan
le 29 Jan 2024
% LOAD IMAGE
B = imread('coin_data.png');
% CONVERT TO GRAY IMAGE
B = im2double(B);
B = rgb2gray(B);
% REMOVE BLACK BOX IN IMAGE
B(B == 0) = 1;
% YOU CAN CLIP B TO GET BETTER EDGES
% HERE BY DOING:
% B = B > lb & B < ub;
% EDGE DETECT
BW = edge(B);
% VIEW IMAGE
imshow(B);
colorbar
% SHOW EDGES
hold on
contour(BW,'-r')
And this is the result I get
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1603401/image.png)
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!