1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-20 04:25:42 +08:00

Added new method for training forest

This commit is contained in:
Vladislav Samsonov
2016-07-25 03:22:31 +03:00
parent 7f93d951d3
commit 17831add02
3 changed files with 79 additions and 67 deletions

View File

@@ -14,7 +14,7 @@ int main( int argc, const char **argv )
}
nSequences /= 3;
std::vector<cv::String> img1, img2, gt;
std::vector< cv::String > img1, img2, gt;
for ( int i = 0; i < nSequences; ++i )
{
@@ -23,12 +23,8 @@ int main( int argc, const char **argv )
gt.push_back( argv[1 + i * 3 + 2] );
}
cv::Ptr<cv::optflow::GPCTrainingSamples> ts = cv::optflow::GPCTrainingSamples::create( img1, img2, gt );
std::cout << "Got " << ts->size() << " samples." << std::endl;
cv::Ptr< cv::optflow::GPCForest<nTrees> > forest = cv::optflow::GPCForest<nTrees>::create();
forest->train( *ts );
cv::Ptr< cv::optflow::GPCForest< nTrees > > forest = cv::optflow::GPCForest< nTrees >::create();
forest->train( img1, img2, gt );
forest->save( "forest.dump" );
return 0;