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

This commit is contained in:
Vladislav Vinogradov 2011-08-10 06:53:24 +00:00
parent cfdf464052
commit ff1fb9f7cc

View File

@ -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);