91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

基于PCA的人臉識別定位,包含測試數(shù)據(jù),真實可用

資源截圖

代碼片段和文件信息

clc;
clear;

data?=?load(‘/Users/apple/Downloads/test.mat‘);
faces?=?data.FACES;
scale?=?208/(max(max(faces))?-?min(min(faces)));?%?normalize?the?image
faces?=?scale*(faces?-?min(min(faces)));

test?=?data.test;

figure;
imshow(test[]);

[rowscols]?=?size(test);

faces?=?faces‘;
[coeffscorelatenttsquare]?=?princomp(faces);

k?=?1;
vector?=?zeros(121*1211600);
for?i?=?21?:?rows?-?19
????for?j?=?21?:?cols?-?19
????????face_temp?=?test(i-20:i+19j-20:j+19);
????????vector(k:)?=?reshape(face_temp11600);
????????k?=?k?+?1;
????end
end

F?=?mean(faces);

P?=?coeff(:1:9);

x_tilde?=?zeros(146411600);

for?i?=?1?:?1600
????for?j?=?1?:?14641
????????x_tilde(ji)?=?vector(ji)?-?F(1i);
????end
end

score?=?x_tilde?*?P;

distance?=?ones(146411);

lambda?=?(1/6)?*?(sum(latent(1:61)));
rho?=?(1/3)?*?(sum(latent(7:91)));

for?i?=?1?:?14641
???distance(i1)?=?sum(score(i1:6).^2)/lambda?...
??+?(sum(x_tilde(i:).^2)?-?sum(score(i1:6).^2))/rho;
end


b?=?reshape(distance121121);
figure;
imshow(b[]);
title(‘distance‘?‘FontSize‘?15);

Pos?=?zeros(39);


%?show?the?location?of?the?faces?identified
figure;
for?i?=?1:9
????[rowcolval]?=?findPos(b);
????Pos(1i)?=?row;
????Pos(2i)?=?col;
????Pos(3i)?=?val;
????b?=?cleanNear(browcol);
????subplot(33i);
????imshow(b[]);
????hold?on;
????plot(Pos(2i)Pos(1i)‘rs‘‘MarkerSize‘2);
end

figure;
imshow(test[]);

for?i?=?1?:?9
????hold?on;
????plot(Pos(2i)+20Pos(1i)+20‘rs‘‘MarkerSize‘2);
end

%?calculate?the?weight?of?the?identified?faces.
a?=?zeros(99);
k?=?1;

for?i?=?1?:?9
????row?=?Pos(1i);
????col?=?Pos(2i);
????subimage?=?test(row-20:row+19col-20:col+19);
????subvector?=?reshape(subimage11600)?-?F;
????a(k:)?=?subvector?*?coeff(:1:9);
????k?=?k?+?1;
end

%?calculate?the?weight?of?the?original?training?image.
g?=?zeros(99);
g(1:)?=?(faces(7:)?-?F)?*?coeff(:1:9);
g(2:)?=?(faces(4:)?-?F)?*?coeff(:1:9);
g(3:)?=?(faces(9:)?-?F)?*?coeff(:1:9);
g(4:)?=?(faces(8:)?-?F)?*?coeff(:1:9);
g(5:)?=?(faces(2:)?-?F)?*?coeff(:1:9);
g(6:)?=?(faces(6:)?-?F)?*?coeff(:1:9);
g(7:)?=?(faces(5:)?-?F)?*?coeff(:1:9);
g(8:)?=?(faces(1:)?-?F)?*?coeff(:1:9);
g(9:)?=?(faces(3:)?-?F)?*?coeff(:1:9);

%?calculate?the?norm?of?the?dfference?between?weights?ai?for?each
%?of?the?identified?faces?and?the?corresponding?weights?for?the
%original?training?faces.
l?=?zeros(91);
for?i?=?1:9
????temp?=?a(i:)?-?g(i:);
????s?=?sum(temp.^2);
????l(i1)?=?s^0.5;
end


%?plot?the?distance?vs.training?face?number
plot_dis?=?zeros(19);
plot_dis(11)?=?Pos(38);
plot_dis(12)?=?Pos(35);
plot_dis(13)?=?Pos(39);
plot_dis(14)?=?Pos(32);
plot_dis(15)?=?Pos(37);
plot_dis(16)?=?Pos(36);
plot_dis(17)?=?Pos(31);
plot_dis(18)?=?Pos(34);
plot_dis(19)?=?Pos(33);


figure;
plot(plot_dis);
title(‘distance?vs?training?face?number‘?‘FontSize‘?15);
























?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-04-08?14:24??PCA浜鴻劯璇嗗埆\
?????文件????????2879??2017-04-08?14:23??PCA浜鴻劯璇嗗埆\face_localization.m
?????目錄???????????0??2017-04-08?14:24??__MACOSX\
?????目錄???????????0??2017-04-08?14:24??__MACOSX\PCA浜鴻劯璇嗗埆\
?????文件?????????120??2017-04-08?14:23??__MACOSX\PCA浜鴻劯璇嗗埆\._face_localization.m
?????文件???????41588??2017-03-31?10:43??PCA浜鴻劯璇嗗埆\faces.mat
?????文件?????????577??2017-03-31?10:43??__MACOSX\PCA浜鴻劯璇嗗埆\._faces.mat
?????文件???????48847??2017-03-31?10:43??PCA浜鴻劯璇嗗埆\test.mat
?????文件?????????576??2017-03-31?10:43??__MACOSX\PCA浜鴻劯璇嗗埆\._test.mat

評論

共有 條評論