MATLAB: LDA classifier problem in age classification

gaborldapca

I'm doing project on age classification using gabor features.First of all,I calculated gabor features of 4 scales and 5 orientations for each of the image of child,adolescent,adult and senior adult.I get a matrix of size 64×80.THen paper says reduce its dimension using PCA.I don't know PCA so I deleted every 2nd and 3rd row and column of matrix.I reshape the matrix columnwise and get a matrix of 594×1.I did this for 114 images(doing 10 times per image gabor feature calc on different orientations of image) so I get basically 594×1140 size matrix as input matrix.I made target matrix of 4×1140 haiving columnwise data as[1;0;0;0](child),[0;1;0;0] (adolescent) and so on. So,now I have training matrix of 594×1140 and target of 4×1140 .Next step says to do LDA classification.Sample would be a matrix of size 594×1 having gabor features of test image.Classifier should classify it in either of 4 groups-child,adolescent,adult and senior adult.Please help me with LDA classifier thing!!!I'm attaching some code where I stored gabor features in matrix:
% % % function IMVECTOR = im2vec (W16x16) % load gabor; % W16x16 = adapthisteq(W16x16,'Numtiles',[8 8]); % Features80x128 = cell(4,5); % for s = 1:4 % for j = 1:5 % Features80x128{s,j} = mminmax(abs(ifft2(G{s,j}.*fft2(double(W16x16),32,32),16,16))); % end % end % Features27x43 = cell2mat(Features80x128); % % Features27x43 (3:3:end,:)=[]; % Features27x43 (2:2:end,:)=[]; % % Features27x43 (:,3:3:end)=[]; % Features27x43 (:,2:2:end)=[]; % % % IMVECTOR = reshape (Features27x43,[594 1]); % * Item one * Item two

Best Answer

Learn PCA. QUICKLY. Use the help and doc commands
>> lookfor pca
processpca - Processes rows of matrix with principal component analysis.
prepca - Principal component analysis.
trapca - Principal component transformation.
pcacov - Principal Components Analysis (PCA) using a covariance matrix.
pcares - Residuals from a Principal Components Analysis (PCA).
princomp - Principal Components Analysis (PCA) from raw data.
Concentrate on the above functions. I don't think you need the ones below.
rotatefactors - Rotation of FA or PCA loadings.
wmspca - Multiscale Principal Component Analysis.
wmspcatool - Multisignal Principal Component Analysis GUI.
wmspcatoolmoab - MATLAB file for wmspcatoolmoab.fig
wmspcatoolmopc - MATLAB file for wmspcatoolmopc.fig
wpca - Principal Component Analysis.
dguiwmspca - Demonstrates Multivariate Wavelet PCA tool in the Wavelet Toolbox. >>
Related Question