freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于pca的人臉特征提取和識別-閱讀頁

2025-07-05 12:33本頁面
  

【正文】 for i=1:40for j=1:5a=imread(strcat(39。,num2str(i),39。,num2str(j),39。))。b=a(1:112*92)。allsamples=[allsamples。 % allsamples 是一個M * N 矩陣,allsamples 中每一行數(shù)據(jù)代表一張圖片,其中M=200endendsamplemean=mean(allsamples)。 % xmean 是一個M N 矩陣,xmean每一行保存的數(shù)據(jù)是“每個圖片數(shù)據(jù)平均圖片”end。 % M * M 階矩陣[v d]=eig(sigma)。% 按特征值大小以降序排列dsort = flipud(d1)。%以下選擇90%的能量dsum = sum(dsort)。p = 0。dsum_extract = sum(dsort(1:p))。% (訓(xùn)練階段)計算特征臉形成的坐標(biāo)系base = xmean39。%base 是Np 階矩陣,除以dsort(i)^(1/2)是對人臉圖像的標(biāo)準(zhǔn)化(使其方差為1) % xmean39。amp。 * vsort(:,i)。 %xmean39。 % allcoor 里面是每張訓(xùn)練人臉圖片在M*p 子空間中的一個點(diǎn),即在子空間中的組合系數(shù)accu = 0。D:\ORL\s39。\39。.pgm39。b=a(1:10304)。tcoor= b * base。end。class1=floor( (index2(1)1)/5 )+1。class3=floor((index2(3)1)/5)+1。amp。elseif class1==class2class=class1。end。end。end。clc。allsamples=[]。D:\ORL\s39。\39。.pgm39。% imshow(a)。 % b 是行矢量 1N,其中N=10304,提取順序是先列后行,即從上到下,從左到右b=double(b)。 b]。 % 平均圖片,1 Nfor i=1:200 xmean(i,:)=allsamples(i,:)samplemean。% 獲取特征值及特征向量sigma=xmean*xmean39。d1=diag(d)。vsort = fliplr(v)。dsum_extract = 0。while( dsum_extract/dsum )p = p + 1。endp = 199。amp。 * vsort(:,i)。 % xmean39。 * vsort(:,1:p) * diag(dsort(1:p).^(1/2))。if(k21)figure(1)。elseif(k41) figure(2)。elseif(k61) figure(3)。elseif(k81) figure(4)。elseif(k101) figure(5)。 elseif(k121) figure(6)。 elseif(k141) figure(7)。elseif(k161) figure(8)。 elseif(k181) figure(9)。else(k200) figure(10)。endendavg = reshape(samplemean, 112,92)。平均臉39。%將模型保存save(39。, 39。, 39。)。clear all。%計算新圖片在特征子空間中的系數(shù)img = 39。a=imread(img)。 % b 是行矢量 1N,其中N=10304,提取順序是先列后行,即從上到下,從左到右b=double(b)。c = b * base。% 前15 個t = 15。temp = temp + samplemean39。% 前50 個t = 50。temp = temp + samplemean39。% 前100 個t = 100。temp = temp + samplemean39。% 前150 個t = 150。temp = temp + samplemean39。% 前199 個t = 199。temp = temp + samplemean
點(diǎn)擊復(fù)制文檔內(nèi)容
職業(yè)教育相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1