MATLAB Answers

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

2 ビュー (過去 30 日間)
Reuben Moncada
Reuben Moncada 2020 年 5 月 27 日
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
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 件のコメント

Sign in to comment.

回答 (0 件)

Translated by