vector_aggregation
Class BowAggregator

java.lang.Object
  extended by vector_aggregation.AbstractFeatureAggregator
      extended by vector_aggregation.BowAggregator

public class BowAggregator
extends AbstractFeatureAggregator

This class computes raw BOW vectors. The produced vectors should be (optionally) power and L2 normalized afterwards.

Author:
Eleftherios Spyromitros-Xioufis

Field Summary
private  int k
          The number of centroids where each descriptor is quantized.
 
Fields inherited from class vector_aggregation.AbstractFeatureAggregator
codebook, descriptorLength, numCentroids, vectorLength
 
Constructor Summary
BowAggregator(double[][] codebook)
           
BowAggregator(double[][] codebook, int k)
           
 
Method Summary
protected  double[] aggregateInternal(java.util.ArrayList<double[]> descriptors)
          This method should be overridden by all aggregators.
protected  double[] aggregateInternal(double[][] descriptors)
          This method should be overridden by all aggregators.
 int getVectorLength()
          Should compute and return the length of the generated vector.
 
Methods inherited from class vector_aggregation.AbstractFeatureAggregator
aggregate, aggregate, computeKNearestCentroids, computeNearestCentroid, computeNearestCentroidIndexAndDistance, getDescriptorLength, getNumCentroids, readCodebookFile, setDescriptorLength, setNumCentroids
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

k

private int k
The number of centroids where each descriptor is quantized. Default = 1 means hard quantization.

Constructor Detail

BowAggregator

public BowAggregator(double[][] codebook)

BowAggregator

public BowAggregator(double[][] codebook,
                     int k)
Method Detail

aggregateInternal

protected double[] aggregateInternal(double[][] descriptors)
                              throws java.lang.Exception
Description copied from class: AbstractFeatureAggregator
This method should be overridden by all aggregators.

Specified by:
aggregateInternal in class AbstractFeatureAggregator
Returns:
Throws:
java.lang.Exception

aggregateInternal

protected double[] aggregateInternal(java.util.ArrayList<double[]> descriptors)
                              throws java.lang.Exception
Description copied from class: AbstractFeatureAggregator
This method should be overridden by all aggregators.

Specified by:
aggregateInternal in class AbstractFeatureAggregator
Returns:
Throws:
java.lang.Exception

getVectorLength

public int getVectorLength()
Description copied from class: AbstractFeatureAggregator
Should compute and return the length of the generated vector.

Specified by:
getVectorLength in class AbstractFeatureAggregator
Returns: