0
FileStorage fs;
fs.open("SVM.xml" , FileStorage::READ);
Mat SVM_TrainningData;
Mat SVM_Classes;
fs["TrainingData"] >>SVM_TrainningData;
fs["classes"] >>SVM_Classes;
Ptr<ml::SVM> svm = ml::SVM::create();
svm->setType(ml::SVM::C_SVC);
svm->setKernel(ml::SVM::LINEAR);
//I have do the data type test here, The data type is ok.
#if _DEBUG
CV_Assert(SVM_TrainningData.type() == CV_32F || SVM_TrainningData.type() == CV_32S);
if (!SVM_Classes.empty())
{
CV_Assert(SVM_Classes.type() == CV_32F || SVM_Classes.type() == CV_32S);
}
#endif
svmClassifier->train(SVM_TrainningData, ml::ROW_SAMPLE,SVM_Classes); //crash here