Questions tagged [flann]

FLANN – the Fast Library for Approximate Nearest Neighbors – is a collection of nearest-neighbor algorithms, and a meta-algorithm to select the best of them for a given dataset.

FLANN is a library for performing fast approximate nearest-neighbor searches in high dimensional spaces.

FLANN was written by Marius Muja and David G. Lowe. It consists of:

  1. A collection of algorithms, each of which was found by the authors to work best across a range of nearest-neighbor-search use-cases, and
  2. A meta-algorithm that, for a given dataset, selects the best algorithm and the optimal parameters.

A common use of FLANN is in the detection of homography across images in applications – FLANN finds the nearest neighbors among sets of features extracted from the images in question. This visualization illustrates FLANN matches found amongst two sets of feature keypoint data:

FLANN keypoint matches

FLANN is written in and contains bindings for the following languages: , and .

Useful links:

162 questions
16
votes
3 answers

FLANN error in OpenCV 3

I am running Ubuntu 14.04. I am trying to run FLANN with openCV 3 but I get an error. Everything bellow was tried by using AKAZE and ORB but the code if from my attempt to use ORB. I use ORB to find the descriptors and key-points. Ptr
Metalzero2
  • 531
  • 2
  • 6
  • 17
11
votes
3 answers

OpenCV feature matching for multiple images

How can I optimise the SIFT feature matching for many pictures using FLANN? I have a working example taken from the Python OpenCV docs. However this is comparing one image with another and it's slow. I need it to search for features matching in a…
Jafu
  • 470
  • 2
  • 6
  • 19
10
votes
3 answers

OpenCV - Use FLANN with ORB descriptors to match features

I am using OpenCV 3.2 I am trying to use FLANN to match features descriptors in a faster way than brute force. // Ratio to the second neighbor to consider a good match. #define RATIO 0.75 void matchFeatures(const cv::Mat &query, const cv::Mat…
Santiago Gil
  • 1,292
  • 7
  • 21
  • 52
9
votes
2 answers

How to remove false matches from FLANNBASED Matcher in OPENCV?

[Request you to read question details before marking it duplicate or down-voting it. I have searched thoroughly and couldn't find a solution and hence posting the question here.] I am trying to compare one image with multiple images and get a list…
milan m
  • 2,164
  • 3
  • 26
  • 40
9
votes
1 answer

OpenCV templates in 2D point data set

I was wandering what the best approach would be for detecting 'figures' in an array of 2D points. In this example I have two 'templates'. Figure 1 is a template and figure 2 is a template. Each of these templates exists only as a vector of points…
Wim Vanhenden
  • 841
  • 2
  • 12
  • 18
8
votes
1 answer

How do I use the relationships between Flann matches to determine a sensible homography?

I have a panorama image, and a smaller image of buildings seen within that panorama image. What I want to do is recognise if the buildings in that smaller image are in that panorama image, and how the 2 images line up. For this first example, I'm…
Andrew
  • 7,693
  • 11
  • 43
  • 81
8
votes
1 answer

How to use opencv feature matching for detecting copy-move forgery

In my opencv project, I want to detect copy-move forgery in an image. I know how to use the opencv FLANN for feature matching in 2 different image, but I am become so confused on how to use FLANN for detection copy-move forgery in an image. P.S1: I…
Mohamad MohamadPoor
  • 1,350
  • 2
  • 14
  • 35
8
votes
2 answers

Recognizing an image from a list with OpenCV SIFT using the FLANN matching

The point of the application is to recognize an image from an already set list of images. The list of images have had their SIFT descriptors extracted and saved in files. Nothing interesting here: std::vector
octafbr
  • 136
  • 1
  • 4
8
votes
3 answers

OpenCV Python : No drawMatchesknn function

When I tried to use drawMatchesKnn function as mentioned in this tutorial for FLANN feature matching, I get the following error AttributeError: 'module' object has no attribute 'drawMatchesKnn' I checked with other resources that drawMatchesKnn…
rohangulati
  • 251
  • 1
  • 4
  • 12
7
votes
0 answers

Meaning of algorithm, trees, and checks during Flann based feature matching (OpenCV, python)

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…
7
votes
1 answer

What values does the algorithm parametre take in OpenCV's FlannBasedMatcher constructor?

In python, OpenCV's FlannBasedMatcher constructor takes a dictionary of parametres, the first of which is algorithm. The python tutorial suggests that one can specify different values of algorithm by passing differently named variables, e.g.…
oulenz
  • 1,199
  • 1
  • 15
  • 24
6
votes
2 answers

OpenCV 3.2 NameError: global name 'FLANN_INDEX_LSH' is not defined

I am currently trying to implement ORB with FLANN, I have read the documentation and it said that when using ORB with FLANN I have to use: index_params= dict(algorithm = FLANN_INDEX_LSH, table_number = 6, # 12 …
Arwego
  • 155
  • 3
  • 12
6
votes
0 answers

OpenCV : Running FLANN on a cluster

I am trying to scale the "matching_to_many_images.cpp" for large set of images. (20K+ images) https://github.com/kipr/opencv/blob/master/samples/cpp/matching_to_many_images.cpp I use FLANN based matcher to match the images(with SURF keypoint and…
5
votes
2 answers

OpenCV error while feature matching with FLANN

I have a piece of code for matching features between a movie clip and a reference image. It generally works well, but sometimes it throws an error in the middle of a clip. Since it's always in the same clips, and at the same time, I guess there is…
Pixeluz
  • 237
  • 2
  • 12
5
votes
1 answer

Feature matching with flann in opencv

I am working on an image search project for which i have defined/extracted the key point features using my own algorithm. Initially i extracted only single feature and tried to match using cv2.FlannBasedMatcher() and it worked fine which i have…
flamelite
  • 2,654
  • 3
  • 22
  • 42
1
2 3
10 11