필터 지우기
필터 지우기

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