How to save circular ROI drawn from images.roi.Circle to a jpeg or png file for thousands of circles?

1 回表示 (過去 30 日間)
Given a set of coordinates, I've drawn a circular ROI onto an image that I'd like to extract:
% resized_img --> Image from which I am drawing my ROI
% X --> X-coordinate of the center of the circle
% Y --> Y-coordinate of the center of the circle
% r --> cirle radius
figure
imagesc(resized_img); hold on
scatter(X, Y, 'k', 'filled') % Sanity check to ensure I am getting the correct circle centroid
h = images.roi.Circle(gca,'Center',[X Y],'Radius',r);
Is there a way to extract the ROI drawn and save it as a jpeg or something similar, without a background?
I also have to do this over thousands of coordinates - my initial plan was to loop over each coordinate pair and extract and save during each iteration. Is there a more efficient way of doing this?

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by