Skip to content

Commit

Permalink
Cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Nov 28, 2017
1 parent 3c75123 commit 17018b0
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/openMVG/cameras/Camera_Pinhole_Brown.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ class Pinhole_Intrinsic_Brown_T2 : public Pinhole_Intrinsic
const double k_diff = ( k1 * r2 + k2 * r4 + k3 * r6 );
const double t_x = t2 * ( r2 + 2 * p( 0 ) * p( 0 ) ) + 2 * t1 * p( 0 ) * p( 1 );
const double t_y = t1 * ( r2 + 2 * p( 1 ) * p( 1 ) ) + 2 * t2 * p( 0 ) * p( 1 );
Vec2 d( p( 0 ) * k_diff + t_x, p( 1 ) * k_diff + t_y );
return d;
return { p( 0 ) * k_diff + t_x, p( 1 ) * k_diff + t_y};
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/multiview/translation_averaging_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace openMVG {
/// Relative information [Rij|tij] for a pair
using relativeInfo = std::pair<Pair, std::pair<Mat3,Vec3>>;

using RelativeInfo_Vec = std::vector<relativeInfo >;
using RelativeInfo_Vec = std::vector<relativeInfo>;
using RelativeInfo_Map = std::map<Pair, std::pair<Mat3, Vec3>>;

// List the pairs used by the relative motions
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/robust_estimation/guided_matching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void GuidedMatching_Fundamental_Fast(
{
// According the point:
// - Compute the epipolar line from the epipole
// - compute the range of possible bucket by computing
// - Compute the range of possible bucket by computing
// the epipolar line gauge limitation introduced by the tolerated pixel error

const Vec2 xR = camR ? camR->get_ud_pixel(rRegions.GetRegionPosition(j)) : rRegions.GetRegionPosition(j);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void SfM_Data_Structure_Estimation_From_Known_Poses::match(
#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel
#endif // OPENMVG_USE_OPENMP
for (Pair_Set::const_iterator it = pairs.begin(); it != pairs.end(); ++it)
for (const Pair & pair : pairs)
{
#ifdef OPENMVG_USE_OPENMP
#pragma omp single nowait
Expand All @@ -103,16 +103,21 @@ void SfM_Data_Structure_Estimation_From_Known_Poses::match(
// - by considering geometric error and descriptor distance ratio.
std::vector<IndMatch> vec_corresponding_indexes;

const View * viewL = sfm_data.GetViews().at(it->first).get();
const Pose3 poseL = sfm_data.GetPoseOrDie(viewL);
const Intrinsics::const_iterator iterIntrinsicL = sfm_data.GetIntrinsics().find(viewL->id_intrinsic);
const View * viewR = sfm_data.GetViews().at(it->second).get();
const Pose3 poseR = sfm_data.GetPoseOrDie(viewR);
const Intrinsics::const_iterator iterIntrinsicR = sfm_data.GetIntrinsics().find(viewR->id_intrinsic);
const View
* viewL = sfm_data.GetViews().at(pair.first).get(),
* viewR = sfm_data.GetViews().at(pair.second).get();

const Pose3
poseL = sfm_data.GetPoseOrDie(viewL),
poseR = sfm_data.GetPoseOrDie(viewR);

if (sfm_data.GetIntrinsics().count(viewL->id_intrinsic) != 0 ||
sfm_data.GetIntrinsics().count(viewR->id_intrinsic) != 0)
{
const Intrinsics::const_iterator
iterIntrinsicL = sfm_data.GetIntrinsics().find(viewL->id_intrinsic),
iterIntrinsicR = sfm_data.GetIntrinsics().find(viewR->id_intrinsic);

const Mat34
P_L = iterIntrinsicL->second->get_projective_equivalent(poseL),
P_R = iterIntrinsicR->second->get_projective_equivalent(poseR);
Expand All @@ -121,8 +126,8 @@ void SfM_Data_Structure_Estimation_From_Known_Poses::match(
const double thresholdF = max_reprojection_error_;

const std::shared_ptr<features::Regions>
regionsL = regions_provider->get(it->first),
regionsR = regions_provider->get(it->second);
regionsL = regions_provider->get(pair.first),
regionsR = regions_provider->get(pair.second);

#if defined(EXHAUSTIVE_MATCHING)
geometry_aware::GuidedMatching
Expand Down Expand Up @@ -158,7 +163,7 @@ void SfM_Data_Structure_Estimation_From_Known_Poses::match(
#pragma omp critical
#endif // OPENMVG_USE_OPENMP
{
putatives_matches[*it].insert(putatives_matches[*it].end(),
putatives_matches[pair].insert(putatives_matches[pair].end(),
vec_corresponding_indexes.begin(), vec_corresponding_indexes.end());
}
++my_progress_bar;
Expand Down Expand Up @@ -215,23 +220,23 @@ void SfM_Data_Structure_Estimation_From_Known_Poses::filter(
tracksBuilder.ExportToSTL(map_tracksCommon);
}

std::map<IndexT, std::shared_ptr<openMVG::features::Regions>> regions;
regions[I] = regions_provider->get(I);
regions[J] = regions_provider->get(J);
regions[K] = regions_provider->get(K);
const std::map<IndexT, std::shared_ptr<openMVG::features::Regions>> regions =
{{I, regions_provider->get(I)},
{J, regions_provider->get(J)},
{K, regions_provider->get(K)},
};

// Triangulate the tracks
for (tracks::STLMAPTracks::const_iterator iterTracks = map_tracksCommon.begin();
iterTracks != map_tracksCommon.end(); ++iterTracks)
for (const auto & track_it : map_tracksCommon)
{
const tracks::submapTrack & subTrack = iterTracks->second;
const tracks::submapTrack & subTrack = track_it.second;
std::vector<Vec3> bearing;
std::vector<Mat34> poses;
bearing.reserve(subTrack.size());
poses.reserve(subTrack.size());
for (const auto & track : subTrack) {
const size_t imaIndex = track.first;
const size_t featIndex = track.second;
for (const auto & observation_it : subTrack) {
const size_t imaIndex = observation_it.first;
const size_t featIndex = observation_it.second;
const View * view = sfm_data.GetViews().at(imaIndex).get();
const IntrinsicBase * cam = sfm_data.GetIntrinsics().at(view->id_intrinsic).get();
const Pose3 pose = sfm_data.GetPoseOrDie(view);
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/sfm/sfm_data_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void ApplySimilarity
// Transform the camera position priors
if (sfm::ViewPriors * prior = dynamic_cast<sfm::ViewPriors*>(iterView.second.get()))
{
prior->pose_center_ = sim(prior->pose_center_);
prior->pose_center_ = sim(prior->pose_center_);
}
}

Expand Down

0 comments on commit 17018b0

Please sign in to comment.