From 2b1faaacf89e332aa7a9a3d64d3833d315a0735c Mon Sep 17 00:00:00 2001 From: Chris Sweeney Date: Sat, 29 Sep 2018 01:14:18 -0700 Subject: [PATCH] Fix minor compiler warnings --- .../bundle_adjust_two_views.cc | 1 - .../sfm/bundle_adjustment/bundle_adjuster.cc | 1 - src/theia/sfm/feature_extractor.cc | 1 + .../nonlinear_position_estimator.cc | 32 +++++++++---------- .../position_estimator.h | 1 + .../rotation_estimator.h | 2 +- .../sfm/hybrid_reconstruction_estimator.cc | 1 + src/theia/solvers/random_sampler.h | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc index 6b9be4812..aab0cfbcc 100644 --- a/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc +++ b/src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc @@ -61,7 +61,6 @@ void SetSolverOptions(const BundleAdjustmentOptions& options, solver_options->visibility_clustering_type = ceres::CANONICAL_VIEWS; solver_options->logging_type = ceres::SILENT; solver_options->num_threads = options.num_threads; - solver_options->num_linear_solver_threads = options.num_threads; solver_options->max_num_iterations = 200; // Solver options takes ownership of the ordering so that we can order the BA // problem by points and cameras. diff --git a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc index f7ce918a2..27a2efdc7 100644 --- a/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc +++ b/src/theia/sfm/bundle_adjustment/bundle_adjuster.cc @@ -63,7 +63,6 @@ void SetSolverOptions(const BundleAdjustmentOptions& options, solver_options->logging_type = options.verbose ? ceres::PER_MINIMIZER_ITERATION : ceres::SILENT; solver_options->num_threads = options.num_threads; - solver_options->num_linear_solver_threads = options.num_threads; solver_options->max_num_iterations = options.max_num_iterations; solver_options->max_solver_time_in_seconds = options.max_solver_time_in_seconds; diff --git a/src/theia/sfm/feature_extractor.cc b/src/theia/sfm/feature_extractor.cc index 2334d2601..2f49da93e 100644 --- a/src/theia/sfm/feature_extractor.cc +++ b/src/theia/sfm/feature_extractor.cc @@ -156,6 +156,7 @@ bool FeatureExtractor::ExtractFeatures( keypoints->clear(); descriptors->clear(); } + return true; } bool FeatureExtractor::ExtractFeaturesFromImage( diff --git a/src/theia/sfm/global_pose_estimation/nonlinear_position_estimator.cc b/src/theia/sfm/global_pose_estimation/nonlinear_position_estimator.cc index 8e4c4545e..05f1960ac 100644 --- a/src/theia/sfm/global_pose_estimation/nonlinear_position_estimator.cc +++ b/src/theia/sfm/global_pose_estimation/nonlinear_position_estimator.cc @@ -34,10 +34,10 @@ #include "theia/sfm/global_pose_estimation/nonlinear_position_estimator.h" -#include -#include #include #include +#include +#include #include #include #include @@ -134,7 +134,6 @@ bool NonlinearPositionEstimator::EstimatePositions( // Set the solver options. ceres::Solver::Summary summary; solver_options_.num_threads = options_.num_threads; - solver_options_.num_linear_solver_threads = options_.num_threads; solver_options_.max_num_iterations = options_.max_num_iterations; // Choose the type of linear solver. For sufficiently large problems, we want @@ -208,9 +207,10 @@ void NonlinearPositionEstimator::AddCameraToCameraConstraints( position2->data()); } - VLOG(2) << problem_->NumResidualBlocks() << " camera to camera constraints " - "were added to the position " - "estimation problem."; + VLOG(2) << problem_->NumResidualBlocks() + << " camera to camera constraints " + "were added to the position " + "estimation problem."; } void NonlinearPositionEstimator::AddPointToCameraConstraints( @@ -233,15 +233,14 @@ void NonlinearPositionEstimator::AddPointToCameraConstraints( for (const TrackId track_id : tracks_to_add) { triangulated_points_[track_id] = 100.0 * rng_->RandVector3d(); - AddTrackToProblem(track_id, - orientations, - point_to_camera_weight, - positions); + AddTrackToProblem( + track_id, orientations, point_to_camera_weight, positions); } - VLOG(2) << num_point_to_camera_constraints << " point to camera constriants " - "were added to the position " - "estimation problem."; + VLOG(2) << num_point_to_camera_constraints + << " point to camera constriants " + "were added to the position " + "estimation problem."; } int NonlinearPositionEstimator::FindTracksForProblem( @@ -269,8 +268,8 @@ int NonlinearPositionEstimator::FindTracksForProblem( GetTracksSortedByNumViews(reconstruction_, *view, *tracks_to_add); for (int i = 0; - i < sorted_tracks.size() && tracks_per_camera[position.first] < - options_.min_num_points_per_view; + i < sorted_tracks.size() && + tracks_per_camera[position.first] < options_.min_num_points_per_view; i++) { // Update the number of point to camera constraints for each camera. tracks_to_add->insert(sorted_tracks[i]); @@ -320,7 +319,8 @@ std::vector NonlinearPositionEstimator::GetTracksSortedByNumViews( options_.min_num_points_per_view); std::partial_sort(views_per_track.begin(), views_per_track.begin() + num_tracks_to_sort, - views_per_track.end(), CompareViewsPerTrack); + views_per_track.end(), + CompareViewsPerTrack); for (int i = 0; i < num_tracks_to_sort; i++) { sorted_tracks[i] = views_per_track[i].first; diff --git a/src/theia/sfm/global_pose_estimation/position_estimator.h b/src/theia/sfm/global_pose_estimation/position_estimator.h index 5534aba20..48f79bc13 100644 --- a/src/theia/sfm/global_pose_estimation/position_estimator.h +++ b/src/theia/sfm/global_pose_estimation/position_estimator.h @@ -53,6 +53,7 @@ namespace theia { class PositionEstimator { public: PositionEstimator() {} + virtual ~PositionEstimator() {} // Input the view pairs containing relative poses between matched // geometrically verified views, as well as the global (absolute) orientations diff --git a/src/theia/sfm/global_pose_estimation/rotation_estimator.h b/src/theia/sfm/global_pose_estimation/rotation_estimator.h index b4fc6176a..cef9dd7ae 100644 --- a/src/theia/sfm/global_pose_estimation/rotation_estimator.h +++ b/src/theia/sfm/global_pose_estimation/rotation_estimator.h @@ -50,7 +50,7 @@ namespace theia { class RotationEstimator { public: RotationEstimator() {} - + virtual ~RotationEstimator() {} // Input the view pairs containing relative rotations between matched // geometrically verified views and outputs a rotation estimate for each view. // diff --git a/src/theia/sfm/hybrid_reconstruction_estimator.cc b/src/theia/sfm/hybrid_reconstruction_estimator.cc index 578f8cb36..b196c2a0c 100644 --- a/src/theia/sfm/hybrid_reconstruction_estimator.cc +++ b/src/theia/sfm/hybrid_reconstruction_estimator.cc @@ -444,6 +444,7 @@ bool HybridReconstructionEstimator::InitializeCamerasFromTwoViewInfo( view1->SetEstimated(true); view2->SetEstimated(true); + return true; } bool HybridReconstructionEstimator::InitializeCamerasWithKnownOrientation( diff --git a/src/theia/solvers/random_sampler.h b/src/theia/solvers/random_sampler.h index aa688819a..1e9a5f5ba 100644 --- a/src/theia/solvers/random_sampler.h +++ b/src/theia/solvers/random_sampler.h @@ -54,7 +54,7 @@ class RandomSampler : public Sampler { const int min_num_samples); ~RandomSampler() {} - bool Initialize(const int num_datapoints); + bool Initialize(const int num_datapoints) override; // Samples the input variable data and fills the vector subset with the // random samples.