Visual Vocabulary Tree

asked 2015-04-14 04:55:29 -0600

pheips gravatar image


I know, that there is a Bag of Word Mechanism implemented in OpenCV wich can be used with various Matcher to do Image Categorization, but I coudn't find an implementation of the very popular Visual Vocabulary Tree proposed by Nister and Stewenius:

It serves as a faster method to build visual vocabularies as well as a faster approach to find matches. It's a combination of hierarchical clustering, bag of words and a scoring mechanism also used for text retrieval.

I wonder, if OpenCV already has implemented it, and I am simply missing it?

Otherwise I think, it would be a great addition to the OpenCV library.

best regards

edit retag flag offensive close merge delete


Afaik it is not in yet, but it can be build with the existing Bag of Word components out there. If you do decide to build it, please file a PR with the software to the repository!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-14 05:59:30 -0600 )edit

And maybe the OpenFABMAP does something similar?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-14 06:00:36 -0600 )edit

And this is based on the OpenCV software!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-14 06:01:55 -0600 )edit

Thanks for your response! DBow looks very interesting.

Anyway, if I find some free time, I am going to build it and will then file a PR.

pheips gravatar imagepheips ( 2015-04-14 07:25:01 -0600 )edit

It is not implemented in OpenCV. I wrote this VT algorithm some years ago using OpenCV structures based both in a code that I found long time ago (C++) and in DBOW. Keep in mind that you will need to compute a Vocabulary Tree using a large amount of descriptors and with sufficient variation if you want reasonable results, as tree should be well populated (most of leaves with an assigned descriptor value). It works very well for tracking loss recovery for SLAM algorithms :)

R.Saracchini gravatar imageR.Saracchini ( 2015-04-14 10:17:32 -0600 )edit

@pheips and @R.Saracchini maybe you should share codes and work together on the PR?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-15 07:02:58 -0600 )edit

As far I cannot disclose the code directly (there is some IP over its library), I would be more than happy to aid in write a OpenCV module which implements a Vocabulary Tree training, and search with distinct type of descriptors (floating point,binary) and distance functions(l2,l1, hamming). It would be nice to add to at least a basic Inverted File implementation which is used by the NisterĀ“s algorithm and compatible with a BoW approach.

I wish that I had more time to write a proper Photometric Stereo module...

R.Saracchini gravatar imageR.Saracchini ( 2015-04-16 06:31:41 -0600 )edit