フィルターのクリア

Saving an annotated drawrectangle image to the workspace

4 ビュー (過去 30 日間)
Aaron Devanathan
Aaron Devanathan 2021 年 7 月 26 日
編集済み: Yongjian Feng 2021 年 7 月 26 日
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

採用された回答

Yongjian Feng
Yongjian Feng 2021 年 7 月 26 日
編集済み: Yongjian Feng 2021 年 7 月 26 日

その他の回答 (0 件)

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by