Ask Your Question

Revision history [back]

4yo post, but facing the same issue.

Sorry, I am not able to understand why - or even if it's correct - for the FLANN KNN matcher to retrieve "lonely points"

A workaround could be to filter the matching "lonely point" :

( found at https://stackoverflow.com/questions/25018423/opencv-python-error-when-using-orb-images-feature-matching )

good = []
for i, m_n in enumerate(matches):
  if len(m_n) != 2:
    continue
  (m,n) = m_n
  if m.distance < 0.7 * n.distance:
    good.append(m)

NB : in your snippet you don't use the indices, so you don't need to enumerate matches