フィルターのクリア

Saving images to different files using imwrite()

2 ビュー (過去 30 日間)
Sam Terry
Sam Terry 2013 年 5 月 17 日
コメント済み: Mitali G 2016 年 3 月 1 日
i have a set of images which i have to write to an external file, for which i am using the imwrite().I am using the imwrite() inside the for loop. How do i write these images to different files ??

回答 (2 件)

Image Analyst
Image Analyst 2013 年 5 月 17 日
You can use a for loop if there is any way that your "set of images" variables can be specified by an index - for example they're all in individual cells of a cell array or are movie frames that you extract from the movie. See the FAQ for several code examples: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
If they're just a bunch of individually and arbitrarily named variables, like image1, grayImage, originalImage, and rgbImage, then you'd be best off just calling imwrite() once for each image variable.

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 17 日
for k=1:10
filename=sprintf('file%d',k)
imwrtie(filename,IM)
end
  3 件のコメント
Stephen23
Stephen23 2014 年 10 月 30 日
There was a spelling mistake in the original answer. Try changing the function to imwrite.
Mitali G
Mitali G 2016 年 3 月 1 日
It should be imwrite(IM,filename)

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

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by