⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resize.m

📁 PCA MATLAB程序.PCA MATLAB程序PCA MATLAB程序.
💻 M
字号:
function resize(imageheight, imagewide, imageformat)
% resize(imageheight, imagewide)
%
% Resizes all the images in the database to 
% imageheight x imagewide
% This function must be called from the image database
% directory (use cd <directory>).
% Before using this function, it is necessary tocreate 
% a sub-folder called 'axb', where a = imageheight and 
% b = imagewide.

lista=dir;
for c = 3:length(lista),
   lname = length(lista(c).name);
   if lista(c).name(lname-2:lname) == imageformat,
      [img,map] = imread(lista(c).name, imageformat);
      face = imresize(img, [imageheight imagewide], 'nearest');
      outfile = ['.\',int2str(imageheight),'x', int2str(imagewide),'\', lista(c).name];
      imwrite(uint8(face), outfile,imageformat);
   end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -