title: Algorithm for finding visually similar photos from a database?
body: <p>TinEye, Google and others offer a "reverse image search" -- you can upload a photo and within seconds it will find similar photos.</p>
  
  <p>Is there an open-source version of these algorithms?</p>
  
  <hr>
  
  <p>I know about "SIFT" and other algorithms for finding "visually similar" photos, but they only work for comparing one photo directly to another. i.e., to find similar photos to a given photo is an <code>O(n)</code> operation, to find all visually similar photos would be <code>O(n^2)</code> -- both of which are prohibitively slow.</p>
  
  <p>I need a feature descriptor that is indexable by a [relational] database to reduce the result set to something more manageable.</p>
  
  <p>By "visually similar" I mean <em>very</em> similar. i.e, a photo that has been lightly touched up/recolored in Photoshop, slightly cropped or resized, photos taken in rapid succession of the same scene, or flipped or rotated images.</p>