Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 ));

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); featureSize, CV_32FC1); for(int k = 0; k < < featureSize; k++) {

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

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

click to hide/show revision 3
retagged

updated 2014-04-30 01:49:33 -0600

berak gravatar image

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 ));

click to hide/show revision 4
retagged

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

berak gravatar image

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 ));