T
- Primitive array type of the backing array of each local featureAGGREGATE
- Type of the aggregate FeatureVector
producedpublic class PyramidSpatialAggregator<T,AGGREGATE extends FeatureVector & Concatenatable<AGGREGATE,AGGREGATE>> extends Object implements SpatialVectorAggregator<ArrayFeatureVector<T>,SpatialLocation,Rectangle>
PyramidSpatialAggregator
performs spatial pooling of local features
by grouping the local features into fixed-size spatial blocks within a
pyramid, and applying a VectorAggregator
(i.e. a
BagOfVisualWords
) to the features within each block before combining
the aggregated results into a single vector (by passing through the blocks in
a left-right, top-bottom fashion over the pyramid levels from the top down).Modifier and Type | Field and Description |
---|---|
protected VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> |
innerAggregator |
Constructor and Description |
---|
PyramidSpatialAggregator(VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> innerAggregator,
int... numBlocks)
Construct with the given aggregator and number of blocks per level.
|
PyramidSpatialAggregator(VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> innerAggregator,
String description)
Construct with the given aggregator and pyramid description (i.e.
|
Modifier and Type | Method and Description |
---|---|
AGGREGATE |
aggregate(List<? extends LocalFeature<? extends SpatialLocation,? extends ArrayFeatureVector<T>>> features,
Rectangle bounds)
Aggregate the given features into a vector.
|
protected static String |
levelsToString(boolean[][][] levels) |
protected static boolean[][][] |
parseLevelsAdvanced(String description) |
protected VectorAggregator<ArrayFeatureVector<T>,AGGREGATE extends FeatureVector & Concatenatable<AGGREGATE,AGGREGATE>> innerAggregator
public PyramidSpatialAggregator(VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> innerAggregator, String description)
innerAggregator
- the aggregatordescription
- the pyramid descriptionpublic PyramidSpatialAggregator(VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> innerAggregator, int... numBlocks)
innerAggregator
- the aggregatornumBlocks
- number of blocks (in X and Y) for each level of the pyramidprotected static boolean[][][] parseLevelsAdvanced(String description)
protected static String levelsToString(boolean[][][] levels)
public AGGREGATE aggregate(List<? extends LocalFeature<? extends SpatialLocation,? extends ArrayFeatureVector<T>>> features, Rectangle bounds)
SpatialVectorAggregator
aggregate
in interface SpatialVectorAggregator<ArrayFeatureVector<T>,SpatialLocation,Rectangle>
features
- the features to aggregatebounds
- the bounds in which the features were extracted