double free or corruption

asked 2014-04-29 18:14:21 -0600

jossyy gravatar image

updated 2014-04-30 03:50:46 -0600

berak gravatar image

Hello,I have a class , and there is a member vector<cvtrees*> vect. I generate many cvtrees object and push on vect. I use this function for train

Mat trainingDataMat(trainSize, featureSize, CV_32FC1); ........ fill trainingDataMat..... for(int i = 0; i < LOOP; i++) { Mat labelMat(trainSize, 1, CV_32FC1); ........... fill labelMat......... // learn classifier CvRTrees rtrees = new CvRTrees(); (rtrees).train( trainingDataMat, CV_ROW_SAMPLE, labelMat, Mat(), Mat(), Mat(), Mat(), CvRTParams()); this->rtreesVector.push_back(rtrees); }

And I use a function for predict. When I run below code, I get an error no source...

Mat testSample(1, featureSize, CV_32FC1); for(int k = 0; k < featureSize; k++) {

          testSample.at<float>(k) = (float)this->trainInvoiceVector[i]->at(j,

k); } for(int i = 0; i < this->rtreesVector.size(); i++) { int response = (int)((*(this->rtreesVector[i])).predict( testSample ));

edit retag flag offensive close merge delete

Comments

There is not a problem in these code. I forgot something on other parts of my code.

jossyy gravatar imagejossyy ( 2014-04-30 07:31:06 -0600 )edit