Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

svm->save() throws SEHException

I use the ff. code

Mat data;
Mat feature;
hconcat(r_hist.reshape(1, 1), g_hist.reshape(1, 1), feature); //r_hist and g_hist are color histograms
data.push_back(feature);

int label = 1;
Mat labelMat(1, 1, CV_32SC1, label);

Ptr < cv::ml::SVM > svm = SVM::create();
svm->setC(0.01);
svm->setType(ml::SVM::C_SVC);
svm->setKernel(ml::SVM::LINEAR);
svm->setTermCriteria((cvTermCriteria(TermCriteria::MAX_ITER, 100, 1e-6)));
svm->train(data, ROW_SAMPLE, labelMat);
svm->save("svm.xml");

Can somebody help me with this? I use version 3.0.0

click to hide/show revision 2
retagged

svm->save() throws SEHException

I use the ff. code

Mat data;
Mat feature;
hconcat(r_hist.reshape(1, 1), g_hist.reshape(1, 1), feature); //r_hist and g_hist are color histograms
data.push_back(feature);

int label = 1;
Mat labelMat(1, 1, CV_32SC1, label);

Ptr < cv::ml::SVM > svm = SVM::create();
svm->setC(0.01);
svm->setType(ml::SVM::C_SVC);
svm->setKernel(ml::SVM::LINEAR);
svm->setTermCriteria((cvTermCriteria(TermCriteria::MAX_ITER, 100, 1e-6)));
svm->train(data, ROW_SAMPLE, labelMat);
svm->save("svm.xml");

Can somebody help me with this? I use version 3.0.0