I cannot train data using knn
I am getting this error:
OpenCV Error: Assertation failed <samples.type<>CV_32F || samples.type<>CV_32S> in cv::ml::TrainDataImpl::setData
I have extracted feature and placed it in a String;
//for loop
String features = "352111653512146120635735005";
Mat m;
m.push_back(features);
m.reshape(1, 1);
freeman.push_back(m);
labelMat.push_back(label);
Ptr<ml::KNearest> knn = ml::KNearest::create();
Ptr<ml::TrainData> td = ml::TrainData::create(feature, ml::ROW_SAMPLE, label); <-----I am getting error here