7

I am currently testing Flann feature matching with OpenCV in python, and do not fully understand what some of the parameters actually do. Here is a snippet of code copied from the OpenCV docs. The full code can be found here.

# FLANN parameters
FLANN_INDEX_KDTREE = 1
index_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5)
search_params = dict(checks=50)   # or pass empty dictionary

flann = cv2.FlannBasedMatcher(index_params,search_params)

matches = flann.knnMatch(des1,des2,k=2)

I am curious what the inputs algorithm, trees, and checks mean. The default values found in the OpenCV docs are commonly adopted by others code I have read on here, so I am therefore wondering if it is worthwhile to manipulate and test different values or if it recommended to stick with these?

  • What are the key differences between the various index parameter algorithms? Why is FLANN_INDEX_KDTREE the most commonly used?

  • I assume that trees = 5 means that 5 KDTrees are made. What does changing this value mean in practice?

  • The OpenCV docs mention that increasing the value of checks will give better precision but slow down the code. It says: “If you want to change the value, pass search_params = dict(checks=100).” Is it worth exploring values other than 50 or 100 for checks?

And finally, aside from Brute Force Matcher and the Flann algorithms, are there other common feature matching algorithms?

0 Answers0