フィルターのクリア

Saving the figure handle into a structure

5 ビュー (過去 30 日間)
Dilunath Hareendranath
Dilunath Hareendranath 2012 年 4 月 18 日
I want to save 300 figures produced by matlab into a structure. I have given an example of the existing code which is taking time to save the frame to the disc and then store into a structure. Please suggest any efficient way.
for i=1:300
f1=figure;
imshow(images(i));
line([10 20],[15 40], 'LineWidth',1,'Color', [1 0 0]);
saveas(f1, 'test.tif');
Images(i).Frames = imread('test.tif');
end
Thanks in advance

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 4 月 18 日
Fastest is if you draw the line into the matrix of the image, without using imshow() or saveas() or imread().
Second fastest (I guess) would be to use getframe() instead of saveas() and imread()
  1 件のコメント
Dilunath Hareendranath
Dilunath Hareendranath 2012 年 4 月 19 日
Thanks Walter. getframe() pops out the image onto the screen every time which is very inconvinient. I would like to go with the fastest option which seems to be less time taking. Please help me out.
In my case, I have a binary image and I would like to add a line which is red in color. How can I draw red line in matrix of a binary image? Please let me know.
Thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by