cv2.FlannBasedMatcher(index_params, search_params)
In the constructor parameters for the FlannBasedMatcher, there doesn’t appear to be a distance metric to provide: Neither flann::KDTreeIndexParams, flann::SearchParams specify.
Is it possible to provide one?
If not, what metric should be assumed?
does that help?
depending on hamming (binary) or L2 norm, different index types are chosen:
norm = cv.NORM_HAMMING
elif chunks[0] == 'akaze':
detector = cv.AKAZE_create()
norm = cv.NORM_HAMMING
elif chunks[0] == 'brisk':
detector = cv.BRISK_create()
norm = cv.NORM_HAMMING
else:
return None, None
if 'flann' in chunks:
if norm == cv.NORM_L2:
flann_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5)
else:
flann_params= dict(algorithm = FLANN_INDEX_LSH,
table_number = 6, # 12
key_size = 12, # 20
multi_probe_level = 1) #2
matcher = cv.FlannBasedMatcher(flann_params, {}) # bug : need to pass empty dict (#1329)
else:
matcher = cv.BFMatcher(norm)
return detector, matcher
Thanks! What if I wanted, say, L1. Or cosine?