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

Function RunModelClusterer

src/colmap/exe/model.cc:480–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480int RunModelClusterer(int argc, char** argv) {
481 std::filesystem::path input_path;
482 std::filesystem::path output_path;
483
484 OptionManager options;
485 options.AddRequiredOption("input_path", &input_path);
486 options.AddRequiredOption("output_path", &output_path);
487 options.AddReconstructionClustererOptions();
488 if (!options.Parse(argc, argv)) {
489 return EXIT_FAILURE;
490 }
491
492 if (!ExistsDir(input_path)) {
493 LOG(ERROR) << "`input_path` is not a directory";
494 return EXIT_FAILURE;
495 }
496
497 if (!ExistsDir(output_path)) {
498 LOG(ERROR) << "`output_path` is not a directory";
499 return EXIT_FAILURE;
500 }
501
502 LOG_HEADING1("Loading model");
503 auto reconstruction = std::make_shared<Reconstruction>();
504 reconstruction->Read(input_path);
505
506 auto reconstruction_manager = std::make_shared<ReconstructionManager>();
507
508 ReconstructionClustererController controller(
509 *options.reconstruction_clusterer,
510 reconstruction,
511 reconstruction_manager);
512 controller.Run();
513
514 LOG_HEADING1("Writing clustered model(s)");
515 reconstruction_manager->Write(output_path);
516
517 return EXIT_SUCCESS;
518}
519
520int RunModelComparer(int argc, char** argv) {
521 std::filesystem::path input_path1;

Callers

nothing calls this directly

Calls 7

ExistsDirFunction · 0.85
AddRequiredOptionMethod · 0.80
ParseMethod · 0.80
ReadMethod · 0.45
RunMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected