ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
feature.cpp
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 
9 
10 #include "pipelines/feature.h"
11 #include "pybind/docstring.h"
13 
14 namespace cloudViewer {
15 namespace reconstruction {
16 namespace feature {
17 
18 // Reconstruction feature functions have similar arguments, sharing arg
19 // docstrings
20 static const std::unordered_map<std::string, std::string>
22  {"database_path",
23  "Path to database in which to store the extracted data"},
24  {"image_path",
25  "Root path to folder which contains the images."},
26  {"image_list_path", "The images list file path with ."},
27  {"import_path",
28  "Optional list of images to read. "
29  "The list must contain the relative path of the images with "
30  "respect to the image_path"},
31  {"camera_mode",
32  "The camera mode like { AUTO = 0, SINGLE = 1, PER_FOLDER = 2, "
33  "PER_IMAGE = 3 }"},
34  {"match_list_path", "The matches list directories"},
35  {"match_type",
36  "The match type supported {'pairs', 'raw', 'inliers'}"}};
37 
38 void pybind_feature_methods(py::module &m) {
39  m.def("extract_feature", &ExtractFeature,
40  py::call_guard<py::gil_scoped_release>(),
41  "Function for the extraction of images feature", "database_path"_a,
42  "image_path"_a, "image_list_path"_a = "", "camera_mode"_a = 0,
43  "image_reader_options"_a = colmap::ImageReaderOptions(),
44  "sift_extraction_options"_a = colmap::SiftExtractionOptions());
45  docstring::FunctionDocInject(m, "extract_feature",
47 
48  m.def("import_feature", &ImportFeature,
49  py::call_guard<py::gil_scoped_release>(),
50  "Function for the importation of images feature", "database_path"_a,
51  "image_path"_a, "import_path"_a, "image_list_path"_a = "",
52  "camera_mode"_a = 0,
53  "image_reader_options"_a = colmap::ImageReaderOptions(),
54  "sift_extraction_options"_a = colmap::SiftExtractionOptions());
55  docstring::FunctionDocInject(m, "import_feature",
57 
58  m.def("import_matches", &ImportMatches,
59  py::call_guard<py::gil_scoped_release>(),
60  "Function for the importation of image matches", "database_path"_a,
61  "match_list_path"_a, "match_type"_a = "pairs",
62  "sift_matching_options"_a = colmap::SiftMatchingOptions());
63  docstring::FunctionDocInject(m, "import_matches",
65 
66  m.def("exhaustive_match", &ExhaustiveMatch,
67  py::call_guard<py::gil_scoped_release>(),
68  "Function for exhaustive image matches", "database_path"_a,
69  "sift_matching_options"_a = colmap::SiftMatchingOptions(),
70  "exhaustive_matching_options"_a =
71  colmap::ExhaustiveMatchingOptions());
72  docstring::FunctionDocInject(m, "exhaustive_match",
74 
75  m.def("sequential_match", &SequentialMatch,
76  py::call_guard<py::gil_scoped_release>(),
77  "Function for sequential image matches", "database_path"_a,
78  "sift_matching_options"_a = colmap::SiftMatchingOptions(),
79  "sequential_matching_options"_a =
80  colmap::SequentialMatchingOptions());
81  docstring::FunctionDocInject(m, "sequential_match",
83 
84  m.def("spatial_match", &SpatialMatch,
85  py::call_guard<py::gil_scoped_release>(),
86  "Function for spatial image matches", "database_path"_a,
87  "sift_matching_options"_a = colmap::SiftMatchingOptions(),
88  "spatial_matching_options"_a = colmap::SpatialMatchingOptions());
89  docstring::FunctionDocInject(m, "spatial_match",
91 
92  m.def("transitive_match", &TransitiveMatch,
93  py::call_guard<py::gil_scoped_release>(),
94  "Function for transitive image matches", "database_path"_a,
95  "sift_matching_options"_a = colmap::SiftMatchingOptions(),
96  "transitive_matching_options"_a =
97  colmap::TransitiveMatchingOptions());
98  docstring::FunctionDocInject(m, "transitive_match",
100 
101  m.def("vocab_tree_match", &VocabTreeMatch,
102  py::call_guard<py::gil_scoped_release>(),
103  "Function for vocab_tree image matches", "database_path"_a,
104  "sift_matching_options"_a = colmap::SiftMatchingOptions(),
105  "vocab_tree_matching_options"_a = colmap::VocabTreeMatchingOptions());
106  docstring::FunctionDocInject(m, "vocab_tree_match",
108 }
109 
110 void pybind_feature(py::module &m) {
111  py::module m_submodule =
112  m.def_submodule("feature", "Reconstruction Images Feature.");
113  pybind_feature_methods(m_submodule);
114 }
115 
116 } // namespace feature
117 } // namespace reconstruction
118 } // namespace cloudViewer
void FunctionDocInject(py::module &pybind_module, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
Definition: docstring.cpp:76
void pybind_feature_methods(py::module &m)
Definition: feature.cpp:38
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
Definition: feature.cpp:21
void pybind_feature(py::module &m)
Definition: feature.cpp:110
Generic file read and write utility for python interface.