資源簡介
這是一個基于matlab版本的用模板匹配算法的人眼定位的程序,大家有需要的可以下載,借用和學習~

代碼片段和文件信息
function?nframe=eyematch(framethreshtemplate);
[face_askin_region]=face(frame);
im1?=?double(rgb2gray(face_a));
img=im1-mean(mean(im1));
template=template-mean(mean(template));
C=normxcorr2(templateimg);
Csub?=?C((size(template1)-1)/2+1:size(img1)-1(size(template2)-1)/2+1:size(img2)-1);
figure;
%?imshow(Csub?[])?pixval;
BW?=?Csub;
BW(find(BW BW(find(BW>thresh))=1;
%?figure?imshow(BW);
[Ln]?=?bwlabel(BW);
stats?=?regionprops(L?‘centroid‘);
%?Draw?an?asterisk?
figure(1);imshow(frame);
centroids?=?cat(1?stats.Centroid);
hold?on
plot(centroids(:1)?centroids(:2)?‘r*‘);
hold?off
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1290??2008-09-26?16:46??EyeFinder\eyematch2.m
?????文件???????1290??2008-09-26?16:46??EyeFinder\eyematch22.m
?????文件????????834??2008-09-26?16:47??EyeFinder\findeye1.m
?????文件????????644??2008-09-26?16:46??EyeFinder\eyematch.m
?????目錄??????????0??2008-10-13?08:32??EyeFinder
-----------?---------??----------?-----??----
?????????????????4276????????????????????6
- 上一篇:快衰落matlab代碼
- 下一篇:數字水印 攻擊 JPEG壓縮 matlab代碼
評論
共有 條評論