开发者

resize images and keep them with new size in new folder in matlab

I write the following code in matlab. from this code I take sequence of images as input from a folder and resize these images. Now I need to store the开发者_如何学运维m with new size on output folder. any one help me to update this code.

fileFolder = fullfile('D:','Texture DataBases','images3000');
dirOutput = dir(fullfile(fileFolder,'image*.jpg'));
fileNames = {dirOutput.name};

for k=1:length(fileNames)
                   H=fileNames{k};
              S=imread(H); 
              I-resize(S, [300 300]);
imshow(I);
end

......
......


I think you meant:

I=imresize(S, [300 300]);

You can save images with imwrite:

imwrite(I,fullfile('D:','New_folder',H);

Additionally, you can use mkdir to create the new output folder (New_folder in the example above).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜