For a binay image, how to plot a circle by using the centroid of the white pixel region for any given radius.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sumaiya khan
le 9 Juil 2019
Réponse apportée : Vinai Datta Thatiparthi
le 16 Juil 2019
0 commentaires
Réponse acceptée
Vinai Datta Thatiparthi
le 16 Juil 2019
Hi!
It appears to me that you want to calculate the centroid of the white spot in your image, and using this centroid value as the center, plot a circle of any radius.
The first part of the question, i.e. finding the centroid of the circle can be evaluate as follows –
im = imread('figure.jpeg'); % Your figure
imBin = imbinarize(im);
imBin = imfill(imBin, 'holes');
BW = regionprops(logical(imBin), 'centroid');
imshow(imBin);
hold on;
plot(BW.Centroid(1),BW.Centroid(2),'bx')
The value of the centroid of this image is stored in the variable ‘BW’.
The output is -
(I snipped this output to enhance readability)
Coming to the second part of your question, please refer to this link here to get the relevant steps to plotting a circle with a given center and radius.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Filtering and Enhancement dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!