MCPcopy Create free account
hub / github.com/ceres-solver/ceres-solver / SolveProblem

Function SolveProblem

examples/bundle_adjuster.cc:348–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348void SolveProblem(const char* filename) {
349 BALProblem bal_problem(filename, CERES_GET_FLAG(FLAGS_use_quaternions));
350
351 if (!CERES_GET_FLAG(FLAGS_initial_ply).empty()) {
352 bal_problem.WriteToPLYFile(CERES_GET_FLAG(FLAGS_initial_ply));
353 }
354
355 Problem problem;
356
357 srand(CERES_GET_FLAG(FLAGS_random_seed));
358 bal_problem.Normalize();
359 bal_problem.Perturb(CERES_GET_FLAG(FLAGS_rotation_sigma),
360 CERES_GET_FLAG(FLAGS_translation_sigma),
361 CERES_GET_FLAG(FLAGS_point_sigma));
362
363 BuildProblem(&bal_problem, &problem);
364 Solver::Options options;
365 SetSolverOptionsFromFlags(&bal_problem, &options);
366 options.gradient_tolerance = 1e-16;
367 options.function_tolerance = 1e-16;
368 options.parameter_tolerance = 1e-16;
369 Solver::Summary summary;
370 Solve(options, &problem, &summary);
371 std::cout << summary.FullReport() << "\n";
372
373 if (!CERES_GET_FLAG(FLAGS_final_ply).empty()) {
374 bal_problem.WriteToPLYFile(CERES_GET_FLAG(FLAGS_final_ply));
375 }
376}
377
378} // namespace
379} // namespace ceres::examples

Callers 1

mainFunction · 0.70

Calls 8

BuildProblemFunction · 0.85
emptyMethod · 0.80
WriteToPLYFileMethod · 0.80
PerturbMethod · 0.80
SolveFunction · 0.70
NormalizeMethod · 0.45
FullReportMethod · 0.45

Tested by

no test coverage detected