フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

hi. i had lot of binary images(suppose 500) .I want them to save them in another folder ,i want to rename them and want there name to start with 1 and so on to 500 (1st image name)1 ,(Second image name) 2, so on to (Last image name) 500 .

1 回表示 (過去 30 日間)
M Shujah Islam Sameem
M Shujah Islam Sameem 2015 年 6 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi.I had lot of binary images(suppose 500) .I want them to save them in another folder ,i want to rename them and want there name to start with 1 and so on to 500 (1st image name)1 ,(Second image name) 2, so on to (Last image name) 500 .
i am trying this ...
b=1;
filename = ['Full path of new folder\','b','.tif'];
imwrite(I,filename);
b=b+1;
  2 件のコメント
M Shujah Islam Sameem
M Shujah Islam Sameem 2015 年 6 月 29 日
編集済み: M Shujah Islam Sameem 2015 年 6 月 29 日
i found answer by myself... srcFiles = dir('full path\*.tif');% the folder in which your images exists for i = 1 : length(srcFiles) filename = strcat('full path\',srcFiles(i).name); I = imread(filename); filename1 = ['Full path of test\New folder\',num2str(b),'.tif']; imwrite(I,filename1); b=b+1; end

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 6 月 29 日
pathdir = 'Full path of new folder';
for b = 1 : 500
fullname = fullfile(pathdir, sprintf('%d.tiff', b));
imwrite(I, fullname);
end
Note that if the files already exist in the directory then you can use a routine such as in the File Exchange

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by