double free or corruption
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 ));
There is not a problem in these code. I forgot something on other parts of my code.