Please help me to understand the PCA usage.

1 回表示 (過去 30 日間)
saeeda saher
saeeda saher 2018 年 6 月 7 日
コメント済み: Adam 2018 年 6 月 8 日
I want to use HOG for feature extraction and want to apply PCA for dimension reduction ,I found this code but did not understand the PCA function usage. Please make me understand how PCA function is used and what results its providing or Is it used in the code in correct way, If not please help me to make it correct.
% Features Extraction of Face based on HOG
clear;
training=imageSet('Dataset\','recursive'); % folder name of the database
K=1;
for i=1:size(training,2 )
for j=1:training(i).Count
Face=read(training(i),j);
Face=imresize(Face, [48 48]);
%Face=rgb2gray(Face); %If color images
Face = pca(double(Face));
HOG_Features= extractHOGFeatures(Face);
trainingFeatures(K,:)=single([HOG_Features]);
traininglabel{K}=training(i).Description;
K=K+1;
end
persons{i}=training(i).Description;
end
traininglabel=traininglabel';
csvwrite('Test.csv', trainingFeatures)
  3 件のコメント
saeeda saher
saeeda saher 2018 年 6 月 7 日
Thank You for reply .. will you make me understand according to code, PCA is used for dimension reduction. and i have read many research papers in those papers PCA is used after HOG features. I mean HOG features are passed to the PCA. But here PCA is used before HOG. That is confusing me
Adam
Adam 2018 年 6 月 8 日
I have never worked with HOG features, but if the PCA is being done before the HOG then in this case it is because whoever wrote the code wishes to reduce the dimensionality of their original data before extracting features from the resultant dimension-reduced data. This will remove redundancy that may be present in the original data and can cause feature extraction to either be inefficient or simply not work as well.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by