T
- Primitive array type of the backing array of each local featureAGGREGATE
- Type of the aggregate FeatureVector
producedpublic class BlockSpatialAggregator<T,AGGREGATE extends FeatureVector & Concatenatable<AGGREGATE,AGGREGATE>> extends Object implements SpatialVectorAggregator<ArrayFeatureVector<T>,SpatialLocation,Rectangle>
BlockSpatialAggregator
performs spatial pooling of local features
by grouping the local features into non-overlapping, fixed-size spatial
blocks, 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).Modifier and Type | Field and Description |
---|---|
protected int |
blocksX |
protected int |
blocksY |
protected VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> |
innerAggregator |
Constructor and Description |
---|
BlockSpatialAggregator(VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> innerAggregator,
int blocksX,
int blocksY)
Construct with the given aggregator and number of blocks in the X and Y
dimensions.
|
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 VectorAggregator<ArrayFeatureVector<T>,AGGREGATE extends FeatureVector & Concatenatable<AGGREGATE,AGGREGATE>> innerAggregator
protected int blocksX
protected int blocksY
public BlockSpatialAggregator(VectorAggregator<ArrayFeatureVector<T>,AGGREGATE> innerAggregator, int blocksX, int blocksY)
innerAggregator
- the aggregatorblocksX
- the number of blocks in XblocksY
- the number of blocks in Ypublic 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