|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvector_aggregation.AbstractFeatureAggregator
vector_aggregation.VladAggregatorWithFiltering
public class VladAggregatorWithFiltering
This is an experimental version of the VladAggregator class which implements 3 methods for feature filtering based on feature-vocabulary relation. The produced VLAD vectors should be power and L2 normalized afterwards.
Nested Class Summary | |
---|---|
static class |
VladAggregatorWithFiltering.FilteringMethod
The alternative methods for feature filtering based on feature-vocabulary relation. |
Field Summary | |
---|---|
private long |
featuresRejected
Counts the total number of rejected features. |
private VladAggregatorWithFiltering.FilteringMethod |
filteringMethod
The VladAggregatorWithFiltering.FilteringMethod to be used. |
private double |
numStds
The a parameter of the std method. |
private double |
percentage
The percentage of features to be retained. |
static double[] |
percentages
Percentages for which thresholds have been pre-calculated for the std and ratio methods. |
private double |
ratio
The b parameter of the ratio filtering method. |
private double[] |
thresholdsDist
Thresholds for the dist method. |
static double[] |
thresholdsRatio
Thresholds for the ratio method corresponding to the percentages above. |
static double[] |
thresholdsStd
Thresholds for the std method corresponding to the percentages above. |
Fields inherited from class vector_aggregation.AbstractFeatureAggregator |
---|
codebook, descriptorLength, numCentroids, vectorLength |
Constructor Summary | |
---|---|
VladAggregatorWithFiltering(double[][] codebook,
VladAggregatorWithFiltering.FilteringMethod filteringMethod,
double percentage)
Contructor. |
Method Summary | |
---|---|
double[] |
aggregateInternal(java.util.ArrayList<double[]> descriptors)
Takes as input an ArrayList of double arrays which contains the set of local features for an image. |
double[] |
aggregateInternal(double[][] features)
Takes as input 2-dimensional double array which contains the set of local features for an image. |
static void |
computeDistributionOfDistances(java.lang.String featuresFolder,
int numFiles,
java.lang.String featureType,
java.lang.String featureNormalization,
int featureLength,
java.lang.String codebookFile,
int numCentroids)
This method takes as input a folder containing .surf or .sift files extracted from a set of images, quantizes all the descriptors against a given codebooks and writes in a file the distribution of distances in each centroid. |
protected int |
computeNearestCentroidRejectDistribution(double[] feature)
Returns the index of the centroid which is closer to the given feature or -1 if the feature is rejected. |
protected int |
computeNearestCentroidRejectRatio(double[] feature)
Returns the index of the centroid which is closer to the given feature or -1 if the feature is rejected. |
protected int |
computeNearestCentroidRejectStd(double[] feature)
Returns the index of the centroid which is closer to the given feature or -1 if the feature is rejected. |
long |
getDescriptorsRejected()
|
int |
getVectorLength()
Should compute and return the length of the generated vector. |
static void |
main(java.lang.String[] args)
This method can be used for calculating the percentage values in the distribution method. |
void |
setPercentiles(java.lang.String fileName)
This method sets the percentile values used by the dist methdod. |
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 |
---|
private VladAggregatorWithFiltering.FilteringMethod filteringMethod
VladAggregatorWithFiltering.FilteringMethod
to be used.
private double numStds
private double ratio
private double percentage
public static final double[] percentages
public static final double[] thresholdsStd
public static final double[] thresholdsRatio
private double[] thresholdsDist
setPercentiles(String)
method.
private long featuresRejected
Constructor Detail |
---|
public VladAggregatorWithFiltering(double[][] codebook, VladAggregatorWithFiltering.FilteringMethod filteringMethod, double percentage) throws java.lang.Exception
codebook
- filteringMethod
- percentage
-
java.lang.Exception
Method Detail |
---|
public long getDescriptorsRejected()
public double[] aggregateInternal(double[][] features) throws java.lang.Exception
aggregateInternal
in class AbstractFeatureAggregator
java.lang.Exception
public double[] aggregateInternal(java.util.ArrayList<double[]> descriptors) throws java.lang.Exception
aggregateInternal
in class AbstractFeatureAggregator
java.lang.Exception
protected int computeNearestCentroidRejectStd(double[] feature)
feature
-
protected int computeNearestCentroidRejectRatio(double[] feature)
feature
-
protected int computeNearestCentroidRejectDistribution(double[] feature)
feature
-
public int getVectorLength()
AbstractFeatureAggregator
getVectorLength
in class AbstractFeatureAggregator
public void setPercentiles(java.lang.String fileName) throws java.io.IOException
fileName
-
java.io.IOException
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- [0] Full path to the folder containing the local features (use backslashes).
java.lang.Exception
public static void computeDistributionOfDistances(java.lang.String featuresFolder, int numFiles, java.lang.String featureType, java.lang.String featureNormalization, int featureLength, java.lang.String codebookFile, int numCentroids) throws java.lang.Exception
featuresFolder
- numFiles
- featureType
- featureNormalization
- featureLength
- codebookFile
- numCentroids
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |