資源簡介
LDA 模式識別 matlab
代碼片段和文件信息
??iNum_Train_PerSample?=?3;%訓練樣本數
??iNum_Test_PerSample?=?8;%測試樣本數
??iHeight?=?24;
??iWidth?=?24;
??iClass?=?15;%人臉特征類別數
??iNum_PerSample?=?11;%每一類所含樣本個數
??iDim_Image?=?iHeight?*?iWidth;
??Image?=?zeros(iDim_Image?iClass?iNum_PerSample);%零矩陣
??
??fprintf(‘**********?Step?1?Read?Images?**********\n‘);
??for?i?=?1?:?iClass
????for?j?=?1?:?iNum_PerSample
????????if?i?10?
??????????filestr?=?strcat(‘0‘?int2str(i));%外部是連接字符串函數,內部是轉化為串
????????else
??????????filestr?=?int2str(i);
????????end
????????str_Path_Image?=?[‘F:\FaceRecognitionSystem\人臉庫\YALE\subject‘?filestr];
????????str_Path_Image?=?[str_Path_Image?‘_‘];
????????str_Path_Image?=?[str_Path_Image?int2str(j)];
????????B?=?imread(str_Path_Image?‘bmp‘);%讀取bmp格式的圖像到內存中
????????B=imresize(B[24?24]);%對圖像進行縮放
????
- 上一篇:k均值聚類分析模型以及相關代碼實現
- 下一篇:風力發電模型仿真MATLAB
評論
共有 條評論