Commit ff1fb9f7 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

minor stitching optimization (use cpu matchers instead of gpu matchers on multicore processors)

parent cfdf4640
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment