<p>I will provide a general answer, going beyond the scope of OpenCV library.</p>

<hr>

<p>Quoting this <a href="https://dsp.stackexchange.com/questions/10423/why-do-we-use-keypoint-descriptors">answer</a>:</p>

<blockquote>
  <p><strong>descriptors</strong>: they are the way to compare the keypoints. They
  summarize, in vector format (of constant length) some characteristics
  about the keypoints.</p>
</blockquote>

<p>With that said, we can imagine/treat (<em>geometrically</em>) a descriptor as point in a D dimensional space. So in total, all the descriptors are points in a D dimensional space. For example, for <a href="https://www.quora.com/Computer-Vision-What-is-a-GIST-descriptor" rel="nofollow noreferrer">GIST</a>, D = 960.</p>

<p>So actually descriptors <em>describe</em> the image, using less information that the whole image (because when you have 1 billion images, the size matters). They serve as the image's representatives, so we are processing them on behalf of the image (since they are easier/smaller to treat).</p>

<hr>

<p>The problem you are mentioning <strong>is the <a href="https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm" rel="nofollow noreferrer">Nearest Neighbor</a></strong> problem. Notice that an <em>approximate</em> version of this problem can lead to significant speed ups, when D is big (since the curse of dimensionality will make the traditional approaches, such as a <a href="https://en.wikipedia.org/wiki/K-d_tree" rel="nofollow noreferrer">kd-tree</a> very slow, almost linear in N (number of points)).</p>

<p>Algorithms that solve the NN problem, which is a problem of optimization, are usually generic. They may not care if the data are images, molecules, etc., I for example have used my <a href="https://gsamaras.wordpress.com/projects/#geraf" rel="nofollow noreferrer">kd-GeRaF</a> for both. As a result, the <strong>algorithms expect N points in a D dimensional space</strong>, so N descriptors you might want to say.</p>

<p>Check my answer for LSH <a href="https://stackoverflow.com/questions/37271413/heuristics-to-sort-array-of-2d-3d-points-according-their-mutual-distance/37308369#37308369">here</a> (which points to a nice implementation).</p>

<hr>

<p><em>Edit</em>:</p>

<p>LSH expects as input <strong>N</strong> vectors of <strong>D</strong> dimension and given a query vector (in <strong>D</strong>) and a range <strong>R</strong>, will find the vectors that lie within this range from the query vector.</p>

<p>As a result, we can say that every image is represented by just one vector, in <a href="http://sift.jcvi.org/www/chr_coords_example_indels.html" rel="nofollow noreferrer">SIFT</a> format for example.</p>

<p>You see, LSH doesn't actually solve the k-NN problem directly, but it searches within a range (and can give you the k-NNs, if they are withing the range). Read more about R, in the Experiments section, <a href="http://arxiv.org/pdf/1603.09596.pdf" rel="nofollow noreferrer">High-dimensional approximate nearest neighbo</a>. <a href="https://gsamaras.wordpress.com/projects/#geraf" rel="nofollow noreferrer">kd-GeRaF</a> and <a href="http://www.cs.ubc.ca/research/flann/" rel="nofollow noreferrer">FLANN</a> solve directly the k-NN problem.</p>
Locality Sensitivy Hashing in OpenCV for image processing
<p>This is my first image processing application, so please be kind with this filthy peasant.</p>

<p><strong>THE APPLICATION:</strong></p>

<p>I want to implement a fast application (<strong>performance are crucial</strong> even over accuracy) where given a photo (taken by mobile phone) containing a movie poster finds the most similar photo in a given dataset and return a similarity score. The dataset is composed by similar pictures (taken by mobile phone, containing a movie poster). The images can be of different size, resolutions and can be taken from different viewpoints (but there is no rotation, since the posters are supposed to always be right-oriented).</p>

<p><strong>Any suggestion on how to implement such an application is well accepted.</strong></p>

<p><strong>FEATURE DESCRIPTIONS IN OPENCV:</strong></p>

<p>I've never used OpenCV and I've read <a href="http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_table_of_contents_feature2d/py_table_of_contents_feature2d.html" rel="nofollow">this tutorial about Feature Detection and Description</a> by OpenCV.</p>

<p>From what I've understood, these algorithms are supposed to find keypoints (usually corners) and eventually define descriptors (which describe each keypoint and are used for matching two different images). I used "eventually" since some of them (eg FAST) provides only keypoints.</p>

<p><strong>MOST SIMILAR IMAGE PROBLEM AND LSH:</strong></p>

<p>The problems above doesn't solve the problem "given an image, how to find the most similar one in a dataset in a fast way". In order to do that, we can both use the keypoints and descriptors obtained by any of the previous algorithms. The problem stated above seems like a <a href="https://en.wikipedia.org/wiki/Nearest_neighbour_algorithm" rel="nofollow">nearest neighbor problem</a> and <a href="https://en.wikipedia.org/wiki/Locality-sensitive_hashing" rel="nofollow">Locality Sensitive Hashing</a> is a fast and popular solution for find an approximate solution for this problem in high-dimensionality spaces.</p>

<p><strong>THE QUESTION:</strong></p>

<p>What I don't understand is how to use the result of any of the previous algorithms (i.e. keypoints and descriptors) in LSH.</p>

<p>Is there any implementation for this problem?</p>