14 #include <unordered_map>
189 void MaybeLoadCameras();
190 void MaybeLoadImages();
192 const size_t cache_size_;
194 std::mutex database_mutex_;
195 std::unique_ptr<std::unordered_map<camera_t, Camera>> cameras_cache_;
196 std::unique_ptr<std::unordered_map<image_t, Image>> images_cache_;
197 std::unique_ptr<ThreadSafeLRUCache<image_t, FeatureKeypoints>>
199 std::unique_ptr<ThreadSafeLRUCache<image_t, FeatureDescriptors>>
201 std::unique_ptr<ThreadSafeLRUCache<image_t, bool>> keypoints_exists_cache_;
202 std::unique_ptr<ThreadSafeLRUCache<image_t, bool>>
203 descriptors_exists_cache_;
292 void GetFeatureData(
const int index,
300 std::unique_ptr<OpenGLContextManager> opengl_context_;
303 std::array<image_t, 2> prev_uploaded_image_ids_;
304 std::array<FeatureKeypoints, 2> prev_uploaded_keypoints_;
305 std::array<FeatureDescriptors, 2> prev_uploaded_descriptors_;
345 void Match(
const std::vector<std::pair<image_t, image_t>>& image_pairs);
354 std::vector<std::unique_ptr<FeatureMatcherThread>> matchers_;
355 std::vector<std::unique_ptr<FeatureMatcherThread>> guided_matchers_;
356 std::vector<std::unique_ptr<Thread>> verifiers_;
357 std::unique_ptr<ThreadPool> thread_pool_;
392 const std::string& database_path);
399 std::shared_ptr<Database> database_;
400 std::shared_ptr<FeatureMatcherCache> cache_;
401 std::shared_ptr<SiftFeatureMatcher> matcher_;
426 const std::string& database_path);
431 std::vector<image_t> GetOrderedImageIds()
const;
432 void RunSequentialMatching(
const std::vector<image_t>& image_ids);
433 void RunLoopDetection(
const std::vector<image_t>& image_ids);
438 const std::shared_ptr<FeatureMatcherCache> cache_;
447 const std::string& database_path);
465 const std::string& database_path);
485 const std::string& database_path);
510 const std::string& database_path);
541 const std::string& database_path);
544 const static size_t kCacheSize = 100;
ExhaustiveFeatureMatcher(const ExhaustiveMatchingOptions &options, const SiftMatchingOptions &match_options, const std::string &database_path)
const Image & GetImage(const image_t image_id)
FeatureMatches GetMatches(const image_t image_id1, const image_t image_id2)
FeatureMatcherCache(const size_t cache_size, const Database *database)
void WriteMatches(const image_t image_id1, const image_t image_id2, const FeatureMatches &matches)
bool ExistsInlierMatches(const image_t image_id1, const image_t image_id2)
void DeleteInlierMatches(const image_t image_id1, const image_t image_id2)
void WriteTwoViewGeometry(const image_t image_id1, const image_t image_id2, const TwoViewGeometry &two_view_geometry)
std::vector< image_t > GetImageIds()
const Camera & GetCamera(const camera_t camera_id)
bool ExistsDescriptors(const image_t image_id)
void DeleteMatches(const image_t image_id1, const image_t image_id2)
std::shared_ptr< FeatureKeypoints > GetKeypoints(const image_t image_id)
bool ExistsKeypoints(const image_t image_id)
bool ExistsMatches(const image_t image_id1, const image_t image_id2)
std::shared_ptr< FeatureDescriptors > GetDescriptors(const image_t image_id)
void SetMaxNumMatches(const int max_num_matches)
FeatureMatcherThread(const SiftMatchingOptions &options, FeatureMatcherCache *cache)
SiftMatchingOptions options_
FeatureMatcherCache * cache_
FeaturePairsFeatureMatcher(const FeaturePairsMatchingOptions &options, const SiftMatchingOptions &match_options, const std::string &database_path)
internal::FeatureMatcherData Output
GuidedSiftCPUFeatureMatcher(const SiftMatchingOptions &options, FeatureMatcherCache *cache, JobQueue< Input > *input_queue, JobQueue< Output > *output_queue)
internal::FeatureMatcherData Input
internal::FeatureMatcherData Output
GuidedSiftGPUFeatureMatcher(const SiftMatchingOptions &options, FeatureMatcherCache *cache, JobQueue< Input > *input_queue, JobQueue< Output > *output_queue)
internal::FeatureMatcherData Input
ImagePairsFeatureMatcher(const ImagePairsMatchingOptions &options, const SiftMatchingOptions &match_options, const std::string &database_path)
SequentialFeatureMatcher(const SequentialMatchingOptions &options, const SiftMatchingOptions &match_options, const std::string &database_path)
SiftCPUFeatureMatcher(const SiftMatchingOptions &options, FeatureMatcherCache *cache, JobQueue< Input > *input_queue, JobQueue< Output > *output_queue)
JobQueue< Input > * input_queue_
JobQueue< Output > * output_queue_
internal::FeatureMatcherData Output
internal::FeatureMatcherData Input
SiftFeatureMatcher(const SiftMatchingOptions &options, Database *database, FeatureMatcherCache *cache)
void Match(const std::vector< std::pair< image_t, image_t >> &image_pairs)
void GetDescriptorData(const int index, const image_t image_id, const FeatureDescriptors **descriptors_ptr)
internal::FeatureMatcherData Output
JobQueue< Input > * input_queue_
JobQueue< Output > * output_queue_
std::array< image_t, 2 > prev_uploaded_image_ids_
internal::FeatureMatcherData Input
std::array< FeatureDescriptors, 2 > prev_uploaded_descriptors_
SiftGPUFeatureMatcher(const SiftMatchingOptions &options, FeatureMatcherCache *cache, JobQueue< Input > *input_queue, JobQueue< Output > *output_queue)
std::unique_ptr< OpenGLContextManager > opengl_context_
SpatialFeatureMatcher(const SpatialMatchingOptions &options, const SiftMatchingOptions &match_options, const std::string &database_path)
TransitiveFeatureMatcher(const TransitiveMatchingOptions &options, const SiftMatchingOptions &match_options, const std::string &database_path)
JobQueue< Output > * output_queue_
FeatureMatcherCache * cache_
TwoViewGeometryVerifier(const SiftMatchingOptions &options, FeatureMatcherCache *cache, JobQueue< Input > *input_queue, JobQueue< Output > *output_queue)
JobQueue< Input > * input_queue_
internal::FeatureMatcherData Input
internal::FeatureMatcherData Output
TwoViewGeometry::Options two_view_geometry_options_
const SiftMatchingOptions options_
VocabTreeFeatureMatcher(const VocabTreeMatchingOptions &options, const SiftMatchingOptions &match_options, const std::string &database_path)
static const std::string kDefaultVocabTreeUri
Eigen::Matrix< uint8_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > FeatureDescriptors
std::vector< FeatureKeypoint > FeatureKeypoints
const image_t kInvalidImageId
std::vector< FeatureMatch > FeatureMatches
std::string match_list_path
std::string match_list_path
int loop_detection_num_images
std::string vocab_tree_path
int loop_detection_num_nearest_neighbors
int loop_detection_max_num_features
int loop_detection_num_checks
int loop_detection_num_images_after_verification
int loop_detection_period
int num_images_after_verification
std::string match_list_path
std::string vocab_tree_path
int num_nearest_neighbors
TwoViewGeometry two_view_geometry