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

Method ReconstructSubModel

src/colmap/controllers/incremental_pipeline.cc:474–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474IncrementalPipeline::Status IncrementalPipeline::ReconstructSubModel(
475 IncrementalMapper& mapper,
476 const IncrementalMapper::Options& mapper_options,
477 const std::shared_ptr<Reconstruction>& reconstruction) {
478 mapper.BeginReconstruction(reconstruction);
479
480 if (HasUnknownSensorFromRig(*reconstruction)) {
481 return Status::UNKNOWN_SENSOR_FROM_RIG;
482 }
483
484 ////////////////////////////////////////////////////////////////////////////
485 // Register initial pair
486 ////////////////////////////////////////////////////////////////////////////
487
488 if (reconstruction->NumRegFrames() == 0) {
489 const Status init_status = IncrementalPipeline::InitializeReconstruction(
490 mapper, mapper_options, *reconstruction);
491 if (init_status != Status::SUCCESS) {
492 return init_status;
493 }
494 }
495 Callback(INITIAL_IMAGE_PAIR_REG_CALLBACK);
496
497 ////////////////////////////////////////////////////////////////////////////
498 // Incremental mapping
499 ////////////////////////////////////////////////////////////////////////////
500
501 size_t snapshot_prev_num_reg_frames = reconstruction->NumRegFrames();
502 size_t ba_prev_num_reg_frames = reconstruction->NumRegFrames();
503 size_t ba_prev_num_points = reconstruction->NumPoints3D();
504
505 std::vector<bool> structure_less_flags;
506 if (options_->structure_less_registration_only) {
507 structure_less_flags = {true};
508 } else {
509 if (options_->structure_less_registration_fallback) {
510 structure_less_flags = {false, true};
511 } else {
512 structure_less_flags = {false};
513 }
514 }
515
516 bool reg_next_success = true;
517 bool prev_reg_next_success = true;
518 do {
519 if (CheckIfStopped() || CheckReachedMaxRuntime()) {
520 break;
521 }
522
523 prev_reg_next_success = reg_next_success;
524 reg_next_success = false;
525 image_t next_image_id = kInvalidImageId;
526
527 // Try to register next image. Always prefer structure-based registration
528 // first, and if that fails, try (less reliable) structure-less
529 // registration.
530 for (const bool structure_less : structure_less_flags) {
531 const std::vector<image_t> next_images = mapper.FindNextImages(

Callers

nothing calls this directly

Calls 15

HasUnknownSensorFromRigFunction · 0.85
StringPrintfFunction · 0.85
ExtractColorsFunction · 0.85
WriteSnapshotFunction · 0.85
NumRegFramesMethod · 0.80
sizeMethod · 0.80
NumVisiblePoints3DMethod · 0.80
ObservationManagerMethod · 0.80
NumObservationsMethod · 0.80
NumCorrespondencesMethod · 0.80

Tested by

no test coverage detected