diff --git a/modules/stitching/matchers.cpp b/modules/stitching/matchers.cpp index 640fe5d578..b0438869af 100644 --- a/modules/stitching/matchers.cpp +++ b/modules/stitching/matchers.cpp @@ -411,7 +411,15 @@ namespace BestOf2NearestMatcher::BestOf2NearestMatcher(bool try_use_gpu, float match_conf, int num_matches_thresh1, int num_matches_thresh2) { + bool use_gpu = false; if (try_use_gpu && getCudaEnabledDeviceCount() > 0) + { + DeviceInfo info; + if (info.majorVersion() >= 2 && cv::getNumberOfCPUs() < 4) + use_gpu = true; + } + + if (use_gpu) impl_ = new GpuMatcher(match_conf); else impl_ = new CpuMatcher(match_conf);