ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
hierarchical_mapper.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
11 #include "base/scene_clustering.h"
13 #include "util/threading.h"
14 
15 namespace colmap {
16 
17 // Hierarchical mapping first hierarchically partitions the scene into multiple
18 // overlapping clusters, then reconstructs them separately using incremental
19 // mapping, and finally merges them all into a globally consistent
20 // reconstruction. This is especially useful for larger-scale scenes, since
21 // incremental mapping becomes slow with an increasing number of images.
23 public:
24  struct Options {
25  // The path to the image folder which are used as input.
26  std::string image_path;
27 
28  // The path to the database file which is used as input.
29  std::string database_path;
30 
31  // The maximum number of trials to initialize a cluster.
32  int init_num_trials = 10;
33 
34  // The number of workers used to reconstruct clusters in parallel.
35  int num_workers = -1;
36 
37  bool Check() const;
38  };
39 
41  const Options& options,
42  const SceneClustering::Options& clustering_options,
43  const IncrementalMapperOptions& mapper_options,
44  ReconstructionManager* reconstruction_manager);
45 
46 private:
47  void Run() override;
48 
49  const Options options_;
50  const SceneClustering::Options clustering_options_;
51  const IncrementalMapperOptions mapper_options_;
52  ReconstructionManager* reconstruction_manager_;
53 };
54 
55 } // namespace colmap
HierarchicalMapperController(const Options &options, const SceneClustering::Options &clustering_options, const IncrementalMapperOptions &mapper_options, ReconstructionManager *reconstruction_manager)