OCL_PERF_TEST_P(stitch, boat, TEST_DETECTORS) { UMat pano; vector<Mat> _imgs; _imgs.push_back( imread( getDataPath("stitching/boat1.jpg") ) ); _imgs.push_back( imread( getDataPath("stitching/boat2.jpg") ) ); _imgs.push_back( imread( getDataPath("stitching/boat3.jpg") ) ); _imgs.push_back( imread( getDataPath("stitching/boat4.jpg") ) ); _imgs.push_back( imread( getDataPath("stitching/boat5.jpg") ) ); _imgs.push_back( imread( getDataPath("stitching/boat6.jpg") ) ); vector<UMat> imgs = ToUMat(_imgs); Ptr<detail::FeaturesFinder> featuresFinder = GetParam() == "orb" ? Ptr<detail::FeaturesFinder>(new detail::OrbFeaturesFinder()) : Ptr<detail::FeaturesFinder>(new detail::SurfFeaturesFinder()); Ptr<detail::FeaturesMatcher> featuresMatcher = GetParam() == "orb" ? makePtr<detail::BestOf2NearestMatcher>(false, ORB_MATCH_CONFIDENCE) : makePtr<detail::BestOf2NearestMatcher>(false, SURF_MATCH_CONFIDENCE); declare.iterations(20); while(next()) { Stitcher stitcher = Stitcher::createDefault(); stitcher.setFeaturesFinder(featuresFinder); stitcher.setFeaturesMatcher(featuresMatcher); stitcher.setWarper(makePtr<SphericalWarper>()); stitcher.setRegistrationResol(WORK_MEGAPIX); startTimer(); stitcher.stitch(imgs, pano); stopTimer(); } EXPECT_NEAR(pano.size().width, 10789, 200); EXPECT_NEAR(pano.size().height, 2663, 100); SANITY_CHECK_NOTHING(); }
PERF_TEST_P(stitch, b12, TEST_DETECTORS) { Mat pano; vector<Mat> imgs; imgs.push_back( imread( getDataPath("stitching/b1.png") ) ); imgs.push_back( imread( getDataPath("stitching/b2.png") ) ); Ptr<detail::FeaturesFinder> featuresFinder = GetParam() == "orb" ? Ptr<detail::FeaturesFinder>(new detail::OrbFeaturesFinder()) : Ptr<detail::FeaturesFinder>(new detail::SurfFeaturesFinder()); Ptr<detail::FeaturesMatcher> featuresMatcher = GetParam() == "orb" ? makePtr<detail::BestOf2NearestMatcher>(false, ORB_MATCH_CONFIDENCE) : makePtr<detail::BestOf2NearestMatcher>(false, SURF_MATCH_CONFIDENCE); declare.time(30 * 20).iterations(20); while(next()) { Stitcher stitcher = Stitcher::createDefault(); stitcher.setFeaturesFinder(featuresFinder); stitcher.setFeaturesMatcher(featuresMatcher); stitcher.setWarper(makePtr<SphericalWarper>()); stitcher.setRegistrationResol(WORK_MEGAPIX); startTimer(); stitcher.stitch(imgs, pano); stopTimer(); } Mat pano_small; if (!pano.empty()) resize(pano, pano_small, Size(320, 240), 0, 0, INTER_AREA); SANITY_CHECK(pano_small, 5); }
PERF_TEST_P(stitch, a123, TEST_DETECTORS) { Mat pano; vector<Mat> imgs; imgs.push_back( imread( getDataPath("stitching/a1.png") ) ); imgs.push_back( imread( getDataPath("stitching/a2.png") ) ); imgs.push_back( imread( getDataPath("stitching/a3.png") ) ); Ptr<detail::FeaturesFinder> featuresFinder = GetParam() == "orb" ? Ptr<detail::FeaturesFinder>(new detail::OrbFeaturesFinder()) : Ptr<detail::FeaturesFinder>(new detail::SurfFeaturesFinder()); Ptr<detail::FeaturesMatcher> featuresMatcher = GetParam() == "orb" ? makePtr<detail::BestOf2NearestMatcher>(false, ORB_MATCH_CONFIDENCE) : makePtr<detail::BestOf2NearestMatcher>(false, SURF_MATCH_CONFIDENCE); declare.time(30 * 20).iterations(20); while(next()) { Stitcher stitcher = Stitcher::createDefault(); stitcher.setFeaturesFinder(featuresFinder); stitcher.setFeaturesMatcher(featuresMatcher); stitcher.setWarper(makePtr<SphericalWarper>()); stitcher.setRegistrationResol(WORK_MEGAPIX); startTimer(); stitcher.stitch(imgs, pano); stopTimer(); } EXPECT_NEAR(pano.size().width, 1182, 50); EXPECT_NEAR(pano.size().height, 682, 30); SANITY_CHECK_NOTHING(); }