Ask Your Question

Revision history [back]

I came here looking for answers on performance with LSH so maybe take this with a grain of salt :P

I'm doing essentially the same thing but with trading cards. Take a picture and lookup against 20,000 images to determine which card it is.

I use ORB and LSH.

This tutorial here is a good starting point but uses SURF http://romovs.github.io/blog/2013/07/05/matching-image-to-a-set-of-images-with-emgu-cv/

The key differences you need to change are SURF detector to ORB detector, and the flannIndex needs to be created with LSHIndexParameters.

The relevant values or the number of descriptors you want to find (used for creation of the ORB detector, default is 500) and LshIndexParameters takes 3 values which I forget off the top of my head what they are.

I'm using Emgu CV C# library for open cv so I did some other alterations to make this work, but most of it was things like changing Matrix<float> to Mat, which you'll probably have to do because ORB uses binary descriptors and they are NOT floats, they are binary.

The concating part is easy with Mats since you can just use Mat.PushBack(Mat) to concat them the way you need.

Performance changes based on the number of descriptors and the lshindexparameter values but I don't understand much on how the indexparameters work (what I came here today to find). The orbdescriptors # you probably want to keep relatively low otherwise you'll be using too much RAM and it'll take a long time to do all the comparisons.

A couple other code corrections from that link are in the comments, and since you are using LSH you should cut out the distance check in theFindMatches method.

Edit:

I'm currently getting matches in under 3 seconds for a rotated/skewed image of a card against 20,000+ images on a laptop. I'm guessing this can be optimized but I'm still very new at this. Just wanted to give you an idea on expectations. Don't know what ballpark you're aiming for.