Skip to content

Commit

Permalink
[pipeline] Reuse savePairsToFile() in imageMatching
Browse files Browse the repository at this point in the history
  • Loading branch information
p12tic committed Oct 11, 2022
1 parent ec9c01f commit ab47199
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 26 deletions.
14 changes: 0 additions & 14 deletions src/aliceVision/imageMatching/ImageMatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ std::ostream& operator<<(std::ostream& os, const PairList& pl)
return os;
}

std::ostream& operator<<(std::ostream& os, const OrderedPairList & pl)
{
for(OrderedPairList::const_iterator plIter = pl.begin(); plIter != pl.end(); ++plIter)
{
os << plIter->first;
for(ImageID id : plIter->second)
{
os << " " << id;
}
os << "\n";
}
return os;
}

std::string EImageMatchingMethod_enumToString(EImageMatchingMethod m)
{
switch(m)
Expand Down
8 changes: 0 additions & 8 deletions src/aliceVision/imageMatching/ImageMatching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ using OrderedPairList = std::map<ImageID, OrderedListOfImageID>;
*/
std::ostream& operator<<(std::ostream& os, const PairList& pl);

/**
* @brief Function that prints a OrderedPairList
* @param os The stream on which to print
* @param pl The pair list
* @return the stream
*/
std::ostream& operator<<(std::ostream& os, const OrderedPairList & pl);

/**
* @brief Mode to select the type of image matching
*/
Expand Down
1 change: 1 addition & 0 deletions src/software/pipeline/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ if(ALICEVISION_BUILD_SFM)
FOLDER ${FOLDER_SOFTWARE_PIPELINE}
LINKS aliceVision_system
aliceVision_imageMatching
aliceVision_matchingImageCollection
aliceVision_sfm
aliceVision_sfmData
aliceVision_sfmDataIO
Expand Down
12 changes: 8 additions & 4 deletions src/software/pipeline/main_imageMatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <aliceVision/sfmData/SfMData.hpp>
#include <aliceVision/sfmDataIO/sfmDataIO.hpp>
#include <aliceVision/matchingImageCollection/ImagePairListIO.hpp>
#include <aliceVision/imageMatching/ImageMatching.hpp>
#include <aliceVision/voctree/descriptorLoader.hpp>
#include <aliceVision/sfm/FrustumFilter.hpp>
Expand Down Expand Up @@ -300,10 +301,13 @@ int aliceVision_main(int argc, char** argv)
}

// write it to file
std::ofstream fileout;
fileout.open(outputFile, std::ofstream::out);
fileout << selectedPairs;
fileout.close();
PairSet selectedPairsSet;
for (const auto& imagePairs : selectedPairs) {
for (const auto& index : imagePairs.second) {
selectedPairsSet.emplace(imagePairs.first, index);
}
}
savePairsToFile(outputFile, selectedPairsSet);

ALICEVISION_LOG_INFO("pairList exported in: " << outputFile);

Expand Down

0 comments on commit ab47199

Please sign in to comment.