Saving an annotated drawrectangle image to the workspace
Afficher commentaires plus anciens
Good afternoon, all. I have an image on which I am annotating it with a series of rectangles. The image and coordinates are already loaded into the workspace. I've placed the code I am using below to create annotate the regions of interest. I am happy to revise based on if additional information is needed.
My question is: when I do this, it will show up in the image viewer, but is there a way to store this newly annotated figure in the MATLAB workspace? I'd like to do more image processing on it in later steps.
numberofrectangles=size(Annotations,1);
img_A=false(dims.(1),dims.(2));
figure('Position',[1 1 dims.(2) dims.(1)])
imshow(img_adjusted)
axis image;
hold on;
for k = 1 : numberofrectangles
w=(Annotations(k,3)-Annotations(k,1));
h=(Annotations(k,4)-Annotations(k,2));
rect=drawrectangle('Position',[Annotations(k,1),Annotations(k,2),w,h],'Color','g','LineWidth',1, 'InteractionsAllowed', 'none');
roi=createMask(rect);
for j = 1 : dims.(1)
for n = 1 : dims.(2)
if roi(j,n)==1
img_A(j,n)=1;
end
end
end
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!