From 5832c6470c5ae1a9896e19b52752c2fb00006afd Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Mon, 1 Apr 2019 19:08:14 +0200 Subject: [PATCH 1/7] [sfm] fix invalid map iterator dereferencing don't use it->second after erasing it->first from map --- src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp index 25057e7765..bc0dad12e4 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp @@ -140,9 +140,9 @@ bool LocalBundleAdjustmentGraph::removeViewsToTheGraph(const std::set& r auto it = _nodePerViewId.find(viewId); if(it != _nodePerViewId.end()) { - _graph.erase(it->second); // this function erase a node with its incident arcs - _nodePerViewId.erase(it->first); - _viewIdPerNode.erase(it->second); + _graph.erase(it->second); // this function erase a node with its incident arcs + _viewIdPerNode.erase(it->second); + _nodePerViewId.erase(it->first); numRemovedNode++; ALICEVISION_LOG_DEBUG("The view #" << viewId << " has been successfully removed to the distance graph."); From 844a26098e55596b1d44a8471335d83724683207 Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Wed, 3 Apr 2019 11:58:13 +0200 Subject: [PATCH 2/7] [sfm] LocalBA: update internal intrinsic edge ids map after view removal When a view is removed from the graph, remove all ids from `_intrinsicEdgesId` corresponding to the node's incident edges that were erased in the process. --- .../sfm/LocalBundleAdjustmentGraph.cpp | 56 +++++++++++++++++-- .../sfm/LocalBundleAdjustmentGraph.hpp | 2 +- .../ReconstructionEngine_sequentialSfM.cpp | 6 +- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp index bc0dad12e4..b9ee54e5ab 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp @@ -11,6 +11,7 @@ #include #include +#include namespace fs = boost::filesystem; @@ -132,23 +133,66 @@ void LocalBundleAdjustmentGraph::exportIntrinsicsHistory(const std::string& fold os.close(); } -bool LocalBundleAdjustmentGraph::removeViewsToTheGraph(const std::set& removedViewsId) +bool LocalBundleAdjustmentGraph::removeViews(const sfmData::SfMData& sfmData, const std::set& removedViewsId) { std::size_t numRemovedNode = 0; + std::map> removedEdgesByIntrinsic; + for(const IndexT& viewId : removedViewsId) { auto it = _nodePerViewId.find(viewId); - if(it != _nodePerViewId.end()) + if(it == _nodePerViewId.end()) { + ALICEVISION_LOG_WARNING("The view id: " << viewId << " does not exist in the graph, cannot remove it."); + continue; + } + + // keep track of node incident edges that are going to be removed + // in order to update _intrinsicEdgesId accordingly + { + IndexT intrinsicId = sfmData.getView(viewId).getIntrinsicId(); + auto intrinsicIt = _intrinsicEdgesId.find(intrinsicId); + if(intrinsicIt != _intrinsicEdgesId.end()) + { + // store incident edge ids before removal + for(lemon::ListGraph::IncEdgeIt e(_graph, it->second); e != lemon::INVALID; ++e) + { + removedEdgesByIntrinsic[intrinsicId].push_back(_graph.id(lemon::ListGraph::Edge(e))); + } + } + } + _graph.erase(it->second); // this function erase a node with its incident arcs _viewIdPerNode.erase(it->second); _nodePerViewId.erase(it->first); - numRemovedNode++; - ALICEVISION_LOG_DEBUG("The view #" << viewId << " has been successfully removed to the distance graph."); + numRemovedNode++; + ALICEVISION_LOG_DEBUG("The view #" << viewId << " has been successfully removed to the distance graph."); + } + + // remove erased edges from _intrinsicsEdgesId + for(auto& edgesIt : removedEdgesByIntrinsic) + { + const IndexT intrinsicId = edgesIt.first; + std::vector& edgeIds = _intrinsicEdgesId[intrinsicId]; + std::vector& removedEdges = edgesIt.second; + + std::vector newEdgeIds; + // sort before using set_difference + std::sort(edgeIds.begin(), edgeIds.end()); + std::sort(removedEdges.begin(), removedEdges.end()); + + std::set_difference( + edgeIds.begin(), edgeIds.end(), + removedEdges.begin(), removedEdges.end(), + std::back_inserter(newEdgeIds) + ); + std::swap(edgeIds, newEdgeIds); + + if(edgeIds.empty()) + { + _intrinsicEdgesId.erase(intrinsicId); } - else - ALICEVISION_LOG_WARNING("The view id: " << viewId << " does not exist in the graph, cannot remove it."); } return numRemovedNode == removedViewsId.size(); } diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp index a5049cc2f7..fa0598c6d3 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp @@ -149,7 +149,7 @@ class LocalBundleAdjustmentGraph * @param[in] removedViewsId Set of views index to remove * @return true if the number of removed node is equal to the size of \c removedViewsId */ - bool removeViewsToTheGraph(const std::set& removedViewsId); + bool removeViews(const sfmData::SfMData& sfmData, const std::set& removedViewsId); /** * @brief Complete the graph with the newly resected views or all the posed views if the graph is empty. diff --git a/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp b/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp index b172207e30..92cf2f9d20 100644 --- a/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp +++ b/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp @@ -695,9 +695,9 @@ bool ReconstructionEngine_sequentialSfM::bundleAdjustment(std::set& newR if(_params.useLocalBundleAdjustment && !removedViewsIdIteration.empty()) { - // remove removed views to the graph - _localStrategyGraph->removeViewsToTheGraph(removedViewsIdIteration); - ALICEVISION_LOG_DEBUG("Removed views to the local strategy graph: " << removedViewsIdIteration); + // remove views from localBA graph + _localStrategyGraph->removeViews(_sfmData, removedViewsIdIteration); + ALICEVISION_LOG_DEBUG("Removed views from local strategy graph: " << removedViewsIdIteration); } ALICEVISION_LOG_INFO("Bundle adjustment iteration: " << iteration << " took " << std::chrono::duration_cast(std::chrono::steady_clock::now() - chronoItStart).count() << " msec."); From ca951d8e5b98b8c1d20cc6bc15789a12c58e8102 Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Wed, 3 Apr 2019 11:35:42 +0200 Subject: [PATCH 3/7] [sfm] LocalBA: add sanity check assertions when erasing edges from graph --- src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp index b9ee54e5ab..02f3d6a8ad 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp @@ -682,8 +682,11 @@ void LocalBundleAdjustmentGraph::removeIntrinsicEdgesFromTheGraph(IndexT intrins if(_intrinsicEdgesId.count(intrinsicId) == 0) return; for(int edgeId : _intrinsicEdgesId.at(intrinsicId)) - _graph.erase(_graph.fromId(edgeId, lemon::ListGraph::Edge())); - + { + const auto& edge = _graph.edgeFromId(edgeId); + assert(_graph.valid(edge)); + _graph.erase(edge); + } _intrinsicEdgesId.erase(intrinsicId); } @@ -697,7 +700,9 @@ std::size_t LocalBundleAdjustmentGraph::updateRigEdgesToTheGraph(const sfmData:: { for(int edgeId : edgesPerRid.second) { - _graph.erase(_graph.fromId(edgeId, lemon::ListGraph::Edge())); + const auto& edge = _graph.edgeFromId(edgeId); + assert(_graph.valid(edge)); + _graph.erase(edge); } } _rigEdgesId.clear(); From d542a4a5135cbbc97c2714f9ddd91da91346763b Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Wed, 3 Apr 2019 15:15:06 +0200 Subject: [PATCH 4/7] [sfm] LocalBA: avoid connecting new views twice by intrinsic * prepare intrinsic-sharing connections before creating them (ensure uniqueness) * consider intrinsic edges in number of created edges when printing debug log --- .../sfm/LocalBundleAdjustmentGraph.cpp | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp index 02f3d6a8ad..7d71f86faf 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp @@ -296,7 +296,7 @@ void LocalBundleAdjustmentGraph::updateGraphWithNewViews( for(const Pair& edge: newEdges) _graph.addEdge(_nodePerViewId.at(edge.first), _nodePerViewId.at(edge.second)); - addIntrinsicEdgesToTheGraph(sfmData, addedViewsId); + numAddedEdges += addIntrinsicEdgesToTheGraph(sfmData, addedViewsId); } ALICEVISION_LOG_DEBUG("The distances graph has been completed with " << nbAddedNodes<< " nodes & " << numAddedEdges << " edges."); @@ -646,7 +646,7 @@ void LocalBundleAdjustmentGraph::drawGraph(const sfmData::SfMData& sfmData, cons std::size_t LocalBundleAdjustmentGraph::addIntrinsicEdgesToTheGraph(const sfmData::SfMData& sfmData, const std::set& newReconstructedViews) { - std::size_t numAddedEdges = 0; + std::map newIntrinsicEdges; for(IndexT newViewId : newReconstructedViews) // for each new view { @@ -657,24 +657,26 @@ std::size_t LocalBundleAdjustmentGraph::addIntrinsicEdgesToTheGraph(const sfmDat for(const auto& x : _nodePerViewId) // for each reconstructed view in the graph { - if(newViewId == x.first) // do not compare a view with itself - continue; - - const IndexT reconstructedViewIntrinsicId = sfmData.getViews().at(x.first)->getIntrinsicId(); - + const auto& otherViewId = x.first; + // if the new view share the same intrinsic than previously reconstructed views - if(reconstructedViewIntrinsicId == newViewIntrinsicId) + if(newViewId != otherViewId // do not compare a view with itself + && newViewIntrinsicId == sfmData.getViews().at(otherViewId)->getIntrinsicId()) { - const IndexT minId = std::min(x.first, newViewId); - const IndexT maxId = std::max(x.first, newViewId); - - lemon::ListGraph::Edge edge = _graph.addEdge(_nodePerViewId[minId], _nodePerViewId[maxId]); - _intrinsicEdgesId[newViewIntrinsicId].push_back(_graph.id(edge)); - numAddedEdges++; + // register a new intrinsic edge between those views + newIntrinsicEdges[std::minmax(otherViewId, newViewId)] = newViewIntrinsicId; } } } - return numAddedEdges; + + // create registered intrinsic edges in lemon graph + // and update _intrinsicEdgesId accordingly + for(const auto& newEdge : newIntrinsicEdges) + { + lemon::ListGraph::Edge edge = _graph.addEdge(_nodePerViewId[newEdge.first.first], _nodePerViewId[newEdge.first.second]); + _intrinsicEdgesId[newEdge.second].push_back(_graph.id(edge)); + } + return newIntrinsicEdges.size(); } void LocalBundleAdjustmentGraph::removeIntrinsicEdgesFromTheGraph(IndexT intrinsicId) From fa0e8d400e09956868ccb3a3c887a5ba5aceba60 Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Wed, 3 Apr 2019 12:04:41 +0200 Subject: [PATCH 5/7] [sfm] LocalBA: add countNodes/countEdges methods * ease graph introspection for testing/debugging from outside * use in existing localBA test * geometricFiltersUtils: fix build error on windows - remove implicit conversions to float --- .../geometricFilterUtils_test.cpp | 2 +- .../sfm/LocalBundleAdjustmentGraph.cpp | 16 ++++++++++++++++ .../sfm/LocalBundleAdjustmentGraph.hpp | 14 +++++++++++++- src/aliceVision/sfm/bundleAdjustment_test.cpp | 3 +++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/aliceVision/matchingImageCollection/geometricFilterUtils_test.cpp b/src/aliceVision/matchingImageCollection/geometricFilterUtils_test.cpp index b862349bbf..810262cf22 100644 --- a/src/aliceVision/matchingImageCollection/geometricFilterUtils_test.cpp +++ b/src/aliceVision/matchingImageCollection/geometricFilterUtils_test.cpp @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(matchingImageCollection_centerMatrix) BOOST_AUTO_TEST_CASE(matchingImageCollection_similarityEstimation) { // same point should give the identity matrix - const feature::SIOPointFeature feat1 {1.0, 5.0, 1, 0.1}; + const feature::SIOPointFeature feat1 {1.0f, 5.0f, 1.0f, 0.1f}; Mat3 S; matchingImageCollection::computeSimilarity(feat1, feat1, S); diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp index 7d71f86faf..b38e89b274 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp @@ -743,5 +743,21 @@ std::size_t LocalBundleAdjustmentGraph::updateRigEdgesToTheGraph(const sfmData:: return numAddedEdges; } +unsigned int LocalBundleAdjustmentGraph::countNodes() const +{ + unsigned int count = 0; + for(lemon::ListGraph::NodeIt n(_graph); n != lemon::INVALID; ++n) + ++count; + return count; +} + +unsigned int LocalBundleAdjustmentGraph::countEdges() const +{ + unsigned int count = 0; + for(lemon::ListGraph::EdgeIt e(_graph); e != lemon::INVALID; ++e) + ++count; + return count; +} + } // namespace sfm } // namespace aliceVision diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp index fa0598c6d3..d852c42793 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp @@ -200,7 +200,19 @@ class LocalBundleAdjustmentGraph * @return */ std::size_t updateRigEdgesToTheGraph(const sfmData::SfMData& sfmData); - + + /** + * @brief Count and return the number of nodes in the underlying lemon graph. + * @return The number of nodes in the graph. + */ + unsigned int countNodes() const; + + /** + * @brief Count and return the number of edges in the underlying lemon graph. + * @return The number of edges in the graph. + */ + unsigned int countEdges() const; + private: /** diff --git a/src/aliceVision/sfm/bundleAdjustment_test.cpp b/src/aliceVision/sfm/bundleAdjustment_test.cpp index 3d7175f736..24b25cb183 100644 --- a/src/aliceVision/sfm/bundleAdjustment_test.cpp +++ b/src/aliceVision/sfm/bundleAdjustment_test.cpp @@ -208,6 +208,9 @@ BOOST_AUTO_TEST_CASE(LOCAL_BUNDLE_ADJUSTMENT_EffectiveMinimization_Pinhole_Camer // 3. Use the graph-distances to assign a LBA state (Refine, Constant & Ignore) for each parameter (poses, intrinsics & landmarks) localBAGraph->convertDistancesToStates(sfmData); + BOOST_CHECK_EQUAL(localBAGraph->countNodes(), 4); // 4 views => 4 nodes + BOOST_CHECK_EQUAL(localBAGraph->countEdges(), 6); // landmarks connections: 6 edges created (see scheme) + BOOST_CHECK_EQUAL(localBAGraph->getNbPosesPerState(BundleAdjustment::EParameterState::REFINED), 2); // v0 & v1 BOOST_CHECK_EQUAL(localBAGraph->getNbPosesPerState(BundleAdjustment::EParameterState::CONSTANT), 1); // v2 BOOST_CHECK_EQUAL(localBAGraph->getNbPosesPerState(BundleAdjustment::EParameterState::IGNORED), 1); // v3 From 605df1cdc24b2cb8e832596e12b7cdc62e77bcc9 Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Thu, 18 Apr 2019 10:03:59 +0200 Subject: [PATCH 6/7] [sfm] LocalBA: fix constness --- src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp index b38e89b274..5094c2f171 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp @@ -140,7 +140,7 @@ bool LocalBundleAdjustmentGraph::removeViews(const sfmData::SfMData& sfmData, co for(const IndexT& viewId : removedViewsId) { - auto it = _nodePerViewId.find(viewId); + const auto it = _nodePerViewId.find(viewId); if(it == _nodePerViewId.end()) { ALICEVISION_LOG_WARNING("The view id: " << viewId << " does not exist in the graph, cannot remove it."); @@ -150,8 +150,8 @@ bool LocalBundleAdjustmentGraph::removeViews(const sfmData::SfMData& sfmData, co // keep track of node incident edges that are going to be removed // in order to update _intrinsicEdgesId accordingly { - IndexT intrinsicId = sfmData.getView(viewId).getIntrinsicId(); - auto intrinsicIt = _intrinsicEdgesId.find(intrinsicId); + const IndexT intrinsicId = sfmData.getView(viewId).getIntrinsicId(); + const auto intrinsicIt = _intrinsicEdgesId.find(intrinsicId); if(intrinsicIt != _intrinsicEdgesId.end()) { // store incident edge ids before removal @@ -166,7 +166,7 @@ bool LocalBundleAdjustmentGraph::removeViews(const sfmData::SfMData& sfmData, co _viewIdPerNode.erase(it->second); _nodePerViewId.erase(it->first); - numRemovedNode++; + ++numRemovedNode; ALICEVISION_LOG_DEBUG("The view #" << viewId << " has been successfully removed to the distance graph."); } @@ -673,7 +673,7 @@ std::size_t LocalBundleAdjustmentGraph::addIntrinsicEdgesToTheGraph(const sfmDat // and update _intrinsicEdgesId accordingly for(const auto& newEdge : newIntrinsicEdges) { - lemon::ListGraph::Edge edge = _graph.addEdge(_nodePerViewId[newEdge.first.first], _nodePerViewId[newEdge.first.second]); + const lemon::ListGraph::Edge edge = _graph.addEdge(_nodePerViewId[newEdge.first.first], _nodePerViewId[newEdge.first.second]); _intrinsicEdgesId[newEdge.second].push_back(_graph.id(edge)); } return newIntrinsicEdges.size(); @@ -683,7 +683,7 @@ void LocalBundleAdjustmentGraph::removeIntrinsicEdgesFromTheGraph(IndexT intrins { if(_intrinsicEdgesId.count(intrinsicId) == 0) return; - for(int edgeId : _intrinsicEdgesId.at(intrinsicId)) + for(const int edgeId : _intrinsicEdgesId.at(intrinsicId)) { const auto& edge = _graph.edgeFromId(edgeId); assert(_graph.valid(edge)); @@ -700,7 +700,7 @@ std::size_t LocalBundleAdjustmentGraph::updateRigEdgesToTheGraph(const sfmData:: // remove all rig edges for(auto& edgesPerRid: _rigEdgesId) { - for(int edgeId : edgesPerRid.second) + for(const int edgeId : edgesPerRid.second) { const auto& edge = _graph.edgeFromId(edgeId); assert(_graph.valid(edge)); From 8e0ce189619409530355b21b3717678988c40e7d Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Fri, 19 Apr 2019 12:12:07 +0200 Subject: [PATCH 7/7] [sfm] LocalBA: wording and comments --- src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp | 9 ++++++--- src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp | 4 +++- .../sequential/ReconstructionEngine_sequentialSfM.cpp | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp index 5094c2f171..cf1f762531 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.cpp @@ -164,7 +164,7 @@ bool LocalBundleAdjustmentGraph::removeViews(const sfmData::SfMData& sfmData, co _graph.erase(it->second); // this function erase a node with its incident arcs _viewIdPerNode.erase(it->second); - _nodePerViewId.erase(it->first); + _nodePerViewId.erase(it->first); // warning: invalidates the iterator "it", so it can not be used after this line ++numRemovedNode; ALICEVISION_LOG_DEBUG("The view #" << viewId << " has been successfully removed to the distance graph."); @@ -655,12 +655,15 @@ std::size_t LocalBundleAdjustmentGraph::addIntrinsicEdgesToTheGraph(const sfmDat if(isFocalLengthConstant(newViewIntrinsicId)) // do not add edges for a constant intrinsic continue; - for(const auto& x : _nodePerViewId) // for each reconstructed view in the graph + // for each reconstructed view in the graph + // warning: at this point, "_nodePerViewId" already contains the "newReconstructedViews" + for(const auto& x : _nodePerViewId) { const auto& otherViewId = x.first; // if the new view share the same intrinsic than previously reconstructed views - if(newViewId != otherViewId // do not compare a view with itself + // note: do not compare a view with itself (must be tested since "_nodePerViewId" contains "newReconstructedViews") + if(newViewId != otherViewId && newViewIntrinsicId == sfmData.getViews().at(otherViewId)->getIntrinsicId()) { // register a new intrinsic edge between those views diff --git a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp index d852c42793..18dd458536 100644 --- a/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp +++ b/src/aliceVision/sfm/LocalBundleAdjustmentGraph.hpp @@ -145,7 +145,9 @@ class LocalBundleAdjustmentGraph void exportIntrinsicsHistory(const std::string& folder, const std::string& filename); /** - * @brief Remove some views to the graph. It delete the node and all the incident edges for each removed view. + * @brief Remove specific views from the LocalBA graph. + * @details Delete the nodes corresponding to those views and all their incident edges. + * @param[in] sfmData contains all the information about the reconstruction * @param[in] removedViewsId Set of views index to remove * @return true if the number of removed node is equal to the size of \c removedViewsId */ diff --git a/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp b/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp index 92cf2f9d20..caf4b01ecc 100644 --- a/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp +++ b/src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp @@ -697,7 +697,7 @@ bool ReconstructionEngine_sequentialSfM::bundleAdjustment(std::set& newR { // remove views from localBA graph _localStrategyGraph->removeViews(_sfmData, removedViewsIdIteration); - ALICEVISION_LOG_DEBUG("Removed views from local strategy graph: " << removedViewsIdIteration); + ALICEVISION_LOG_DEBUG("Views removed from the local BA graph: " << removedViewsIdIteration); } ALICEVISION_LOG_INFO("Bundle adjustment iteration: " << iteration << " took " << std::chrono::duration_cast(std::chrono::steady_clock::now() - chronoItStart).count() << " msec.");