Updated by Alexander Shishkov about 13 years ago

In "CvStatModel::train":http://opencv.itseez.com/modules/ml/doc/statistical_models.html#cvstatmodel-train it is told, that sample_idx matrix can have CV_32SC1 or CV_8UC1 type. In "CvNormalBayesClassifier::train":http://opencv.itseez.com/modules/ml/doc/normal_bayes_classifier.html#cvnormalbayesclassifier-train is not any additional info. But when I was trying to train CvNormalBayesClassifier [[CvNormalBayesClassifier]] class with sample_idx type set to CV_32SC1, this exception was thrown.

<pre>
OpenCV [[OpenCV]] Error: Bad argument (There is only a single class) in cvPreprocessCategoricalResponses, file /home/miki/sources/OpenCV-2.3.1/modules/ml/src/inner_functions.cpp, line 729
terminate called after throwing an instance of 'cv::Exception'
what(): /home/miki/sources/OpenCV-2.3.1/modules/ml/src/inner_functions.cpp:729: error: (-5) There is only a single class in function cvPreprocessCategoricalResponses
</pre>

When I've changed sample_idx type to CV_8UC1, the exception has been gone.

Back