Commit 1e877b19 authored by Davis King's avatar Davis King

Changed graph construction for chinese_whispers() so that each face is always

included in the edge graph.  If it isn't then the output labels from
chinese_whispers would be missing faces in this degenerate case.  So basically this fixes a bug
where chinese_whispers(), when called from python, would sometimes return a labels array
that doesn't include labels for all the inputs.
parent dc0245af
......@@ -141,7 +141,7 @@ boost::python::list chinese_whispers_clustering(boost::python::list descriptors,
std::vector<unsigned long> labels;
for (size_t i = 0; i < num_descriptors; ++i)
{
for (size_t j = i+1; j < num_descriptors; ++j)
for (size_t j = i; j < num_descriptors; ++j)
{
matrix<double,0,1>& first_descriptor = boost::python::extract<matrix<double,0,1>&>(descriptors[i]);
matrix<double,0,1>& second_descriptor = boost::python::extract<matrix<double,0,1>&>(descriptors[j]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment