MCPcopy Create free account
hub / github.com/colmap/colmap / SequentialPairGenerator

Method SequentialPairGenerator

src/colmap/controllers/pairing.cc:422–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422SequentialPairGenerator::SequentialPairGenerator(
423 const SequentialPairingOptions& options,
424 const std::shared_ptr<FeatureMatcherCache>& cache)
425 : options_(options), cache_(THROW_CHECK_NOTNULL(cache)) {
426 THROW_CHECK(options.Check());
427 LOG(INFO) << "Generating sequential image pairs...";
428 image_ids_ = GetOrderedImageIds();
429 image_pairs_.reserve(options_.overlap);
430
431 if (options_.loop_detection) {
432 std::vector<image_t> query_image_ids;
433 for (size_t i = 0; i < image_ids_.size();
434 i += options_.loop_detection_period) {
435 query_image_ids.push_back(image_ids_[i]);
436 }
437 vocab_tree_pair_generator_ = std::make_unique<VocabTreePairGenerator>(
438 options_.VocabTreeOptions(), cache_, query_image_ids);
439 }
440
441 if (options_.expand_rig_images) {
442 const std::vector<frame_t> frame_ids = cache_->GetFrameIds();
443 frame_to_image_ids_.reserve(frame_ids.size());
444 image_to_frame_ids_.reserve(image_ids_.size());
445 for (const frame_t frame_id : frame_ids) {
446 const Frame& frame = cache_->GetFrame(frame_id);
447 auto& frame_image_ids = frame_to_image_ids_[frame_id];
448 for (const data_t& data_id : frame.ImageIds()) {
449 frame_image_ids.push_back(data_id.id);
450 image_to_frame_ids_[data_id.id] = frame_id;
451 }
452 }
453 }
454}
455
456SequentialPairGenerator::SequentialPairGenerator(
457 const SequentialPairingOptions& options,

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.80
VocabTreeOptionsMethod · 0.80
GetFrameIdsMethod · 0.80
ImageIdsMethod · 0.80
CheckMethod · 0.45
CacheSizeMethod · 0.45

Tested by

no test coverage detected