I tried to train eigenfaces using knn. It trained but when I test it with new an image it gives me the error in findnearest function
cv2.error: D:\Build\OpenCV\opencv-3.2.0\modules\ml\src\knearest.cpp:325: error: (-215) test_samples.type() == CV_32F && test_samples.cols == samples.cols in function cv::ml::BruteForceImpl::findNearest
That's my function:
ret,id,neighbours,dist=knn.findNearest(S,cv2.ml.COL_SAMPLE,7)