libvot  0.1.3
A C++11 multithread library for image retrieval
Classes | Enumerations | Functions | Variables
vot Namespace Reference

namespace vot contains libvot functions and classes. More...

Classes

class  GlobalParam
 global parameters More...
 
class  ImageCount
 This class contains a index for an image and a count for image. More...
 
class  ImageGraph
 Image graph class. More...
 
struct  ImageNode
 the image node used in image graph class More...
 
struct  LinkEdge
 edge struct used in image graph class More...
 
class  TreeInNode
 The interior node class of the tree. More...
 
class  TreeLeafNode
 The leaf node class of the tree. More...
 
class  TreeNode
 The virtual class of tree node. More...
 
class  VocabTree
 The vocabulary tree class. The depth of the root is 0. The depth of the leaf nodes is depth+1. More...
 

Enumerations

enum  LIBVOT_FEATURE_TYPE { OPENCV_SIFT = 0, VLFEAT_SIFT = 1 }
 feature type used in libvot_feature More...
 
enum  SiftType { E3D_SIFT = 0, OPENMVG_FEAT = 1 }
 sift feature type used in vocabulary tree More...
 
enum  DistanceType { L1 = 1, L2 = 2 }
 

Functions

void showi (int i)
 
void showd (double d)
 
void showf (float f)
 
void shows (std::string s)
 
void showf (double f)
 
void MultiRecursiveBuild (TreeNode *children, size_t num_keys, int dim, int depth, int depth_curr, int bf, DTYPE **p, double *means, int *assign, int sub_thread_num)
 
void MultiAddImage (TreeNode *root, float *scores, DTYPE *v, size_t image_index, int num_feature, int branch_num, int dim, bool add)
 
std::vector< size_t > RandomSample (size_t total, size_t sample_num)
 
bool BuildVocabTree (const char *sift_list, const char *output_filename, int depth=6, int branch_num=8, SiftType sift_type=E3D_SIFT, int thread_num=1)
 BuildVocabTree: build a vocabulary tree using a set of sift files. More...
 
bool BuildImageDatabase (const char *sift_list, const char *input_tree, const char *output_filename, SiftType sift_type=E3D_SIFT, size_t start_id=0, int thread_num=1)
 BuildImageDatabase: build a image database with pre-trained vocabulary tree. More...
 
void MultiQueryDatabase (vot::VocabTree *tree, std::vector< std::string > *sift_filenames, int sift_type, size_t first_index, size_t num_images, float *scores, size_t *indexed_scores, FILE *match_file, std::mutex *match_file_mutex)
 
bool QueryDatabase (const char *image_db, const char *query_sift_list, const char *match_output, SiftType sift_type=E3D_SIFT, int thread_num=1)
 QueryDatabase: query the image database with a sift list file. More...
 
bool FilterMatchList (const char *sift_list, const char *match_list, const char *output, size_t num_matches)
 FilterMatchList: filter output match file and output TOP-k rank lists. More...
 

Variables

size_t leaves_count = 0
 

Detailed Description

namespace vot contains libvot functions and classes.

Enumeration Type Documentation

Enumerator
L1 
L2 

feature type used in libvot_feature

Enumerator
OPENCV_SIFT 

opencv sift feature type

VLFEAT_SIFT 

vlfeat sift feature type

sift feature type used in vocabulary tree

Enumerator
E3D_SIFT 

the standard internal sift data structure of libvot

OPENMVG_FEAT 

the sift data structure used in openmvg

Function Documentation

bool vot::BuildImageDatabase ( const char *  sift_list,
const char *  input_tree,
const char *  output_filename,
SiftType  sift_type = E3D_SIFT,
size_t  start_id = 0,
int  thread_num = 1 
)

BuildImageDatabase: build a image database with pre-trained vocabulary tree.

Parameters
sift_listthe file path of the sift list
input_treethe file path of the tree file
output_filenamethe file path of the output image database
sift_typefeature type
start_idstart id for the images, if not built from new (append)
thread_numthread number for multi-thread processing
Returns
true if success
bool vot::BuildVocabTree ( const char *  sift_list,
const char *  output_filename,
int  depth = 6,
int  branch_num = 8,
SiftType  sift_type = E3D_SIFT,
int  thread_num = 1 
)

BuildVocabTree: build a vocabulary tree using a set of sift files.

Parameters
sift_listthe file path of the sift list
output_filenamethe file path of the output tree file
depthdepth of the vocabulary tree
branch_numbranch number
sift_typefeature type
thread_numthread number for multi-thread processing
Returns
true if success
bool vot::FilterMatchList ( const char *  sift_list,
const char *  match_list,
const char *  output,
size_t  num_matches 
)

FilterMatchList: filter output match file and output TOP-k rank lists.

Parameters
sift_listthe file path of the sift list
match_listthe file path of the output match file
outputthe output top-k matched pairs
num_matchesthe number top-k images
Returns
true if success
void vot::MultiAddImage ( TreeNode root,
float *  scores,
DTYPE v,
size_t  image_index,
int  num_feature,
int  branch_num,
int  dim,
bool  add 
)
void vot::MultiQueryDatabase ( vot::VocabTree tree,
std::vector< std::string > *  sift_filenames,
int  sift_type,
size_t  first_index,
size_t  num_images,
float *  scores,
size_t *  indexed_scores,
FILE *  match_file,
std::mutex *  match_file_mutex 
)
void vot::MultiRecursiveBuild ( TreeNode children,
size_t  num_keys,
int  dim,
int  depth,
int  depth_curr,
int  bf,
DTYPE **  p,
double *  means,
int *  assign,
int  sub_thread_num 
)
bool vot::QueryDatabase ( const char *  image_db,
const char *  query_sift_list,
const char *  match_output,
SiftType  sift_type = E3D_SIFT,
int  thread_num = 1 
)

QueryDatabase: query the image database with a sift list file.

Parameters
image_dbthe file path of the input image database
query_sift_listthe file path of the query sift list file
match_outputthe rank list output
sift_typefeature type
thread_numthread number for multi-thread processing
Returns
true if success
std::vector<size_t> vot::RandomSample ( size_t  total,
size_t  sample_num 
)

Random sample "sample_num" number of numbers from [0, 1, ... , total] (total >= sample_num)

void vot::showd ( double  d)
void vot::showf ( float  f)
void vot::showf ( double  f)
void vot::showi ( int  i)
void vot::shows ( std::string  s)

Variable Documentation

size_t vot::leaves_count = 0