mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Add some time logging to bundle_adjuster.cc
Change-Id: I0deec65ec8d612a133748a242fe50d8e154f2704
This commit is contained in:
@@ -67,7 +67,7 @@ add_executable(robust_curve_fitting robust_curve_fitting.cc)
|
||||
target_link_libraries(robust_curve_fitting PRIVATE absl::log_initialize Ceres::ceres)
|
||||
|
||||
add_executable(simple_bundle_adjuster simple_bundle_adjuster.cc)
|
||||
target_link_libraries(simple_bundle_adjuster PRIVATE absl::log_initialize Ceres::ceres )
|
||||
target_link_libraries(simple_bundle_adjuster PRIVATE absl::log_initialize absl::time Ceres::ceres)
|
||||
|
||||
add_executable(bicubic_interpolation bicubic_interpolation.cc)
|
||||
target_link_libraries(bicubic_interpolation PRIVATE absl::log_initialize Ceres::ceres)
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "absl/log/check.h"
|
||||
#include "absl/log/initialize.h"
|
||||
#include "absl/log/log.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "bal_problem.h"
|
||||
#include "ceres/ceres.h"
|
||||
#include "snavely_reprojection_error.h"
|
||||
@@ -304,6 +305,7 @@ void SetSolverOptionsFromFlags(BALProblem* bal_problem,
|
||||
}
|
||||
|
||||
void BuildProblem(BALProblem* bal_problem, Problem* problem) {
|
||||
const absl::Time start_time = absl::Now();
|
||||
const int point_block_size = bal_problem->point_block_size();
|
||||
const int camera_block_size = bal_problem->camera_block_size();
|
||||
double* points = bal_problem->mutable_points();
|
||||
@@ -344,11 +346,11 @@ void BuildProblem(BALProblem* bal_problem, Problem* problem) {
|
||||
problem->SetManifold(cameras + camera_block_size * i, camera_manifold);
|
||||
}
|
||||
}
|
||||
LOG(INFO) << "Time to build problem: " << absl::Now() - start_time;
|
||||
}
|
||||
|
||||
void SolveProblem(const char* filename) {
|
||||
BALProblem bal_problem(filename, absl::GetFlag(FLAGS_use_quaternions));
|
||||
|
||||
if (!absl::GetFlag(FLAGS_initial_ply).empty()) {
|
||||
bal_problem.WriteToPLYFile(absl::GetFlag(FLAGS_initial_ply));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user