OpenCV Error: Bad argument (The array of _responses must contain as many elements as the total number of samples in the training data matrix) in CvDTreeTrainData::set_data

asked 2017-11-30 16:47:41 -0500

My training data is a 10000 by 1024 Mat matrix type: CV_32FC1. My training classes is a 10000 by 1 Mat matrix type: CV_32S. each row of training data is a gray image and each row of training classes is a label. I want to train dtree: CvRTrees dtree=new CvRTrees(); //ROW_SAMPLE=0 dtree.train(trainingData,0 ,trainingClasses); I get this error: OpenCV Error: Bad argument (The array of _responses must be an integer or floating-point vector containing as many elements as the total number of samples in the training data matrix) in CvDTreeTrainData::set_data, file ........\opencv\modules\ml\src\tree.cpp, line 258

but the number of rows in both training data and training classes are the same. What is the problem?

edit retag flag offensive close merge delete

Comments

please show , how you set this up.

berak gravatar imageberak ( 2017-12-01 01:34:36 -0500 )edit