| 245 | public: |
| 246 | template <typename PairGeneratorType> |
| 247 | static std::unique_ptr<Thread> Create( |
| 248 | const GeometricVerifierOptions& verifier_options, |
| 249 | const typename PairGeneratorType::PairingOptions& pairing_options, |
| 250 | const TwoViewGeometryOptions& geometry_options, |
| 251 | const std::filesystem::path& database_path) { |
| 252 | auto database = Database::Open(database_path); |
| 253 | auto cache = std::make_shared<FeatureMatcherCache>( |
| 254 | pairing_options.CacheSize(), database); |
| 255 | return std::make_unique<GeometricVerifierThread>( |
| 256 | verifier_options, |
| 257 | geometry_options, |
| 258 | database, |
| 259 | cache, |
| 260 | [pairing_options, cache]() { |
| 261 | return std::make_unique<PairGeneratorType>(pairing_options, cache); |
| 262 | }); |
| 263 | } |
| 264 | |
| 265 | using PairGeneratorFactory = std::function<std::unique_ptr<PairGenerator>()>; |
| 266 | |