-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
in sfm_data_filters.cpp, some functions uses union_find maybe wrong. such as bool IsTracksOneCC(const SfM_Data & sfm_data)
they use union_find.union(i, j), then count the number of CC as following:
// Count the number of CC
const std::set<unsigned int> parent_id(uf_tree.m_cc_parent.cbegin(), uf_tree.m_cc_parent.cend());
return parent_id.size() == 1;
but error is showed as below:
#include <iostream>
#include "test_f.h"
#include <openMVG/tracks/union_find.hpp>
using namespace std;
using namespace openMVG;
int main()
{
UnionFind uf;
uf.InitSets(5);
uf.Union(0, 1);
uf.Union(1,2);
uf.Union(3,4);
uf.Union(1,3);
for(int i=0; i<5; ++i)
{
cout << uf.m_cc_parent[i] << " ";
// 0 0 0 0 3
}
}
so, there is a error. we cannot use parent_id.size() to judge whether it is a CC
Reactions are currently unavailable