23-03-2013, 11:14 PM
place images in current directory and run this prog
dirData = dir('*.jpg'); %# Get the selected file data
fileNames = {dirData.name}; %# Create a cell array of file names
for iFile = 1:numel(fileNames) %# Loop over the file names
newName = sprintf('%1d.jpg',iFile); %# Make the new name
movefile(fileNames{iFile},newName); %# Rename the file
end
after that run this prog in same directory
q=1;
p=1;
for i=1:10
oq=imread(strcat(num2str(q),'.jpg'));
odprz=imresize(oq,[150 150]);
imwrite(odprz,strcat(num2str(p),'.png'));
q=q+1;
p=p+1;
end
get .png files that u needed