Foreword
Next,i will show you how to use the FLANN Algorithm in Python.
AS usual,let’s see what FLANN algorithm is?
What’s the FLANN?
FLANN is the abbreviation of faster library approximate nearest neighbor.It’s a faster classification algorithm.FLANN is a single-layer network which introduces a non-linear expansion function. The basic idea is to extend the pattern vectors of the original input samples by using a set of linear independent (or orthogonal) functions, and to represent and distinguish the patterns in a higher dimension space. Several independent new input samples are obtained in the enhanced space, and then input them into the single-layer forward network
Library
Since some algorithms after opencv3.4 have already been patented.You’d better reduce the opencv version to before 3.4.
pip install opencv-python 3.2.0.7
pip install opencv-contrib-python 3.3.1.11
Python code
import cv2
# 按照灰度图片读入
img1 = cv2.imread("./8.jpg", cv2.IMREAD_GRAYSCALE)
img2 = cv2.imread(