opencv error: assertion failed (samples.cols == var_count && samples.type() == 5) in cv::ml:: etc.
I created a xml file by using svm . In my test program i have loaded that xml file and i use svm predict, but it showing the error. how can i correct this ?
int main(){
HOGDescriptor hog;
vector<float> featureVector;
Ptr<ml::SVM> svm = ml::SVM::create();
Mat testdata, feature;
Mat img = imread("C:/Users/Sam/Desktop/Test/1.jpg");
hog.compute(img, featureVector, Size(32, 32), Size(0, 0));
feature = Mat(featureVector).reshape(1, 1);
testdata.push_back(feature);
svm->load("Features.xml");
svm->predict(testdata);
}
can you please replace the (useless) screenshot with a text version of the error ? thank you .
@berak : the error is 'opencv error: assertion failed (samples.cols == var_count && samples.type() == 5) in cv::ml::SVMImpl::predict, file c:\opencv\sources etc '