| 27 | using MatcherImage = FeatureMatcher::Image; |
| 28 | |
| 29 | static std::unique_ptr<FeatureMatcher> CreateOnDevice( |
| 30 | std::optional<FeatureMatchingOptions> options, Device device) { |
| 31 | if (options) { |
| 32 | if (options->use_gpu != IsGPU(device)) { |
| 33 | LOG(WARNING) << "FeatureMatchingOptions::use_gpu does not match " |
| 34 | "device. FeatureMatchingOptions::use_gpu is ignored."; |
| 35 | } |
| 36 | } else { |
| 37 | options = FeatureMatchingOptions(); |
| 38 | } |
| 39 | if (options->sift->cpu_descriptor_index_cache == nullptr) { |
| 40 | options->sift->cpu_brute_force_matcher = true; |
| 41 | } |
| 42 | options->use_gpu = IsGPU(device); |
| 43 | return THROW_CHECK_NOTNULL(FeatureMatcher::Create(*options)); |
| 44 | } |
| 45 | |
| 46 | void Match(const MatcherImage& image1, |
| 47 | const MatcherImage& image2, |
nothing calls this directly
no test coverage detected