Reputation: 322
I want to train mlp in OpenCV to recognize if there is an specified object on an image. The problem is as far as I know, constructors of Mat object (with wich mlp operates) can use just simple variables types. So I can't use Mat of Mat, vector or Mat of hists even despite the fact it consists of floats, I don't see the way to split the objects inside it, if I use the only one Mat object to collect all hists. Sorry if question is stupid. P.S. I need to use mlp concrete, because Haar cascade is used already and alternative way is neccessary to look of.
Upvotes: 1
Views: 246
Reputation: 821
Mat trainingDataMat(600, 8, CV_32FC1, trainingData);
Mat labelsMat(600, 1, CV_32SC1, labels);
Ptr svm = SVM::create();
svm->setType(SVM::C_SVC);
svm->setKernel(SVM::LINEAR);
svm->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER, 100, 1e-6));
svm->train(trainingDataMat, ROW_SAMPLE, labelsMat);
Upvotes: 1