Skip to content

Commit 2b1faaa

Browse files
Chris SweeneyChris Sweeney
Chris Sweeney
authored and
Chris Sweeney
committed
Fix minor compiler warnings
1 parent 8d5bb9b commit 2b1faaa

8 files changed

+21
-20
lines changed

src/theia/sfm/bundle_adjustment/bundle_adjust_two_views.cc

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ void SetSolverOptions(const BundleAdjustmentOptions& options,
6161
solver_options->visibility_clustering_type = ceres::CANONICAL_VIEWS;
6262
solver_options->logging_type = ceres::SILENT;
6363
solver_options->num_threads = options.num_threads;
64-
solver_options->num_linear_solver_threads = options.num_threads;
6564
solver_options->max_num_iterations = 200;
6665
// Solver options takes ownership of the ordering so that we can order the BA
6766
// problem by points and cameras.

src/theia/sfm/bundle_adjustment/bundle_adjuster.cc

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ void SetSolverOptions(const BundleAdjustmentOptions& options,
6363
solver_options->logging_type =
6464
options.verbose ? ceres::PER_MINIMIZER_ITERATION : ceres::SILENT;
6565
solver_options->num_threads = options.num_threads;
66-
solver_options->num_linear_solver_threads = options.num_threads;
6766
solver_options->max_num_iterations = options.max_num_iterations;
6867
solver_options->max_solver_time_in_seconds =
6968
options.max_solver_time_in_seconds;

src/theia/sfm/feature_extractor.cc

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ bool FeatureExtractor::ExtractFeatures(
156156
keypoints->clear();
157157
descriptors->clear();
158158
}
159+
return true;
159160
}
160161

161162
bool FeatureExtractor::ExtractFeaturesFromImage(

src/theia/sfm/global_pose_estimation/nonlinear_position_estimator.cc

+16-16
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434

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

37-
#include <ceres/ceres.h>
38-
#include <ceres/rotation.h>
3937
#include <Eigen/Core>
4038
#include <algorithm>
39+
#include <ceres/ceres.h>
40+
#include <ceres/rotation.h>
4141
#include <unordered_map>
4242
#include <unordered_set>
4343
#include <utility>
@@ -134,7 +134,6 @@ bool NonlinearPositionEstimator::EstimatePositions(
134134
// Set the solver options.
135135
ceres::Solver::Summary summary;
136136
solver_options_.num_threads = options_.num_threads;
137-
solver_options_.num_linear_solver_threads = options_.num_threads;
138137
solver_options_.max_num_iterations = options_.max_num_iterations;
139138

140139
// Choose the type of linear solver. For sufficiently large problems, we want
@@ -208,9 +207,10 @@ void NonlinearPositionEstimator::AddCameraToCameraConstraints(
208207
position2->data());
209208
}
210209

211-
VLOG(2) << problem_->NumResidualBlocks() << " camera to camera constraints "
212-
"were added to the position "
213-
"estimation problem.";
210+
VLOG(2) << problem_->NumResidualBlocks()
211+
<< " camera to camera constraints "
212+
"were added to the position "
213+
"estimation problem.";
214214
}
215215

216216
void NonlinearPositionEstimator::AddPointToCameraConstraints(
@@ -233,15 +233,14 @@ void NonlinearPositionEstimator::AddPointToCameraConstraints(
233233
for (const TrackId track_id : tracks_to_add) {
234234
triangulated_points_[track_id] = 100.0 * rng_->RandVector3d();
235235

236-
AddTrackToProblem(track_id,
237-
orientations,
238-
point_to_camera_weight,
239-
positions);
236+
AddTrackToProblem(
237+
track_id, orientations, point_to_camera_weight, positions);
240238
}
241239

242-
VLOG(2) << num_point_to_camera_constraints << " point to camera constriants "
243-
"were added to the position "
244-
"estimation problem.";
240+
VLOG(2) << num_point_to_camera_constraints
241+
<< " point to camera constriants "
242+
"were added to the position "
243+
"estimation problem.";
245244
}
246245

247246
int NonlinearPositionEstimator::FindTracksForProblem(
@@ -269,8 +268,8 @@ int NonlinearPositionEstimator::FindTracksForProblem(
269268
GetTracksSortedByNumViews(reconstruction_, *view, *tracks_to_add);
270269

271270
for (int i = 0;
272-
i < sorted_tracks.size() && tracks_per_camera[position.first] <
273-
options_.min_num_points_per_view;
271+
i < sorted_tracks.size() &&
272+
tracks_per_camera[position.first] < options_.min_num_points_per_view;
274273
i++) {
275274
// Update the number of point to camera constraints for each camera.
276275
tracks_to_add->insert(sorted_tracks[i]);
@@ -320,7 +319,8 @@ std::vector<TrackId> NonlinearPositionEstimator::GetTracksSortedByNumViews(
320319
options_.min_num_points_per_view);
321320
std::partial_sort(views_per_track.begin(),
322321
views_per_track.begin() + num_tracks_to_sort,
323-
views_per_track.end(), CompareViewsPerTrack);
322+
views_per_track.end(),
323+
CompareViewsPerTrack);
324324

325325
for (int i = 0; i < num_tracks_to_sort; i++) {
326326
sorted_tracks[i] = views_per_track[i].first;

src/theia/sfm/global_pose_estimation/position_estimator.h

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ namespace theia {
5353
class PositionEstimator {
5454
public:
5555
PositionEstimator() {}
56+
virtual ~PositionEstimator() {}
5657

5758
// Input the view pairs containing relative poses between matched
5859
// geometrically verified views, as well as the global (absolute) orientations

src/theia/sfm/global_pose_estimation/rotation_estimator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace theia {
5050
class RotationEstimator {
5151
public:
5252
RotationEstimator() {}
53-
53+
virtual ~RotationEstimator() {}
5454
// Input the view pairs containing relative rotations between matched
5555
// geometrically verified views and outputs a rotation estimate for each view.
5656
//

src/theia/sfm/hybrid_reconstruction_estimator.cc

+1
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ bool HybridReconstructionEstimator::InitializeCamerasFromTwoViewInfo(
444444

445445
view1->SetEstimated(true);
446446
view2->SetEstimated(true);
447+
return true;
447448
}
448449

449450
bool HybridReconstructionEstimator::InitializeCamerasWithKnownOrientation(

src/theia/solvers/random_sampler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class RandomSampler : public Sampler {
5454
const int min_num_samples);
5555
~RandomSampler() {}
5656

57-
bool Initialize(const int num_datapoints);
57+
bool Initialize(const int num_datapoints) override;
5858

5959
// Samples the input variable data and fills the vector subset with the
6060
// random samples.

0 commit comments

Comments
 (0)