vlad.h implements the Vector of Linearly Aggregated Descriptors (VLAD) image representation [9] [2] .
Getting started with VLAD demonstreates how to use the C API to compute the VLAD representation of an image. For further details on the VLAD image representation refer to:
- VLAD fundamentals - VLAD definition and computation.
Getting started with VLAD
The VLAD encoding of a set of features is obtained by using the function vl_vlad_encode. The function can be applied to both float
or double
data types.
vl_vlad_encode requires a visual dictionary, for example obtained by using K-means clustering. Furthermore, the assignments of features to dictionary elements must be pre-computed, for example by using KD-trees and forests.
In the following example code, the vocabulary is first created using the KMeans clustering, then the points, that are to be encoded are assigned to its corresponding nearest vocabulary words, after that the original vlad encoding routine without any normalization option takes place. At the end of the process the encoding is stored in the enc
variable.
Various VLAD normalization normalizations can be applied to the VLAD vectors. These are controlled by the parameter flag of vl_vlad_encode.