亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pfc.m

?? 這是一個人臉識別程序
?? M
字號:
% Face recognition by Santiago Serrano
%人臉識別代碼
clear all
close all
clc
% number of images on your training set.
%訓(xùn)練集數(shù)目
M=10;
%Chosen std and mean. 
%It can be any number that it is close to the std and mean of most of the images.
um=100;
ustd=80;
%read and show images(bmp);
%讀入M個訓(xùn)練圖像并顯示在一個窗口上
S=[];   %img matrix
figure(1);
for i=1:M
    str=strcat('C:\MATLAB7\work\',int2str(i),'.bmp');    %concatenates two strings that form the name of the image
    eval('img=imread(str);');
    subplot(ceil(sqrt(M)),ceil(sqrt(M)),i)
    imshow(img)
    if i==3
        title('Training set','fontsize',18)
    end
    drawnow;
    [irow icol]=size(img);    % get the number of rows (N1) and columns (N2)獲得圖像的大小,所有圖像的大小要一致
    temp=reshape(img',irow*icol,1);     %creates a (N1*N2)x1 matrix一幅圖像構(gòu)造一個向量 向量的大小和圖像大小有關(guān)
    S=[S temp];         %X is a N1*N2xM matrix after finishing the sequence  生成一個向量矩陣,M個圖像有M列
                        %this is our S
end
%Here we change the mean and std of all images. We normalize all images.
%This is done to reduce the error due to lighting conditions.
%下面是對圖像規(guī)范化,更具所有圖像的的平均值和方差
for i=1:size(S,2)
    temp=double(S(:,i));
    m=mean(temp);
    st=std(temp);
    S(:,i)=(temp-m)*ustd/st+um;
end
%show normalized images 顯示規(guī)范化后的圖像
figure(2);
for i=1:M
    str=strcat(int2str(i),'.bmp');
    img=reshape(S(:,i),icol,irow);
    img=img';
    eval('imwrite(img,str)');   
    subplot(ceil(sqrt(M)),ceil(sqrt(M)),i)
    imshow(img)
    drawnow;
    if i==3
        title('Normalized Training Set','fontsize',18)
    end
end
%mean image;顯示平均圖像,所有圖像疊加在一起
m=mean(S,2);   %obtains the mean of each row instead of each column
tmimg=uint8(m);   %converts to unsigned 8-bit integer. Values range from 0 to 255
img=reshape(tmimg,icol,irow);    %takes the N1*N2x1 vector and creates a N2xN1 matrix
img=img';       %creates a N1xN2 matrix by transposing the image.
figure(3);
imshow(img);
title('Mean Image','fontsize',18)

% Change image for manipulation
%對圖像變換便于處理
dbx=[];   % A matrix
for i=1:M
    temp=double(S(:,i));
    dbx=[dbx temp];
end
%Covariance matrix C=A'A, L=AA'
%求協(xié)方差矩陣
A=dbx';
L=A*A';
% vv are the eigenvector for L
% dd are the eigenvalue for both L=dbx'*dbx and C=dbx*dbx';
[vv dd]=eig(L);
% Sort and eliminate those whose eigenvalue is zero
%對特征值進行排序并去掉0
v=[];
d=[];
for i=1:size(vv,2)
    if(dd(i,i)>1e-4)
        v=[v vv(:,i)];
        d=[d dd(i,i)];
    end
end

%sort,  will return an ascending sequence
%排序并返回降序的
[B index]=sort(d);
ind=zeros(size(index));
dtemp=zeros(size(index));
vtemp=zeros(size(v));
len=length(index);
for i=1:len
    dtemp(i)=B(len+1-i);
    ind(i)=len+1-index(i);
    vtemp(:,ind(i))=v(:,i);
end
d=dtemp;
v=vtemp;

%Normalization of eigenvectors
%對特征向量進行規(guī)范化
for i=1:size(v,2)       %access each column
   kk=v(:,i);
   temp=sqrt(sum(kk.^2));
   v(:,i)=v(:,i)./temp;
end
%Eigenvectors of C matrix
%得到C的特征向量矩陣
u=[];
for i=1:size(v,2)
    temp=sqrt(d(i));
    u=[u (dbx*v(:,i))./temp];
end
%Normalization of eigenvectors
for i=1:size(u,2)
   kk=u(:,i);
   temp=sqrt(sum(kk.^2));
   u(:,i)=u(:,i)./temp;
end

% show eigenfaces;
%顯示特征臉
figure(4);
for i=1:size(u,2)
    img=reshape(u(:,i),icol,irow);
    img=img';
    img=histeq(img,255);
    subplot(ceil(sqrt(M)),ceil(sqrt(M)),i)
    imshow(img)
    drawnow;
    if i==3
        title('Eigenfaces','fontsize',18)
    end
end
% Find the weight of each face in the training set.
%找出訓(xùn)練集中每張臉的權(quán)重
omega = [];
for h=1:size(dbx,2)
    WW=[];    
    for i=1:size(u,2)
        t = u(:,i)';    
        WeightOfImage = dot(t,dbx(:,h)');
        WW = [WW; WeightOfImage];
    end
    omega = [omega WW];
end

% Acquire new image
% Note: the input image must have a bmp or jpg extension. 
%       It should have the same size as the ones in your training set. 
%       It should be placed on your desktop
%獲取一張新的臉
%注意:圖像的大小和訓(xùn)練集中圖像大小一樣
%
InputImage = input('Please enter the name of the image and its extension \n','s');
InputImage = imread(strcat('C:\MATLAB7\work\',InputImage));
figure(5)
subplot(1,2,1)
imshow(InputImage); colormap('gray');title('Input image','fontsize',18)
InImage=reshape(double(InputImage)',irow*icol,1);  
temp=InImage;
me=mean(temp);
st=std(temp);
temp=(temp-me)*ustd/st+um;
NormImage = temp;
Difference = temp-m;
NormImage = Difference;
p = [];
aa=size(u,2);
for i = 1:aa
    pare = dot(NormImage,u(:,i));
    p = [p; pare];
end
ReshapedImage = m + u(:,1:aa)*p;    %m is the mean image, u is the eigenvector
ReshapedImage = reshape(ReshapedImage,icol,irow);
ReshapedImage = ReshapedImage';
%show the reconstructed image. 顯示重構(gòu)的圖像
subplot(1,2,2)
imagesc(ReshapedImage); colormap('gray');
title('Reconstructed image','fontsize',18)
InImWeight = [];
for i=1:size(u,2)
    t = u(:,i)';
    WeightOfInputImage = dot(t,Difference');
    InImWeight = [InImWeight; WeightOfInputImage];
end
ll = 1:M;
figure(68)
subplot(1,2,1)
stem(ll,InImWeight)
title('Weight of Input Face','fontsize',14)
% Find Euclidean distance 查找Euclidean距離
e=[];
for i=1:size(omega,2)
    q = omega(:,i);
    DiffWeight = InImWeight-q;
    mag = norm(DiffWeight);
    e = [e mag];
end
kk = 1:size(e,2);
subplot(1,2,2)
stem(kk,e)
title('Eucledian distance of input image','fontsize',14)
MaximumValue=max(e)
MinimumValue=min(e)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色诱视频网站一区| 激情久久五月天| 色国产综合视频| 亚洲午夜视频在线| 5月丁香婷婷综合| 日本免费新一区视频| 欧美一级艳片视频免费观看| 久久国产福利国产秒拍| 久久婷婷成人综合色| 国产suv一区二区三区88区| 中文字幕av不卡| 欧美又粗又大又爽| 日韩高清不卡一区二区三区| 亚洲精品在线观| av在线播放不卡| 日日欢夜夜爽一区| 亚洲精品一区二区在线观看| 不卡免费追剧大全电视剧网站| 一区二区三国产精华液| 欧美不卡一区二区三区四区| 国产精品一卡二卡在线观看| 中文字幕佐山爱一区二区免费| 欧美猛男男办公室激情| 国产成人在线网站| 亚洲午夜羞羞片| 26uuuu精品一区二区| 色综合久久综合中文综合网| 免费人成网站在线观看欧美高清| 国产亚洲精品中文字幕| 欧美亚州韩日在线看免费版国语版| 麻豆91免费观看| ...中文天堂在线一区| 欧美一区二区三区的| 成人小视频免费在线观看| 亚洲成人精品在线观看| 日本一区二区免费在线观看视频| 欧美视频精品在线| 国产69精品久久99不卡| 日韩成人dvd| 亚洲卡通欧美制服中文| 国产亚洲一区二区三区| 欧美在线观看视频一区二区三区| 国产一区二区三区| 五月婷婷激情综合| 成人欧美一区二区三区视频网页| 日韩欧美一区二区免费| 91黄色免费网站| 国产馆精品极品| 日韩国产欧美一区二区三区| 亚洲视频资源在线| 日本一区二区三区电影| 欧美二区三区的天堂| 成人少妇影院yyyy| 精品在线观看免费| 亚洲国产人成综合网站| 国产精品国产三级国产普通话蜜臀| 欧美精品1区2区| 欧美天堂一区二区三区| 色悠悠亚洲一区二区| 国产成人综合亚洲网站| 精品一区二区在线播放| 日产国产欧美视频一区精品| 亚洲一区在线观看视频| 亚洲视频在线观看三级| 中文久久乱码一区二区| 久久综合色综合88| 久久一区二区视频| 精品少妇一区二区三区日产乱码| 欧美色电影在线| 在线看日本不卡| 国产一二三精品| 中文字幕第一区二区| 日韩欧美在线网站| 成人一区在线观看| 欧美撒尿777hd撒尿| 在线视频你懂得一区| 国产精品麻豆久久久| 成人性视频免费网站| 国产成人午夜99999| 国产精品国产三级国产普通话99| 中文字幕一区av| 欧美日韩五月天| 欧美tickling网站挠脚心| 国产综合色视频| 日韩精品视频网| 青青草国产精品97视觉盛宴| 日本人妖一区二区| 美洲天堂一区二卡三卡四卡视频| 三级精品在线观看| 日韩不卡一区二区三区| 青草国产精品久久久久久| 久久精品国产澳门| 国产精品123| 久久疯狂做爰流白浆xx| 国产精品资源网站| 成人成人成人在线视频| 色婷婷狠狠综合| 欧美一区二区三区日韩| 精品成人一区二区三区| 欧美高清在线视频| 亚洲乱码日产精品bd| 亚洲一区二区三区激情| 日本欧美在线看| 国产精品69毛片高清亚洲| 成人爱爱电影网址| 欧美少妇性性性| 久久午夜羞羞影院免费观看| 欧美韩国一区二区| 亚洲精品成人少妇| 蜜桃一区二区三区四区| 国产麻豆精品95视频| 91香蕉国产在线观看软件| 欧美日本高清视频在线观看| 精品入口麻豆88视频| 久久蜜桃香蕉精品一区二区三区| 综合欧美亚洲日本| 男人的天堂亚洲一区| 国产成人精品免费视频网站| 色偷偷一区二区三区| 日韩欧美不卡在线观看视频| 中文字幕乱码久久午夜不卡 | 一区二区三区在线免费| 麻豆精品视频在线观看视频| 成人av资源在线观看| 欧美一区二区三区婷婷月色| 中文字幕av一区二区三区高| 日韩二区在线观看| av在线不卡电影| 精品奇米国产一区二区三区| 成人欧美一区二区三区黑人麻豆| 麻豆成人久久精品二区三区红 | 亚洲国产欧美在线| 国产一级精品在线| 8x8x8国产精品| 亚洲区小说区图片区qvod| 国产米奇在线777精品观看| 欧美精品粉嫩高潮一区二区| 亚洲日本护士毛茸茸| 精品在线播放午夜| 欧美日韩国产一级二级| 亚洲色图欧美在线| 国产成人免费视频网站| 欧美一区二区视频观看视频| 亚洲精品国产第一综合99久久| 国产999精品久久久久久 | 91精品国模一区二区三区| 自拍偷拍亚洲欧美日韩| 国产精品自拍av| 日韩欧美高清一区| 日日摸夜夜添夜夜添亚洲女人| 色哟哟国产精品| 成人免费在线视频观看| 国产成人免费xxxxxxxx| 精品欧美一区二区三区精品久久| 亚洲国产sm捆绑调教视频 | 欧美日韩免费观看一区三区| 日韩毛片视频在线看| 国产麻豆精品久久一二三| 精品国产sm最大网站| 蓝色福利精品导航| 91麻豆精品91久久久久久清纯 | 91精品国产91热久久久做人人| 亚洲线精品一区二区三区| 成人激情文学综合网| 国产欧美日本一区视频| 国产盗摄一区二区| 久久欧美中文字幕| 国产一区视频导航| 久久久亚洲高清| 国产不卡一区视频| 亚洲国产精品传媒在线观看| 岛国av在线一区| 中文字幕欧美日韩一区| 成人av在线影院| 亚洲精选在线视频| 欧美综合色免费| 日精品一区二区| 欧美不卡123| 国产精品一二三区| 中文欧美字幕免费| 色久优优欧美色久优优| 亚洲第一二三四区| 日韩欧美视频在线| 国产一区二区不卡老阿姨| 国产欧美一区二区精品秋霞影院| 国产精品综合一区二区| 中文字幕精品三区| 91麻豆精品在线观看| 亚洲精品乱码久久久久久黑人 | 视频一区二区不卡| 日韩精品专区在线| 国产精品一区久久久久| 综合久久久久久| 4hu四虎永久在线影院成人| 狠狠色丁香九九婷婷综合五月| 国产精品久久久久影院老司 | 久久精品国产精品亚洲综合| 久久久久88色偷偷免费| 色婷婷综合久久久| 日韩专区欧美专区|