Git Product home page Git Product logo

libvot's Introduction

libvot - A C++11 multi-thread library for image retrieval

Join the chat at https://gitter.im/hlzz/libvot Build Status License CoverityScan

Introduction

libvot is a fast implementation of vocabulary tree, which is an algorithm widely used in image retrieval and computer vision. It usually comprises three components to build a image retrieval system using vocabulary tree: build a k-means tree using sift descriptors from images, register images into the database, query images against the database. In this library, we use C++11 standard multi-thread library to accelerate the computation, which achieves fast and accurate image retrieval performance. Currently this library is under active development for both research and production. If you find this repository useful, please star it to let me know. :)

Installation

The build system of libvot is based on CMake. To take full advantages of the new features in C++11, we require the version of CMake to be 2.8.12 or above. Current we have tested our project under Linux (Ubuntu 14.04, CentOS 7) and MacOS (10.10) using gcc. The common steps to build the library are:

  1. Extract source files.
  2. Create build directory and change to it.
  3. Run CMake to configure the build tree.
  4. Build the software using selected build tool.
  5. Run "make test"
  6. See src/example for the usage of this library.

On Unix-like systems with GNU Make as the build tool, the following sequence of commands can be used to compile the source code.

$ cd libvot
$ mkdir build && cd build
$ cmake ..
$ make && make test

Optional Dependencies

  • gflags, glog (Required) and gtest, if test is enable.
  • Boost (>1.55), for serialization, python-binding, etc.
  • OpenCV (>2.4), for feature detector and general utilities for image processing.
  • NVIDIA's Cuda Toolkit 7.5, for GPU-related code.
  • NVIDIA's cuDNNv5 for CUDA 7.5, for the deep learning module.

See the installation guide for details.

Docker Installation

Besides, libvot supports docker installation. Docker is a system to build self-contained versions of a Linux operating system running on your machine. You can pull the latest auto-build here. If you encounter any problem building this software on a clean linux OS, Dockerfile is a minimum ubuntu configuration and a good reference.

First try

Suppose $LIBVOT_ROOT represents the root directory of libvot, and it is successfully compiled in build subdirectory. You can use ./libvot_feature <image_list> to first generate a set of descriptor files and use them as inputs to image_search. For example, you have some target .jpg image files to generate sift files. Just cd into that directory, prepare the image_list, and generate sift files in the same directory as the image files:

$ ls -d $PWD/*.jpg > image_list
$ $LIBVOT_ROOT/build/bin/libvot_feature <image_list>

Then you can run image_search in src/example to generate the image retrieval results The usage is simply “./image_search <sift_list> <output_dir> [depth] [branch_num] [sift_type] [num_matches] [thread_num]”. We add a small image dataset fountain-P11 to illustrate this process. test_data/fountain_dense folder contains the sift files generated by libvot_feature, while the original images are not included in order to save space. If you use the out-of-source build as shown in the installation section and in the build directory, the following command should work smoothly and generate several output files in build/bin/vocab_out directory (you need to change the prefix of filepaths in test_data/fountain_dense/sift_list).

$ cd bin
$ ls -d $PWD/*.sift > sift_list
$ ./image_search <sift_list> <output_folder> [depth] [branch_num] [sift_type] [num_matches] [thread_num]  
$ (e.g.) ./image_search ../../test_data/fountain_dense/sift_list ./vocab_out

Each line in match.out contains three numbers “first_index second_index similarity score”. Since the library is multi-threaded, the rank is unordered with respect to the first index (they are ordered w.r.t the second index). match_pairs saves the ordered similarity ranks, from 0th image to n-1th image. Besides, libvot also supports sift files generated by openMVG (set [sift_type] to 1).

Documentation

The homepage of libvot is hosted by github-pages. See the documentation here.

Contributing

We are working toward the next major release (0.2.0). If you are interested in contributing, please have a look at Roadmap.md and our Coding style. All types of contributions, including documentation, testing, and new features are welcomed and appreciated.

References

If you find this library useful for your research, please cite

@inproceedings{shen2016graph,  
  title={Graph-Based Consistent Matching for Structure-from-Motion},  
  author={Shen, Tianwei and Zhu, Siyu and Fang, Tian and Zhang, Runze and Quan, Long},  
  booktitle={European Conference on Computer Vision},  
  pages={139--155},  
  year={2016},  
  organization={Springer}  
}

Note: The image retrieval part of the above research depends on libvot. The functioning graph matching algorithm is in preparation and is planned to be merged into the master branch. For an early preview and implementation details, please send your request to [email protected].

License

The BSD 3-Clause License

Contact

For inquiries and suggestions, please send your emails to [email protected].

libvot's People

Contributors

atablash avatar gitter-badger avatar hlzz avatar pmoulon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libvot's Issues

make install

build git:(master) ✗ make install
[ 36%] Built target vlfeat
[ 41%] Built target vot_utils
[ 44%] Built target vot_feature
[ 48%] Built target vot_matching
[ 52%] Built target vot_vocabtree
[ 54%] Built target libvot_feature
[ 56%] Built target web_search
[ 60%] Built target euclidean_matrix
[ 63%] Built target compute_stats
[ 66%] Built target svt
[ 69%] Built target sequence_match
[ 72%] Built target graph_partition
[ 77%] Built target query_expansion
[ 80%] Built target image_search
[ 82%] Built target oxford5k_benchmark
[ 91%] Built target unit_test
[ 93%] Built target boost_basic_test
[ 95%] Built target opencv_test
[ 97%] Built target libvot_feature_test
[100%] Built target sift_match_test
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/include/libvot_config.h
-- Installing: /usr/local/lib/libvot_utils.0.1.dylib
-- Installing: /usr/local/lib/libvot_utils.0.dylib
-- Installing: /usr/local/lib/libvot_utils.dylib
-- Installing: /usr/local/lib/libvot_feature.0.1.dylib
-- Installing: /usr/local/lib/libvot_feature.0.dylib
-- Installing: /usr/local/lib/libvot_feature.dylib
-- Installing: /usr/local/lib/libvot_matching.0.1.dylib
-- Installing: /usr/local/lib/libvot_matching.0.dylib
-- Installing: /usr/local/lib/libvot_matching.dylib
-- Installing: /usr/local/lib/libvot_vocabtree.0.1.dylib
-- Installing: /usr/local/lib/libvot_vocabtree.0.dylib
-- Installing: /usr/local/lib/libvot_vocabtree.dylib
-- Installing: /usr/local/bin/image_search
-- Installing: /usr/local/bin/graph_partition
-- Installing: /usr/local/bin/query_expansion
-- Installing: /usr/local/bin/sequence_match
-- Installing: /usr/local/bin/compute_stats
-- Installing: /usr/local/bin/svt
-- Installing: /usr/local/bin/euclidean_matrix
-- Installing: /usr/local/bin/web_search
-- Installing: /usr/local/bin/libvot_feature
-- Installing: /usr/local/bin/oxford5k_benchmark

Halo! I noticed that you guys provide the make install script for users, so these include files, libs and bin executable files are installed on my system.
And what my question is "How do I start a new project to reference your project in CMakeLists.txt?".
For example, if you are using opencv lib, you can add find_package( OpenCV REQUIRED ) into CMakeLists.txt file. But how to use this libvot? I got errors when I add find_package( libvot REQUIRED ) into CMakeLists.txt file.

Wrong result in web_search

Hello again!
I just tryed libvot examples on more bigger image collection. See what i get.
default

Result isn't even close. But when i try to compare query image and "top ranked" image from result by native opencv functions (same libvot used, but without convertion to SiftData structure, just Flann computing of descriptors), i got false, and true with only same pictures. It looks like something went wrong ))))

Match only in a determined range of the tree

Hi!
I was trying to use libvot for a problem of vision-based localization. I built a database using image_search from a collection of training pictures (a continuous recording of a street path). After I have a new continuous sequence of pictures (the test), recorded along the same path. At the first iteration, I want to find the closest match using the first pictures of the test set. For this, I used web_search and I find the best match (let's call it A). In order to speed-up the process, I would like to run another search, using the second picture of the test set, but only in a neighbor of the previous result A. Is it possible with libvot?

Thanks!

Error while make

I follow the installation guide and this shows up while make
error1
error2

I've been looking for solution and none of them worked.
Can anyone tell me how to fix this? Thank you

cmake cannot find -lopencv_dep_cudart

system: ubuntu 16.04

[ 42%] Linking CXX shared library ../../lib/libvot_feature.so
/usr/bin/ld: cannot find -lopencv_dep_cudart
collect2: error: ld returned 1 exit status
src/feature/CMakeFiles/vot_feature.dir/build.make:145: recipe for target 'lib/libvot_feature.so.0.1' failed
make[2]: *** [lib/libvot_feature.so.0.1] Error 1
CMakeFiles/Makefile2:355: recipe for target 'src/feature/CMakeFiles/vot_feature.dir/all' failed
make[1]: *** [src/feature/CMakeFiles/vot_feature.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Example doesnt work

image_feauture example doesnt work. Files it creates are named with unreadable encoding. And i cant try image_search because of that.

pull-request: small speed improvement

Thanks for the great work: fast and good results!

Please find attached a small patch improving a bit the speed and memory usage by replacing IndexedFloat with a static plane index array. I fixed also some warnings.

patch.zip

OpenCV 3 not supported

In your code, you use the nonfree module of OpenCV 2, thus when build your code the OpenCV 3 cannot be used. Hope write this down in your installation guide.

How to use `image_search` ?

I dont understand how I should use ./image_search. The command from the docs is:

./image_search <sift_list> <output_dir> [depth] [branch_num] [sift_type] [num_matches] [thread_num] so where is the input for the query image ?

sift_list is the list of features generated by ./libvot_feature or openMVG right ?

Why not use VGG?

I only found a SIFT features matcher....
generally, the accuracy for SIFT about 50%, and VGG can upto 90%, why not use VGG?

Error while installing

I am not able to install the library.

I do not have nvidia graphics card so I cmake using
cmake -DLIBVOT_USE_CUDA=OFF -DLIBVOT_USE_CUDNN=OFF ..

then while I make, I got the following error
screenshot from 2016-09-22 17-45-37

Help pls!

I cannot run bin/libvot_feature as instructed

I am trying to run ./libvot_feature image_list and I get this:

dyld: Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.5.dylib
Referenced from: /usr/local/opt/opencv@3/lib/libopencv_core.3.4.dylib
Reason: image not found

Any help ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.