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

Function LoadMatchFilePerImage

src/aliceVision/matching/io.cpp:132–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132std::size_t LoadMatchFilePerImage(PairwiseMatches& matches,
133 const std::set<IndexT>& viewsKeys,
134 const std::string& folder,
135 const std::string& extension)
136{
137 int nbLoadedMatchFiles = 0;
138// Load one match file per image
139#pragma omp parallel for num_threads(3)
140 for (ptrdiff_t i = 0; i < static_cast<ptrdiff_t>(viewsKeys.size()); ++i)
141 {
142 std::set<IndexT>::const_iterator it = viewsKeys.begin();
143 std::advance(it, i);
144 const IndexT idView = *it;
145 const std::string matchFilename = std::to_string(idView) + "." + extension;
146 PairwiseMatches fileMatches;
147 if (!LoadMatchFile(fileMatches, (fs::path(folder) / matchFilename).string()))
148 {
149#pragma omp critical
150 {
151 ALICEVISION_LOG_DEBUG("Unable to load match file: " << matchFilename << " in: " << folder);
152 }
153 continue;
154 }
155#pragma omp critical
156 {
157 ++nbLoadedMatchFiles;
158 // merge the loaded matches into the output
159 for (const auto& v : fileMatches)
160 {
161 matches[v.first] = v.second;
162 }
163 }
164 }
165 return nbLoadedMatchFiles;
166}
167
168/**
169 * Load and add pair-wise matches to \p matches from all files in \p folder matching \p pattern.

Callers

nothing calls this directly

Calls 4

LoadMatchFileFunction · 0.85
pathClass · 0.85
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected