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

Overview

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

Then you can run image_search in src/example to generate the image retrieval results The usage is simply “./image_search [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   [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].

Comments
  • Would you provide the script of openMVG's SIFT extraction?

    Would you provide the script of openMVG's SIFT extraction?

    @hlzz It's very interesting of the project. Would you provide the script of openMVG's SIFT extraction, i.e. the script to use openMVG's SIFT function and save it to a file with suffix '.desc' like the data in test_data?

    opened by willard-yuan 8
  • Adjacency matrix logging, C++ update

    Adjacency matrix logging, C++ update

    • Add a LIBVOT_USE_OPENCV option to build libvot with opencv support
    • Remove unused dependency about openmvg_descriptor.hpp
    • Add some const where data must be const
    • Use c++11 nullptr
    • replace some new X* by std::vector. Despite there is not memory leak, using pointer array increase the risk to have leak when new contributors comes inside the project.
    • Add an option SVG adjacency matrix log to image_search binary. Here an example of the generated file by libvot on a tiny dataset dataset1_adjacency_matrix Here the result of OpenMVG matching (all pair tested, only pair that have geometric correspondences are displayed). We can see that the matrix are very similar ;-) dataset1_openmvg_geometric_list

    Here the same results on a larger dataset: voc 25 libvot results: dataset_2-adjacency_matrix-voc25

    voc 100 libvot results: dataset_2-adjacency_matrix-voc100

    Here the openMVG resulting adjacency matrix (again they are close) dataset2-openmvg_geometric_list

    PS: sorry for the tab alignment issue

    • I think that using spaces based tab would make the edit easier, space have regular size across editor, but it's not the same for tabs (windows VS tab is often 4 spaces)
    opened by pmoulon 6
  • Wrong result in web_search

    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 ))))

    opened by ashkart 6
  • I cannot run bin/libvot_feature as instructed

    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/[email protected]/lib/libopencv_core.3.4.dylib
    Reason: image not found
    

    Any help ?

    opened by alexs7 3
  • Error while installing

    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!

    opened by aman-bhatia 3
  • pull-request: small speed improvement

    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

    opened by cdcseacave 3
  • How to use `image_search` ?

    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 ?

    opened by alexs7 1
  • Error with gtest

    Error with gtest

    In the installation guide, sudo apt-get install libgtest-dev cannot be used directly, for just the source code is installed into /usr/include, but the static libraries are required of gtest. I recommend to install gtest from source. https://www.cnblogs.com/lynch_world/archive/2011/12/08/2281335.html is a reference link.

    opened by AIBluefisher 1
  • OpenCV 3 not supported

    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.

    opened by AIBluefisher 1
  • make install

    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.

    opened by minglinlu 1
  • cmake cannot find -lopencv_dep_cudart

    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

    opened by hlzz001 1
  • CPP API of VLFeat for covdet feature and kd-tree

    CPP API of VLFeat for covdet feature and kd-tree

    This is the cpp api of VLFeat for covdet feature and kd-tree. I have tested covdet feature and kd-tree, and the result is right (I have used it for image retrieval with BoW). but the code still need to improve. I also write the RANSAC-like reranking method based on matrix lib of Armadillo, and I will pull request if I have improved the code of reranking method.

    opened by willard-yuan 10
PoC black/white image sequence to dumpy gif image sequence converter

PoC black/white image sequence to dumpy gif image sequence converter

null 69 Dec 9, 2022
The “Quite OK Image” format for fast, lossless image compression

The “Quite OK Image” format for fast, lossless image compression

Dominic Szablewski 6k Dec 30, 2022
This library provides a cross-platform image loading library in C11 for projects based on our foundation library

Image Library - Public Domain This library provides a cross-platform image loading library in C11 for projects based on our foundation library.

Mattias Jansson 1 Jan 29, 2022
A fast image processing library with low memory needs.

libvips : an image processing library Introduction libvips is a demand-driven, horizontally threaded image processing library. Compared to similar lib

libvips 26 Nov 10, 2022
C++ image processing and machine learning library with using of SIMD: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX-512, VMX(Altivec) and VSX(Power7), NEON for ARM.

Introduction The Simd Library is a free open source image processing and machine learning library, designed for C and C++ programmers. It provides man

Ihar Yermalayeu 1.7k Jan 5, 2023
Video++, a C++14 high performance video and image processing library.

Video++ Video++ is a video and image processing library taking advantage of the C++14 standard to ease the writing of fast video and image processing

Matthieu Garrigues 692 Dec 28, 2022
a generic C++ library for image analysis

VIGRA Computer Vision Library Copyright 1998-2013 by Ullrich Koethe This file is part of the VIGRA computer vision library. You may use,

Ullrich Koethe 378 Dec 30, 2022
Intel® Open Image Denoise library

Intel Open Image Denoise is an open source library of high-performance, high-quality denoising filters for images rendered with ray tracing

Intel® Open Image Denoise 1.3k Dec 28, 2022
Arduino PNG image decoder library

An 'embedded-friendly' (aka Arduino) PNG image decoding library

Larry Bank 102 Jan 6, 2023
ppl.cv is a high-performance image processing library of openPPL supporting x86 and cuda platforms.

ppl.cv is a high-performance image processing library of openPPL supporting x86 and cuda platforms.

null 366 Dec 30, 2022
An 'embedded-friendly' (aka Arduino) JPEG image encoding library

Starting in the late 80's I wrote my own imaging codecs for the existing standards (CCITT G3/G4 was the first). I soon added GIF, JPEG and not long after that, the PNG specification was ratified. All of this code was "clean room" - written just from the specification. I used my imaging library in many projects and products over the years and recently decided that some of my codecs could get a new lease on life as open source, embedded-friendly libraries for microcontrollers.

Larry Bank 38 Dec 30, 2022
The CImg Library is a small and open-source C++ toolkit for image processing

http://cimg.eu The CImg Library is a small and open-source C++ toolkit for image processing, designed with these properties in mind: CImg defines clas

David Tschumperlé 1.2k Jan 3, 2023
Small header-only C library to decompress any BC compressed image

Small header-only C library to decompress any BC compressed image

null 92 Jan 1, 2023
GLSL Image Processing System

GIPS: The GLSL Image Processing System An image processing application that applies filters written in the OpenGL Shading Language (GLSL). This means

Martin Fiedler 57 Nov 29, 2022
Video, Image and GIF upscale/enlarge(Super-Resolution) and Video frame interpolation. Achieved with Waifu2x, SRMD, RealSR, Anime4K, RIFE, CAIN, DAIN and ACNet.

Video, Image and GIF upscale/enlarge(Super-Resolution) and Video frame interpolation. Achieved with Waifu2x, SRMD, RealSR, Anime4K, RIFE, CAIN, DAIN and ACNet.

Aaron Feng 8.7k Jan 7, 2023
pngtostl is a program that converts a PNG image into STL 3D models

pngtostl is a program that converts a PNG image into a litophane, in STL format, suitable to be printed by entry level 3D printers.

Salvatore Sanfilippo 157 Dec 17, 2022
An AV1 Image (AVIF) file format plug-in for Adobe® Photoshop®

avif-format An AV1 Image (AVIF) file format plug-in for Adobe® Photoshop®. Single images can be loaded and saved using 8, 10 or 12 bits-per-channel, i

Nicholas Hayes 100 Dec 20, 2022
HDRView is a simple research-oriented image viewer with an emphasis on examining and comparing high-dynamic range (HDR) images

HDRView is a simple research-oriented high-dynamic range image viewer with an emphasis on examining and comparing images, and including minimalistic tonemapping capabilities. HDRView currently supports reading EXR, PNG, TGA, BMP, HDR, JPG, GIF, PNM, PFM, and PSD images and writing EXR, HDR, PNG, TGA, PPM, PFM, and BMP images.

Wojciech Jarosz 177 Jan 5, 2023
Embed image data directly to HTML files.

compact_html Welcome! Embed image data directly to HTML files. Thanks: cpp-base64: Base64 encoding and decoding with c++. cpprestsdk: The C++ REST SDK

Frost Sigh 43 Aug 21, 2022