Query about the kNN and SVM classifiers training

2 views (last 30 days)
Hi all,
could anyone help me how to use the kNN and SVM classifiers where my problem in details as follows :
1-I have two classes of fruit images (Normal and Abnormal)
2-I extracted color feature histogram where bins=250
3-I sorted these extracted features in a matrix of size 250 *100
4-I transposed each matrix like : transposed_matrix= matrix' % for K-means clustering purpose
5-I clustered each matrix to 4-centers using K-means algorithm where each center is a feature
6- I stored 40 clustered matrices of normal images (each one is represented by 4-centers ) in the training matrix to be 160 centers * 250 columns as a training matrix ,also I did the same thing for abnormal images in another training matrix also
But now I don't know how to give these two training matrices to the kNN and SVM classifiers
and then test an unknown image taken from the testing set (also represented by 4-centers) using
kNN and SVM classifiers to classify it to normal or abnormal class,could anyone guide me how to
do that in a matlab code lines because I am new in matlab I saw the svmclassify function on
and
But I don't know how to adapt these codes for my case, I attached my test code
and thank you so much in advance.

Answers (0)

Categories

Find more on Recognition, Object Detection, and Semantic Segmentation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!