Ask Your Question

tulip's profile - activity

2015-09-01 09:17:06 -0500 received badge  Student (source)
2014-06-24 12:50:17 -0500 asked a question Opencv boost update gives unhandled exception

I am using CvBoost from OpenCV and as long as I leave out the update parameter, everything is fine and the classifier gets trained properly. However, once I try to add more weak learners to the classifier by providing new data and also setting update to true, I get an unhandled exception. Could you please help? Below is part of my code:

CvBoostParams params = CvBoostParams(CvBoost::DISCRETE, 1, 0.9, 1, false, NULL);


CvMat* data_f = cvCreateMat(nRows, nCols, CV_32FC1);

CvMat* resp_f = cvCreateMat(nRows, 1, CV_32FC1);

readFeatureFile(fileName, data_f, resp_f);

CvBoost boost = CvBoost();

boost.train(data_f, CV_ROW_SAMPLE, resp_f, NULL, NULL, NULL, NULL, params);

params.weak_count += 1;

boost.train(data_f, CV_ROW_SAMPLE, resp_f, NULL, NULL, NULL, NULL, params, true);

The exception is in the last line. I am using CvMat as I get compilation errors giving training data as cv::Mat.