Search code examples
mysqlimage-processingdata-storagefingerprint

Reverse Image Search Storage in Relational Database


So, this question is similar to what I need, but the answers there don't quite match. I'm looking for a way to take a set of SURF descriptors and store them in a MySQL database so that I can take an image from a user, and run a reverse image search quickly.

What I'm doing now

At the moment, I am taking the list of descriptors given to me by jOpenSurf, running through them, and converting them to two 64 character strings. With this, I can query and find exact matches very easily, but I don't just want exact matches, I would like to do comparison of features.

What (I think) I need to do

After doing a bit of research online and looking at the comparison code provided by jOpenSurf, I think what I need to do is store the vector value of each interest point in the database so that I can compare that. But that is where I'm stuck.

What I need help with

How in the world can I store a vector value into a MySQL database so I can do a comparison for similarity matching on images?


Solution

  • I don't know of anything in mysql that would allow vector comparisons natively - some people have questioned whether the geospatial module would allow this but the consensus was no (e.g. cosine function on vectors).

    You would need to evaluate the similarity scores outside of the database and store them in the database after evaluation (e.g. store the top 5 hits per image in the database). Assuming you are using a symmetric scoring algorithm, you would only need to update the database for at most N images for managing top N similar images for each new image evaluated.

    There is some interesting work using a reverse index database (e.g. search engine) in providing image relevancy searches based on both image features and additional metadata or text if you so choose: http://www.mendeley.com/research/lire-lucene-image-retrieval-an-extensible-java-cbir-library/