|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvector_aggregation.AbstractFeatureAggregator
public abstract class AbstractFeatureAggregator
All methods which aggregate a set of local image descriptors should extend this abstract class.
Field Summary | |
---|---|
protected double[][] |
codebook
The codebook (centroids) used to aggregate the vectors. |
protected int |
descriptorLength
The dimensionality of the local descriptors ( should be equal to the dimensionality of each centroid). |
protected int |
numCentroids
The number of centroids in the codebook. |
protected int |
vectorLength
The length of the generated vectors. |
Constructor Summary | |
---|---|
protected |
AbstractFeatureAggregator()
|
protected |
AbstractFeatureAggregator(double[][] codebook)
The constructor. |
Method Summary | |
---|---|
double[] |
aggregate(java.util.ArrayList<double[]> descriptors)
This method performs some general checks before calling the aggregateInternal method which is implemented by each aggregator. |
double[] |
aggregate(double[][] descriptors)
This method performs some general checks before calling the aggregateInternal method which is implemented by each aggregator. |
protected abstract double[] |
aggregateInternal(java.util.ArrayList<double[]> descriptors)
This method should be overridden by all aggregators. |
protected abstract double[] |
aggregateInternal(double[][] descriptors)
This method should be overridden by all aggregators. |
protected int[] |
computeKNearestCentroids(double[] descriptor,
int k)
Returns the indices of the k centroids which are closer to the given descriptor. |
protected int |
computeNearestCentroid(double[] descriptor)
Returns the index of the centroid which is closer to the given descriptor. |
protected double[] |
computeNearestCentroidIndexAndDistance(double[] descriptor)
Returns a double array which has the nearest centroid's index as the first element and the distance from this centroid as the second element. |
int |
getDescriptorLength()
|
int |
getNumCentroids()
|
abstract int |
getVectorLength()
Should compute and return the length of the generated vector. |
static double[][] |
readCodebookFile(java.lang.String codebookFileName,
int numCentroids,
int centroidLength)
Reads the codebook from the given file and returns it as two-dimensional double array. |
void |
setDescriptorLength(int descriptorLength)
|
void |
setNumCentroids(int numCentroids)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[][] codebook
protected int numCentroids
protected int vectorLength
protected int descriptorLength
Constructor Detail |
---|
protected AbstractFeatureAggregator()
protected AbstractFeatureAggregator(double[][] codebook)
codebook
- Method Detail |
---|
public abstract int getVectorLength()
public int getNumCentroids()
public void setNumCentroids(int numCentroids)
public int getDescriptorLength()
public void setDescriptorLength(int descriptorLength)
public double[] aggregate(double[][] descriptors) throws java.lang.Exception
descriptors
- a set of local descriptors
java.lang.Exception
protected abstract double[] aggregateInternal(java.util.ArrayList<double[]> descriptors) throws java.lang.Exception
descriptors
-
java.lang.Exception
public double[] aggregate(java.util.ArrayList<double[]> descriptors) throws java.lang.Exception
descriptors
- a set of local descriptors
java.lang.Exception
protected abstract double[] aggregateInternal(double[][] descriptors) throws java.lang.Exception
descriptors
-
java.lang.Exception
protected int computeNearestCentroid(double[] descriptor)
descriptor
-
protected double[] computeNearestCentroidIndexAndDistance(double[] descriptor)
descriptor
-
protected int[] computeKNearestCentroids(double[] descriptor, int k)
descriptor
- k
-
public static double[][] readCodebookFile(java.lang.String codebookFileName, int numCentroids, int centroidLength) throws java.io.IOException
codebookFileName
- the name of the file containing the codebook
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |