フィルターのクリア

How can fix this problem

1 回表示 (過去 30 日間)
Biza Ferreira
Biza Ferreira 2012 年 10 月 7 日
I have a a problem with a image conversion, i am trying to convert a multiple jpg in a png. I'am write the fooling code and i am trying to save the result in another folder , but the fooling error it's show: Error using imwrite Too many output arguments. Error in cod (line 2).
if true
% code
for x = 1:length(imgDir)
%pwd (leitura da directoria actual)
pic = imgDir(x).name;
handles.images{x}=imread(fullfile('','/Users/armandoferr/Documents/MATLAB/images/',imgDir(x).name));
a = imgDir(x).name;
out = [imgDir(x).name(1:end-4) '.png'];
outFile = fullfile(outDir,out);
imwrite(a,outFile,'.png');
end

採用された回答

Image Analyst
Image Analyst 2012 年 10 月 7 日
You don't need the '.png' - it should be just 'png' but you don't even need that since it figures it out from the filename. Plus you need to write out the image array, not the base filename followed by the full filename.
imwrite(handles.images{x}, outFile);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by