MATLAB: Concatenation of 25 Histograms

#face recognitionconcatenateconcatenationhistogramMATLAB

I am currently doing face recognition system. I have calculated the normalized histogram for 25 subjects and now I want to concatenate the 25 histogram together in order to do classification using K-Nearest neighbor.
But the question is, how do I concatenate all these histogram together?

Best Answer

Mansell,
Without seeing how you are storing these histograms, it is difficult to answer.
However, if you are using any of Matlab's built-in variable types (matrices, structures, even objects) you can use cat or any of its variants.
Look at:
help cat
help vertcat
I am not an expert on the kNN, but my guess is that your implementation is designed to operate on a matrix. In that case, you probably have a particular matrix shape (dimensions) that is required. Remember that Matlab matrices can have more than 2 dimensions.
trainingSet1 = ones(10,2);
trainingSet2 = ones(10,2)*2;
trainingSet3 = ones(10,2)*3;
allHistograms(1,:,:) = trainingSet1;
allHistograms(2,:,:) = trainingSet2;
allHistograms(3,:,:) = trainingSet3;
Hopefully something in here is helpful. Good luck!
Cheers