how to save image of the result imfindcircle
Mostrar comentarios más antiguos
i have used imfindcircle to find circle object in image. do you know how to save the image result of the circle object detected?
Respuestas (1)
Jayanti
el 21 de Mzo. de 2025
Movida: Walter Roberson
el 21 de Mzo. de 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:
Categorías
Más información sobre Image Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!