im_resize.m

来自「人脸识别matlab程序 with a principal component」· M 代码 · 共 17 行

M
17
字号
function newimg = im_resize(img,nw,nh)%IM_RESIZE Resize an image using bicubic interpolation%%          NEWIMG = IM_RESIZE(IMG,NW,NH) Given input image IMG,%          returns a new image NEWIMG of size NWxNH.% Matthew Dailey 2000  if nargin ~= 3    error('usage: im_resize(image,new_wid,new_ht)');  end;    ht_scale = size(img,1) / nh;  wid_scale = size(img,2) / nw;    newimg = interp2(img,(1:nw)*wid_scale,(1:nh)'*ht_scale,'cubic');

⌨️ 快捷键说明

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