?? position.m
字號:
function [ebIndex,eyeIndex,b,c,minW,maxW]=position(imgDst);
imgDstIntegral = sum(imgDst,2);
imgDstIntegral = imgDstIntegral/max(imgDstIntegral);
tmpVector=vectorsmooth(imgDstIntegral,3);
tmpVector=tmpVector/max(tmpVector);
[ebVal,ebIndex]=findmins(tmpVector,2);
eyeProfile=imgDst;
eyeProfile1 = mean(eyeProfile);
eyeProfile1=eyeProfile1/max(eyeProfile1);
eyeProfile1=vectorsmooth(eyeProfile1,3);
eyeProfile1=eyeProfile1/max(eyeProfile1);
[tVal,tIndex]=findmins(eyeProfile1,1);
eyeVal=tVal;
eyeIndex=tIndex;
%眼睛區域的SUSAN算子濾波
eyefile=imgDst(max(ebIndex)-8:max(ebIndex)+12,max(eyeIndex)-18:max(eyeIndex)+18);
Copy=zeros(size(eyefile));
[height,width]=size(eyefile);
c=0;
for i=4:(height-3)
for j=4:(width-3)
for m=-3:3
for n=-3:3
if ((abs(m)+abs(n))<=4)
if (abs(double(eyefile(i+m,j+n))-double(eyefile(i,j)))<=20)
c=c+exp(-double((double(eyefile(i+m,j+n))-double(eyefile(i,j)))/15)^6);
end
end
end
end
Copy(i,j)=c;
c=0;
end
end
g=0.65*max(max(Copy));
for i=1:(height-6)
for j=1:(width-6)
if Copy(i+3,j+3)<g
Copy1(i,j)=1;
else Copy1(i,j)=0;
end
end
end
[eyeH,eyeW]=find(Copy1==1);
minW=min(eyeW);
maxW=max(eyeW);
minP=find(eyeW==minW);
maxP=find(eyeW==maxW);
b=sort(eyeH(minP)+20-max(ebIndex));
c=sort(eyeH(maxP)+20-max(ebIndex));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -