Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There were two bugs in the above code, that i found in the meantime:

  1. When i calculate the vector of feature-descriptors, i do descriptors_vec.push_back(descriptors). However i should write descriptors_vec.push_back(descriptors.clone()), otherwise the reference get's appended and all descriptors in descriptors_vec have the same content.
  2. Having std::vector<std::vector<DMatch>> knn_matches declared outside of the for-loop makes the matcher append to it every time new matches are computed.

Resolving these two issues made the code run as i intended it to. As a bonus the code now runs on all 4 threads all by itself. :-)