T
- Primitive array type of the ArrayFeatureVector
s used by
the LocalFeature
s that will be processed.public class BagOfVisualWords<T> extends Object implements VectorAggregator<ArrayFeatureVector<T>,SparseIntFV>
HardAssigner
with an associated codebook.Constructor and Description |
---|
BagOfVisualWords(HardAssigner<T,?,?> assigner)
Construct with the given assigner.
|
Modifier and Type | Method and Description |
---|---|
SparseIntFV |
aggregate(List<? extends LocalFeature<?,? extends ArrayFeatureVector<T>>> features)
Aggregate the given features into a vector.
|
SparseIntFV |
aggregateVectors(List<? extends ArrayFeatureVector<T>> features)
Aggregate the given features into a vector.
|
SparseIntFV |
aggregateVectorsRaw(List<T> features)
Aggregate the given features into a vector.
|
static <L extends Location,T> |
computeQuantisedFeatures(HardAssigner<T,?,?> assigner,
List<? extends LocalFeature<L,? extends ArrayFeatureVector<T>>> features)
Utility method to construct a list of quantised local features (local
features with visual word assignments) from a list of features and a
HardAssigner . |
static <L extends Location> |
extractFeatureFromQuantised(Collection<? extends QuantisedLocalFeature<L>> qfeatures,
int nfeatures)
Utility method to quickly convert a collection of quantised local
features to a histogram of their corresponding visual word identifiers.
|
public BagOfVisualWords(HardAssigner<T,?,?> assigner)
assigner
- the assignerpublic static <L extends Location,T> List<QuantisedLocalFeature<L>> computeQuantisedFeatures(HardAssigner<T,?,?> assigner, List<? extends LocalFeature<L,? extends ArrayFeatureVector<T>>> features)
HardAssigner
.assigner
- the assigner to apply to the feature vectors to create the
visual word identifiersfeatures
- the features to processpublic static <L extends Location> SparseIntFV extractFeatureFromQuantised(Collection<? extends QuantisedLocalFeature<L>> qfeatures, int nfeatures)
qfeatures
- the quantised features.nfeatures
- the number of visual words.public SparseIntFV aggregate(List<? extends LocalFeature<?,? extends ArrayFeatureVector<T>>> features)
VectorAggregator
aggregate
in interface VectorAggregator<ArrayFeatureVector<T>,SparseIntFV>
features
- the features to aggregatepublic SparseIntFV aggregateVectors(List<? extends ArrayFeatureVector<T>> features)
VectorAggregator
aggregateVectors
in interface VectorAggregator<ArrayFeatureVector<T>,SparseIntFV>
features
- the features to aggregatepublic SparseIntFV aggregateVectorsRaw(List<T> features)
features
- the features to aggregate