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

Function BindFeatureMatching

src/pycolmap/feature/matching.cc:69–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67} // namespace
68
69void BindFeatureMatching(py::module& m) {
70 py::enum_<FeatureMatcherType>(m, "FeatureMatcherType")
71 .value("UNDEFINED", FeatureMatcherType::UNDEFINED)
72 .value("SIFT_BRUTEFORCE", FeatureMatcherType::SIFT_BRUTEFORCE)
73 .value("SIFT_LIGHTGLUE", FeatureMatcherType::SIFT_LIGHTGLUE)
74 .value("ALIKED_BRUTEFORCE", FeatureMatcherType::ALIKED_BRUTEFORCE)
75 .value("ALIKED_LIGHTGLUE", FeatureMatcherType::ALIKED_LIGHTGLUE);
76
77#ifdef COLMAP_ONNX_ENABLED
78 auto PyBruteForceONNXMatchingOptions =
79 py::classh<BruteForceONNXMatchingOptions>(m,
80 "BruteForceONNXMatchingOptions")
81 .def(py::init<>())
82 .def_readwrite("min_cossim",
83 &BruteForceONNXMatchingOptions::min_cossim,
84 "Minimum cosine similarity for a match to be "
85 "considered valid.")
86 .def_readwrite("max_ratio",
87 &BruteForceONNXMatchingOptions::max_ratio,
88 "Maximum ratio for Lowe's ratio test.")
89 .def_readwrite("cross_check",
90 &BruteForceONNXMatchingOptions::cross_check,
91 "Enable cross-checking (mutual nearest neighbor).")
92 .def_readwrite("model_path",
93 &BruteForceONNXMatchingOptions::model_path,
94 "Path to the ONNX model file.")
95 .def("check", &BruteForceONNXMatchingOptions::Check);
96 MakeDataclass(PyBruteForceONNXMatchingOptions);
97
98 auto PyLightGlueONNXMatchingOptions =
99 py::classh<LightGlueONNXMatchingOptions>(m,
100 "LightGlueONNXMatchingOptions")
101 .def(py::init<>())
102 .def_readwrite("min_score",
103 &LightGlueONNXMatchingOptions::min_score,
104 "Minimum match score threshold.")
105 .def_readwrite("model_path",
106 &LightGlueONNXMatchingOptions::model_path,
107 "Path to the LightGlue ONNX model file.")
108 .def("check", &LightGlueONNXMatchingOptions::Check);
109 MakeDataclass(PyLightGlueONNXMatchingOptions);
110
111 auto PyAlikedMatchingOptions =
112 py::classh<AlikedMatchingOptions>(m, "AlikedMatchingOptions")
113 .def(py::init<>())
114 .def_readwrite("brute_force",
115 &AlikedMatchingOptions::brute_force,
116 "Brute-force matching options.")
117 .def_readwrite("lightglue",
118 &AlikedMatchingOptions::lightglue,
119 "LightGlue matching options.")
120 .def("check", &AlikedMatchingOptions::Check);
121 MakeDataclass(PyAlikedMatchingOptions);
122#endif
123
124 auto PySiftMatchingOptions =
125 py::classh<SiftMatchingOptions>(m, "SiftMatchingOptions")
126 .def(py::init<>())

Callers 1

BindFeatureFunction · 0.85

Calls 4

MakeDataclassFunction · 0.85
MatchesToMatrixFunction · 0.85
MatchMethod · 0.45
MatchGuidedMethod · 0.45

Tested by

no test coverage detected