|
|
|
@ -1018,13 +1018,13 @@ void waveCorrect(std::vector<Mat> &rmats, WaveCorrectKind kind) |
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
String matchesGraphAsString(std::vector<String> &pathes, std::vector<MatchesInfo> &pairwise_matches, |
|
|
|
|
float conf_threshold) |
|
|
|
|
String matchesGraphAsString(std::vector<String> &paths, std::vector<MatchesInfo> &pairwise_matches, |
|
|
|
|
float conf_threshold) |
|
|
|
|
{ |
|
|
|
|
std::stringstream str; |
|
|
|
|
str << "graph matches_graph{\n"; |
|
|
|
|
|
|
|
|
|
const int num_images = static_cast<int>(pathes.size()); |
|
|
|
|
const int num_images = static_cast<int>(paths.size()); |
|
|
|
|
std::set<std::pair<int,int> > span_tree_edges; |
|
|
|
|
DisjointSets comps(num_images); |
|
|
|
|
|
|
|
|
@ -1050,12 +1050,12 @@ String matchesGraphAsString(std::vector<String> &pathes, std::vector<MatchesInfo |
|
|
|
|
std::pair<int,int> edge = *itr; |
|
|
|
|
if (span_tree_edges.find(edge) != span_tree_edges.end()) |
|
|
|
|
{ |
|
|
|
|
String name_src = pathes[edge.first]; |
|
|
|
|
String name_src = paths[edge.first]; |
|
|
|
|
size_t prefix_len = name_src.find_last_of("/\\"); |
|
|
|
|
if (prefix_len != String::npos) prefix_len++; else prefix_len = 0; |
|
|
|
|
name_src = name_src.substr(prefix_len, name_src.size() - prefix_len); |
|
|
|
|
|
|
|
|
|
String name_dst = pathes[edge.second]; |
|
|
|
|
String name_dst = paths[edge.second]; |
|
|
|
|
prefix_len = name_dst.find_last_of("/\\"); |
|
|
|
|
if (prefix_len != String::npos) prefix_len++; else prefix_len = 0; |
|
|
|
|
name_dst = name_dst.substr(prefix_len, name_dst.size() - prefix_len); |
|
|
|
@ -1072,7 +1072,7 @@ String matchesGraphAsString(std::vector<String> &pathes, std::vector<MatchesInfo |
|
|
|
|
{ |
|
|
|
|
if (comps.size[comps.findSetByElem((int)i)] == 1) |
|
|
|
|
{ |
|
|
|
|
String name = pathes[i]; |
|
|
|
|
String name = paths[i]; |
|
|
|
|
size_t prefix_len = name.find_last_of("/\\"); |
|
|
|
|
if (prefix_len != String::npos) prefix_len++; else prefix_len = 0; |
|
|
|
|
name = name.substr(prefix_len, name.size() - prefix_len); |
|
|
|
|