| 1 |
#include "colmap/optim/ransac.h" |
| 2 |
|
| 3 |
#include "pycolmap/helpers.h" |
| 4 |
|
| 5 |
#include <pybind11/pybind11.h> |
| 6 |
|
| 7 |
using namespace colmap; |
| 8 |
namespace py = pybind11; |
| 9 |
|
| 10 |
void BindOptim(py::module& m) { |
| 11 |
auto PyRANSACOptions = |
| 12 |
py::classh<RANSACOptions>(m, "RANSACOptions") |
| 13 |
.def(py::init<>([]() { |
| 14 |
RANSACOptions options; |
| 15 |
options.max_error = 4.0; |
| 16 |
options.min_inlier_ratio = 0.01; |
| 17 |
options.confidence = 0.9999; |
| 18 |
options.min_num_trials = 1000; |
| 19 |
options.max_num_trials = 100000; |
| 20 |
return options; |
| 21 |
})) |
| 22 |
.def_readwrite("max_error", &RANSACOptions::max_error) |
| 23 |
.def_readwrite("min_inlier_ratio", &RANSACOptions::min_inlier_ratio) |
| 24 |
.def_readwrite("confidence", &RANSACOptions::confidence) |
| 25 |
.def_readwrite("dyn_num_trials_multiplier", |
| 26 |
&RANSACOptions::dyn_num_trials_multiplier) |
| 27 |
.def_readwrite("min_num_trials", &RANSACOptions::min_num_trials) |
| 28 |
.def_readwrite("max_num_trials", &RANSACOptions::max_num_trials) |
| 29 |
.def_readwrite("random_seed", &RANSACOptions::random_seed) |
| 30 |
.def_readwrite("num_threads", &RANSACOptions::num_threads) |
| 31 |
.def("check", &RANSACOptions::Check); |
| 32 |
MakeDataclass(PyRANSACOptions); |
| 33 |
} |