K-NN Classsification on images
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 17 de Mzo. de 2017
0 votos
I know you've already accepted an answer, but you might want to check out my knn demo.
1 comentario
prahlad h
el 17 de Mzo. de 2017
Categorías
Más información sobre Nearest Neighbors en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!