MegviiRobot / MegBA

MegBA: A GPU-Based Distributed Library for Large-Scale Bundle Adjustment
Apache License 2.0
450 stars 61 forks source link

How to access and save the results of the MegBA? #39

Closed ChenMa2017 closed 1 year ago

ChenMa2017 commented 1 year ago

Hi, thanks for your amazing work and open-sourced code. Following the guidance, I tested the MegBA with the Ladybug dataset by running the ./BAL_Double. The speed is super fast. But I did not see any output of the result. In the BAL_Double.cpp, the options have : DEFINE_int32(world_size, 1, "World size"); DEFINE_string(path, "", "Path to your dataset"); DEFINE_int32(max_iter, 20, "LM solve iteration"); DEFINE_int32(solver_max_iter, 50, "Linear solver iteration"); DEFINE_double(solver_tol, 10., "The tolerance of the linear solver"); DEFINE_double(solver_refuse_ratio, 1., "The refuse ratio of the linear solver"); DEFINE_double(tau, 1., "Initial trust region"); DEFINE_double(epsilon1, 1., "Parameter of LM"); DEFINE_double(epsilon2, 1e-10, "Parameter of LM"); They are not related to saving the output. I have a question about how I can access the result. And do you have tutorials about MegBA's APIs?

ChenMa2017 commented 1 year ago

I access the optimized result using the problem.getVertx().getEstimation(); for (int n = 0; n < num_cameras; ++n) { Eigen::Matrix<T, 9, 1> camera_para = problem.getVertex(n).getEstimation(); }