Concatenation of 25 Histograms

2 次查看(过去 30 天)
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?

采纳的回答

Nick Counts
Nick Counts 2016-11-5
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by