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

📄 scaleimage.m

📁 It is for Face Recognition
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function scaleImage()
%   z.li, 12-16-2003.
%   scale image with wavelet filters
% function dependency:
%   - n/a
% input:
%   face - facial images
% output:
%   icon, vec - facial area sub image 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [icon, vec]=scaleImage(face, w, h)
 dbg = 'n';
 if dbg == 'y'
    clear;
    truth = load('fbGndTruth.dat');
    [face]=showFeretFace(truth, 770);
    w = 20; h = 30;    
 end

 [fh fw] = size(face);
 if fh == 0 | fw == 0  
    icon=[]; vec=[];
    return;
 end

 icon = imresize(face, [h w], 'bilinear');
 vec = zeros(w*h, 1);

 for j=1:h
   vec((j-1)*w+1:j*w) = icon(j,1:w);
 end

 if dbg == 'y'
    for k=1:20
       [face]=showFeretFace(truth, 770+k);
       [icon, vec]=scaleImage(face, 20, 30);  
       if vec ~= []     
       figure(1);
       colormap('gray');subplot(4,5,k);axis off;imagesc(icon);
       figure(2);
       colormap('gray');subplot(4,5,k);axis off;imagesc(icon(1:15,:));
       figure(3);
       colormap('gray');subplot(4,5,k);axis off;imagesc(icon(16:30,:));
       end
     end
  end

⌨️ 快捷键说明

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