Ask Your Question

atrius.fox's profile - activity

2016-05-20 12:53:28 -0600 commented answer Locality Sensitivy Hashing in OpenCV for image processing

Not arguing about C# performance. That was more just a matter of 'how to do this using opencv' and this example used C# emgucv (opencv wrapper). As I said, I'm still new to this and I recognize the possibility of optimzation, but as you said, that's more about replacing the pieces here with more efficient ones rather than changing how to go about it.

2016-05-19 09:15:38 -0600 answered a question Locality Sensitivy Hashing in OpenCV for image processing

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/...

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.