K-NN Classsification on images
Ältere Kommentare anzeigen
i1=dicomread('1.dcm');
i2=dicomread('2.dcm');
i3=dicomread('3.dcm');
i4=dicomread('4.dcm');
Sample=[i1;
i2];
Training=[i3;
i4];
Group=['1';
'2'];
k=2;
Class = knnclassify(Sample, Training, Group, k);
disp(Class);
I get an error - The length of GROUP must equal the number of rows in TRAINING.
The size of both the images are same.
It works when I'm using co-ordinates instead of i1, i2 and so on.
I know I should be using fitcknn, but it should work as well. Any inputs please?
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 17 Mär. 2017
0 Stimmen
I know you've already accepted an answer, but you might want to check out my knn demo.
1 Kommentar
prahlad h
am 17 Mär. 2017
Kategorien
Mehr zu Nearest Neighbors finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!