I am currently working on training and testing greyscale images. So far I've trained the images using the svm.train()
method.
However, I fail at testing the images. So far My Code for Testing the Images:
for (int i = 0; i < test_files.size(); i++){
temporary_image = imread(test_files[i], 0);
Mat image1d(1, temporary_image.cols, CV_32FC1);
//Mat row_image = temporary_distance.reshape(1, 1);
float result = svm.predict(image1d);
printf("\n%d\n", result);
}
Could you please tell me, how can I fix the problem?
svm.predict(image1d)
--> This gives the error.
Whether I make it float result = svm.predict(image1d)
or svm.predict(image1d)
simply same problem occurs.
Before Asking this question I read