T
- Primitive array type of the ArrayFeatureVector
s used by
the LocalFeature
s that will be processed.@Reference(type=Inproceedings, author={"Jegou, H.","Douze, M.","Schmid, C.","Perez, P."}, title="Aggregating local descriptors into a compact image representation", year="2010", booktitle="Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on", pages={"3304 ","3311"}, month="june", customData={"doi","10.1109/CVPR.2010.5540039","ISSN","1063-6919"}) public class VLAD<T> extends Object implements VectorAggregator<ArrayFeatureVector<T>,MultidimensionalFloatFV>
BagOfVisualWords
, features are assigned
to centroids in a codebook (usually learnt through k-means), but instead of
creating a vector of codeword occurances, VLAD accumulates the residual
vector between each input vector and its assigned centroid. Fundamentally,
VLAD describes the distribution of the image vectors with respect to their
assigned centroids. VLAD is closely related to the more complex
FisherVector
.
For a given number of centroids, K, and vector length, D, the VLAD descriptor
has dimension K*D. This is obviously longer than the K-dimensional vector
produced by BagOfVisualWords
. However, the VLAD descriptor is can be
useful with a much smaller K (i.e. of the order of 16-64 dimensions versus up
to 1 million (or more) for BagOfVisualWords
).
Constructor and Description |
---|
VLAD(HardAssigner<T,?,?> assigner,
CentroidsProvider<T> centroids,
boolean normalise)
Construct with the given assigner and the centroids associated with the
assigner.
|
VLAD(HardAssigner<T,?,?> assigner,
T[] centroids,
boolean normalise)
Construct with the given assigner and the centroids associated with the
assigner.
|
Modifier and Type | Method and Description |
---|---|
MultidimensionalFloatFV |
aggregate(List<? extends LocalFeature<?,? extends ArrayFeatureVector<T>>> features)
Aggregate the given features into a vector.
|
MultidimensionalFloatFV |
aggregateVectors(List<? extends ArrayFeatureVector<T>> features)
Aggregate the given features into a vector.
|
static FImage |
drawDescriptor(float[] descr,
int nterms,
int nSpatialBins,
int nOriBins)
Generate a visualisation of the feature.
|
public VLAD(HardAssigner<T,?,?> assigner, T[] centroids, boolean normalise)
assigner
- the assignercentroids
- the centroids associated with the assignernormalise
- if true then output feature is l2 normalisedpublic VLAD(HardAssigner<T,?,?> assigner, CentroidsProvider<T> centroids, boolean normalise)
assigner
- the assignercentroids
- the centroids associated with the assignernormalise
- if true then output feature is l2 normalisedpublic MultidimensionalFloatFV aggregate(List<? extends LocalFeature<?,? extends ArrayFeatureVector<T>>> features)
VectorAggregator
aggregate
in interface VectorAggregator<ArrayFeatureVector<T>,MultidimensionalFloatFV>
features
- the features to aggregatepublic MultidimensionalFloatFV aggregateVectors(List<? extends ArrayFeatureVector<T>> features)
VectorAggregator
aggregateVectors
in interface VectorAggregator<ArrayFeatureVector<T>,MultidimensionalFloatFV>
features
- the features to aggregatepublic static FImage drawDescriptor(float[] descr, int nterms, int nSpatialBins, int nOriBins)
descr
- the featurenterms
- the number of centroids used to create the featurenSpatialBins
- the number of spatial bins used in the featurenOriBins
- the number of orientation bins