diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-04-17 18:29:04 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-04-20 17:26:31 +0300 |
commit | 838d452843f2e5fa453ab34b1ba8f3ecdf63f33f (patch) | |
tree | 9516325ea7345517dc7b84b3484f5c9058ddb370 /intern | |
parent | 584f1125486d97a95730cdab16c100d53ec3a861 (diff) |
Libmv: Cleanup, fix indentation
Diffstat (limited to 'intern')
-rw-r--r-- | intern/libmv/libmv/simple_pipeline/bundle.cc | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/intern/libmv/libmv/simple_pipeline/bundle.cc b/intern/libmv/libmv/simple_pipeline/bundle.cc index c6a16966a72..5fcf6900ea5 100644 --- a/intern/libmv/libmv/simple_pipeline/bundle.cc +++ b/intern/libmv/libmv/simple_pipeline/bundle.cc @@ -302,68 +302,68 @@ void EuclideanBundlerPerformEvaluation(const Tracks &tracks, vector<Vec6> *all_cameras_R_t, ceres::Problem *problem, BundleEvaluation *evaluation) { - int max_track = tracks.MaxTrack(); - // Number of camera rotations equals to number of translation, - int num_cameras = all_cameras_R_t->size(); - int num_points = 0; - - vector<EuclideanPoint*> minimized_points; - for (int i = 0; i <= max_track; i++) { - EuclideanPoint *point = reconstruction->PointForTrack(i); - if (point) { - // We need to know whether the track is constant zero weight, - // and it so it wouldn't have parameter block in the problem. - // - // Getting all markers for track is not so bac currently since - // this code is only used by keyframe selection when there are - // not so much tracks and only 2 frames anyway. - vector<Marker> markera_of_track = tracks.MarkersForTrack(i); - for (int j = 0; j < markera_of_track.size(); j++) { - if (markera_of_track.at(j).weight != 0.0) { - minimized_points.push_back(point); - num_points++; - break; - } + int max_track = tracks.MaxTrack(); + // Number of camera rotations equals to number of translation, + int num_cameras = all_cameras_R_t->size(); + int num_points = 0; + + vector<EuclideanPoint*> minimized_points; + for (int i = 0; i <= max_track; i++) { + EuclideanPoint *point = reconstruction->PointForTrack(i); + if (point) { + // We need to know whether the track is constant zero weight, + // and it so it wouldn't have parameter block in the problem. + // + // Getting all markers for track is not so bac currently since + // this code is only used by keyframe selection when there are + // not so much tracks and only 2 frames anyway. + vector<Marker> markera_of_track = tracks.MarkersForTrack(i); + for (int j = 0; j < markera_of_track.size(); j++) { + if (markera_of_track.at(j).weight != 0.0) { + minimized_points.push_back(point); + num_points++; + break; } } } + } - LG << "Number of cameras " << num_cameras; - LG << "Number of points " << num_points; + LG << "Number of cameras " << num_cameras; + LG << "Number of points " << num_points; - evaluation->num_cameras = num_cameras; - evaluation->num_points = num_points; + evaluation->num_cameras = num_cameras; + evaluation->num_points = num_points; - if (evaluation->evaluate_jacobian) { // Evaluate jacobian matrix. - ceres::CRSMatrix evaluated_jacobian; - ceres::Problem::EvaluateOptions eval_options; + if (evaluation->evaluate_jacobian) { // Evaluate jacobian matrix. + ceres::CRSMatrix evaluated_jacobian; + ceres::Problem::EvaluateOptions eval_options; - // Cameras goes first in the ordering. - int max_image = tracks.MaxImage(); - for (int i = 0; i <= max_image; i++) { - const EuclideanCamera *camera = reconstruction->CameraForImage(i); - if (camera) { - double *current_camera_R_t = &(*all_cameras_R_t)[i](0); + // Cameras goes first in the ordering. + int max_image = tracks.MaxImage(); + for (int i = 0; i <= max_image; i++) { + const EuclideanCamera *camera = reconstruction->CameraForImage(i); + if (camera) { + double *current_camera_R_t = &(*all_cameras_R_t)[i](0); - // All cameras are variable now. - problem->SetParameterBlockVariable(current_camera_R_t); + // All cameras are variable now. + problem->SetParameterBlockVariable(current_camera_R_t); - eval_options.parameter_blocks.push_back(current_camera_R_t); - } + eval_options.parameter_blocks.push_back(current_camera_R_t); } + } - // Points goes at the end of ordering, - for (int i = 0; i < minimized_points.size(); i++) { - EuclideanPoint *point = minimized_points.at(i); - eval_options.parameter_blocks.push_back(&point->X(0)); - } + // Points goes at the end of ordering, + for (int i = 0; i < minimized_points.size(); i++) { + EuclideanPoint *point = minimized_points.at(i); + eval_options.parameter_blocks.push_back(&point->X(0)); + } - problem->Evaluate(eval_options, - NULL, NULL, NULL, - &evaluated_jacobian); + problem->Evaluate(eval_options, + NULL, NULL, NULL, + &evaluated_jacobian); - CRSMatrixToEigenMatrix(evaluated_jacobian, &evaluation->jacobian); - } + CRSMatrixToEigenMatrix(evaluated_jacobian, &evaluation->jacobian); + } } // This is an utility function to only bundle 3D position of |