Add some time logging to bundle_adjuster.cc

Change-Id: I0deec65ec8d612a133748a242fe50d8e154f2704
This commit is contained in:
Sameer Agarwal
2024-09-17 10:27:46 -07:00
parent e1385cc7e7
commit dcce78b8df
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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)
+3 -1
View File
@@ -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));
}