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

📄 facepos.m

📁 eye detection sample in matlab. Eyetrackers can analyze a driver’s level of attentiveness while driv
💻 M
字号:
function [facepos,sample] = facepos(pic,binpic)%%%%%%%%%%%%%%%%%%%%%% INPUTS:%%%%%%%%%%%%%%%%%%%%%% pic - a grayscale image with values between 0 and 255% binpic - a binary matrix indicating the location of skin tones in the pic matrix%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OUTPUTS:%%%%%%%%%%%%%%%%%%%%%% facepos - a position vector [y x score] of all found faces% sample - the higest score sample (a 360 value vecotr, to view the sample%   use display360(sample) )    if (exist('binpic','var')==0)        binpic = zeros(size(pic));        binpic(1:2:size(pic,1),1:2:size(pic,2))=1;    end    facepos = [];    load FC;    test = [];    %scale = 0.5;    %facemap = zeros(20,20);        %facemap(index360)=1;    % picmap = filter2(facemap,binpic,'valid');    %[y,x] = find(picmap>360);    pic = uint8(pic);    pic1 = pic;    [m,n]=size(pic);    curr_line=1;    facepos=[];    facepos=double(facepos);    sample=[];    while (curr_line<(m-19))        tic        mini=curr_line;        maxi=min(curr_line+100,m);        pic = pic1(mini:maxi,1:n);        searchpos = binpic(mini:maxi,1:n);        [test,y,x] = fdprep(pic,uint8(searchpos));        test = double(test);        toc        c= clock;        [l,sc] = osuSVMclass(test,FC.n, FC.alpha, FC.sv,FC.b, FC.params);        fprintf('SVM elapsed time: %f', etime(clock,c));        ind= find(l==1);        addme=ones(size(y));        addme=addme.*curr_line;        y=double(y);        y=y+addme;        x = double(x);        facepos = [facepos;y(ind)', x(ind)',sc(ind)'];        sample = [sample, test(:,ind)];        curr_line=curr_line+80;    end

⌨️ 快捷键说明

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