MCPcopy Create free account
hub / github.com/alicevision/AliceVision / matchViewsByFilePattern

Function matchViewsByFilePattern

src/aliceVision/sfm/utils/alignment.cpp:321–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void matchViewsByFilePattern(const sfmData::SfMData& sfmDataA,
322 const sfmData::SfMData& sfmDataB,
323 const std::string& filePatternMatching,
324 std::vector<std::pair<IndexT, IndexT>>& out_commonViewIds)
325{
326 out_commonViewIds.clear();
327 std::map<std::string, IndexT> filepathValuesA = retrieveMatchingFilepath(sfmDataA, filePatternMatching);
328 std::map<std::string, IndexT> filepathValuesB = retrieveMatchingFilepath(sfmDataB, filePatternMatching);
329
330 using P = std::pair<std::string, IndexT>;
331 std::vector<P> commonMetadataValues;
332 std::set_intersection(filepathValuesA.begin(),
333 filepathValuesA.end(), // already sorted
334 filepathValuesB.begin(),
335 filepathValuesB.end(), // already sorted
336 std::back_inserter(commonMetadataValues),
337 [](const P& p1, const P& p2) { return p1.first < p2.first; });
338
339 for (const P& p : commonMetadataValues)
340 {
341 out_commonViewIds.emplace_back(filepathValuesA.at(p.first), filepathValuesB.at(p.first));
342 }
343}
344
345bool computeSimilarityFromCommonCameras_imageFileMatching(const sfmData::SfMData& sfmDataA,
346 const sfmData::SfMData& sfmDataB,

Calls 4

retrieveMatchingFilepathFunction · 0.85
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected