views:

27

answers:

1

Hi

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 them 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

......
......
+3  A: 

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).

Jacob