我使用OpenCv创建CvNormalBayesClassifier
,但是当我尝试训练它时,我收到一个错误消息。 这是我的代码:CvNormalBayesClassifier训练错误
CvMat train=cvMat(1, 32, CV_32FC1, val);
CvMat res=cvMat(1, 1, CV_32FC1, type);
M1.train(&train, &res);
其中val
是双阵列,并且type
只是一个INT元件的阵列。 M1
是我CvNormalBayesClassifier
我得到的错误是这个:
OpenCV Error: Bad argument (There is only a single class) in cvPreprocessCategoricalResponses, file /build/buildd/opencv-2.1.0/src/ml/ml_inner_functions.cpp, line 731 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.1.0/src/ml/ml_inner_functions.cpp:731: error: (-5) There is only a single class in function cvPreprocessCategoricalResponses
中止
谢谢你的任何建议
“CvSVMParams”(和单类分类)是否仅与SVM分类器相关,而不是正态贝叶斯分类器? – DNA