필터 지우기
필터 지우기

Concatenation of 25 Histograms

조회 수: 1 (최근 30일)
Mansell Teh
Mansell Teh 2016년 11월 2일
답변: Nick Counts 2016년 11월 5일
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개)

Community Treasure Hunt

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

Start Hunting!

Translated by