1 | initial version |
you can no more create it on the 'stack' (like it was in 2.4.9)
instead, you will have to use a factory function, returning a cv::Ptr :
cv::Ptr<cv::ml::NormalBayesClassifier> classifier = cv::ml::NormalBayesClassifier::create();
//Train classifier...
classifier->train(trainingData, trainingLabels);
//Evaluate classifier...
classifier->predict(evalData,&results);
2 | No.2 Revision |
since you're obviously running opencv3.0, you can no more create it on the 'stack' (like it was in 2.4.9)
instead, you will have to use a factory function, returning a cv::Ptr :
cv::Ptr<cv::ml::NormalBayesClassifier> classifier = cv::ml::NormalBayesClassifier::create();
//Train classifier...
classifier->train(trainingData, trainingLabels);
//Evaluate classifier...
classifier->predict(evalData,&results);
3 | No.3 Revision |
since you're obviously running opencv3.0, you can no more create it on the 'stack' (like it was in 2.4.9)
instead, you will have to use a factory function, returning a cv::Ptr :
cv::Ptr<cv::ml::NormalBayesClassifier> classifier = cv::ml::NormalBayesClassifier::create();
//Train classifier...
classifier->train(trainingData, trainingLabels);
//Evaluate classifier...
classifier->predict(evalData,&results);
also, better look at the 3.0 documentation, i.e. the ml module got some huge overhaul lately.
4 | No.4 Revision |
since you're obviously running opencv3.0, you can no more create it on the 'stack' (like it was in 2.4.9)
instead, you will have to use a factory function, returning a cv::Ptr :
cv::Ptr<cv::ml::NormalBayesClassifier> classifier = cv::ml::NormalBayesClassifier::create();
//Train classifier...
classifier->train(trainingData, trainingLabels);
//Evaluate classifier...
classifier->predict(evalData,&results);
classifier->predict(evalData,results);
// note: i skipped the address-operator on results,
// which probably was wrong in the 1st place
also, better look at the 3.0 documentation, i.e. the ml module got some huge overhaul lately.
5 | No.5 Revision |
since you're obviously running opencv3.0, you can no more create it on the 'stack' (like it was in 2.4.9)
instead, you will have to use a factory function, returning a cv::Ptr :
cv::Ptr<cv::ml::NormalBayesClassifier> classifier = cv::ml::NormalBayesClassifier::create();
//Train classifier...
classifier->train(trainingData, cv::ml::ROW_SAMPLE, trainingLabels);
// note: it needs a flag now, if a feature is on a row or a column.
//Evaluate classifier...
classifier->predict(evalData,results);
// note: i skipped the address-operator on results,
// which probably was wrong in the 1st place
also, better look at the 3.0 documentation, i.e. the ml module got some huge overhaul lately.
6 | No.6 Revision |
since you're obviously running opencv3.0, you can no more create it on the 'stack' (like it was in 2.4.9)2.4.9). it does not have a public constructor (that's your 'abstract class' error above)
instead, you will have to use a factory function, returning a cv::Ptr :
cv::Ptr<cv::ml::NormalBayesClassifier> classifier = cv::ml::NormalBayesClassifier::create();
//Train classifier...
classifier->train(trainingData, cv::ml::ROW_SAMPLE, trainingLabels);
// note: it needs a flag now, if a feature is on a row or a column.
//Evaluate classifier...
classifier->predict(evalData,results);
// note: i skipped the address-operator on results,
// which probably was wrong in the 1st place
also, better look at the 3.0 documentation, i.e. the ml module got some huge overhaul lately.