Skip to content

Commit

Permalink
Fix minor compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Sweeney authored and Chris Sweeney committed Oct 1, 2018
1 parent 8d5bb9b commit 2b1faaa
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/theia/sfm/bundle_adjustment/bundle_adjuster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/theia/sfm/feature_extractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ bool FeatureExtractor::ExtractFeatures(
keypoints->clear();
descriptors->clear();
}
return true;
}

bool FeatureExtractor::ExtractFeaturesFromImage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

#include "theia/sfm/global_pose_estimation/nonlinear_position_estimator.h"

#include <ceres/ceres.h>
#include <ceres/rotation.h>
#include <Eigen/Core>
#include <algorithm>
#include <ceres/ceres.h>
#include <ceres/rotation.h>
#include <unordered_map>
#include <unordered_set>
#include <utility>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -320,7 +319,8 @@ std::vector<TrackId> 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;
Expand Down
1 change: 1 addition & 0 deletions src/theia/sfm/global_pose_estimation/position_estimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/theia/sfm/global_pose_estimation/rotation_estimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
1 change: 1 addition & 0 deletions src/theia/sfm/hybrid_reconstruction_estimator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ bool HybridReconstructionEstimator::InitializeCamerasFromTwoViewInfo(

view1->SetEstimated(true);
view2->SetEstimated(true);
return true;
}

bool HybridReconstructionEstimator::InitializeCamerasWithKnownOrientation(
Expand Down
2 changes: 1 addition & 1 deletion src/theia/solvers/random_sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2b1faaa

Please sign in to comment.