| 319 | } |
| 320 | |
| 321 | void 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 | |
| 345 | bool computeSimilarityFromCommonCameras_imageFileMatching(const sfmData::SfMData& sfmDataA, |
| 346 | const sfmData::SfMData& sfmDataB, |
no test coverage detected