move feature pool to softcascade module

This commit is contained in:
marina.kolpakova
2013-01-30 10:43:18 +04:00
parent 0b039f3c6b
commit fa15fcc53e
6 changed files with 134 additions and 248 deletions

View File

@@ -118,8 +118,8 @@ int main(int argc, char** argv)
int nfeatures = cfg.poolSize;
cv::Size model = cfg.model(it);
std::cout << "Model " << model << std::endl;
sft::ICFFeaturePool pool(model, nfeatures);
nfeatures = pool.size();
cv::Ptr<cv::FeaturePool> pool = cv::FeaturePool::create(model, nfeatures);
nfeatures = pool->size();
int npositives = cfg.positives;
@@ -135,7 +135,7 @@ int main(int argc, char** argv)
std::string path = cfg.trainPath;
sft::ScaledDataset dataset(path, *it);
if (boost->train(&dataset, &pool, cfg.weaks, cfg.treeDepth))
if (boost->train(&dataset, pool, cfg.weaks, cfg.treeDepth))
{
CvFileStorage* fout = cvOpenFileStorage(cfg.resPath(it).c_str(), 0, CV_STORAGE_WRITE);
boost->write(fout, cfg.cascadeName);
@@ -145,7 +145,7 @@ int main(int argc, char** argv)
cv::Mat thresholds;
boost->setRejectThresholds(thresholds);
boost->write(fso, &pool, thresholds);
boost->write(fso, pool, thresholds);
cv::FileStorage tfs(("thresholds." + cfg.resPath(it)).c_str(), cv::FileStorage::WRITE);
tfs << "thresholds" << thresholds;