Azzera filtri
Azzera filtri

How to highlight lines on the coin.

2 visualizzazioni (ultimi 30 giorni)
Shubham
Shubham il 29 Gen 2024
Commentato: Shubham il 30 Gen 2024

Hi, I am having a coin image but I'm unable to highlight the lines or the curves.

Risposta accettata

Morgan
Morgan il 29 Gen 2024
Modificato: Morgan il 29 Gen 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

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by