how to save image of the result imfindcircle
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i have used imfindcircle to find circle object in image. do you know how to save the image result of the circle object detected?
0 commentaires
Réponses (1)
Jayanti
le 21 Mar 2025
Déplacé(e) : Walter Roberson
le 21 Mar 2025
You can use “viscircles” function to overlay detected circles on the image and “imwrite” to write image data.
Please refer to the sample code below for better understanding:
img2 = imread('image.png');
hold on;
[centers, radii, metric] = imfindcircles(img2, [15 416]);
viscircles(centers, radii, 'EdgeColor', 'b');
frame = getframe(gca);
imwrite(frame.cdata, 'annotated_image.jpg');
hold off;
The “getframe” function captures the content of the current figure window. “imwrite” function then saves the captured image as a new file in the current folder.
You can also refer to the below documentation link on “imwrite” for your reference:
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!