Undocumented requirement in CvNormalBayesClassifier::train (Bug #1534)
In CvStatModel::train it is told, that sample_idx matrix can have CV_32SC1 or CV_8UC1 type. In CvNormalBayesClassifier::train is not any additional info. But when I was trying to train CvNormalBayesClassifier class with sample_idx type set to CV_32SC1, this exception was thrown.
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
When I've changed sample_idx type to CV_8UC1, the exception has been gone.