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

Function BindCeresTypes

src/pycolmap/estimators/ceres_bindings.cc:13–162  ·  view source on GitHub ↗

Some important ceres bindings for using crucial pycolmap features (e.g. bundle adjustment) without pyceres. Branched from https://github.com/cvg/pyceres/blob/main/_pyceres/core/types.h https://github.com/cvg/pyceres/blob/main/_pyceres/core/solver.h

Source from the content-addressed store, hash-verified

11// https://github.com/cvg/pyceres/blob/main/_pyceres/core/types.h
12// https://github.com/cvg/pyceres/blob/main/_pyceres/core/solver.h
13void BindCeresTypes(py::module& m) {
14 auto ownt = py::enum_<ceres::Ownership>(m, "Ownership", py::module_local())
15 .value("DO_NOT_TAKE_OWNERSHIP",
16 ceres::Ownership::DO_NOT_TAKE_OWNERSHIP)
17 .value("TAKE_OWNERSHIP", ceres::Ownership::TAKE_OWNERSHIP)
18 .export_values();
19 AddStringToEnumConstructor(ownt);
20
21 auto mt =
22 py::enum_<ceres::MinimizerType>(m, "MinimizerType", py::module_local())
23 .value("LINE_SEARCH", ceres::MinimizerType::LINE_SEARCH)
24 .value("TRUST_REGION", ceres::MinimizerType::TRUST_REGION);
25 AddStringToEnumConstructor(mt);
26
27 auto linesearcht =
28 py::enum_<ceres::LineSearchType>(m, "LineSearchType", py::module_local())
29 .value("ARMIJO", ceres::LineSearchType::ARMIJO)
30 .value("WOLFE", ceres::LineSearchType::WOLFE);
31 AddStringToEnumConstructor(linesearcht);
32
33 auto lsdt =
34 py::enum_<ceres::LineSearchDirectionType>(
35 m, "LineSearchDirectionType", py::module_local())
36 .value("BFGS", ceres::LineSearchDirectionType::BFGS)
37 .value("LBFGS", ceres::LineSearchDirectionType::LBFGS)
38 .value("NONLINEAR_CONJUGATE_GRADIENT",
39 ceres::LineSearchDirectionType::NONLINEAR_CONJUGATE_GRADIENT)
40 .value("STEEPEST_DESCENT",
41 ceres::LineSearchDirectionType::STEEPEST_DESCENT);
42 AddStringToEnumConstructor(lsdt);
43
44 auto lsit =
45 py::enum_<ceres::LineSearchInterpolationType>(
46 m, "LineSearchInterpolationType", py::module_local())
47 .value("BISECTION", ceres::LineSearchInterpolationType::BISECTION)
48 .value("CUBIC", ceres::LineSearchInterpolationType::CUBIC)
49 .value("QUADRATIC", ceres::LineSearchInterpolationType::QUADRATIC);
50 AddStringToEnumConstructor(lsit);
51
52 auto ncgt =
53 py::enum_<ceres::NonlinearConjugateGradientType>(
54 m, "NonlinearConjugateGradientType", py::module_local())
55 .value("FLETCHER_REEVES",
56 ceres::NonlinearConjugateGradientType::FLETCHER_REEVES)
57 .value("HESTENES_STIEFEL",
58 ceres::NonlinearConjugateGradientType::HESTENES_STIEFEL)
59 .value("POLAK_RIBIERE",
60 ceres::NonlinearConjugateGradientType::POLAK_RIBIERE);
61 AddStringToEnumConstructor(ncgt);
62
63 auto linsolt =
64 py::enum_<ceres::LinearSolverType>(
65 m, "LinearSolverType", py::module_local())
66 .value("DENSE_NORMAL_CHOLESKY",
67 ceres::LinearSolverType::DENSE_NORMAL_CHOLESKY)
68 .value("DENSE_QR", ceres::LinearSolverType::DENSE_QR)
69 .value("SPARSE_NORMAL_CHOLESKY",
70 ceres::LinearSolverType::SPARSE_NORMAL_CHOLESKY)

Callers 1

BindCeresFunction · 0.85

Calls 1

Tested by

no test coverage detected