public class FeatureToWordHistogram_F64 extends Object implements FeatureToWordHistogram<TupleDesc_F64>
Creates a normalized histogram which represents the frequency of different visual words from the set of features. Both hard and soft assignment can be used. For hard assignment all the weight is given to the word which is the best fit to the feature. In soft the relative similarity between the words is used to assign values to the histogram.
With hard assignment a single word is selected. With soft a fraction is assigned to each word based on
a distance metric. See
AssignCluster for the details.
Constructors Constructor Description
AssignCluster<double> assignment, boolean hardAssignment)(Assigns and configures internal algorithms.
Modifier and Type Method Description
TupleDesc_F64 feature)(Adds a feature to the histogram
()Histogram of word frequencies.
()The total number of words used to create this histogram
()No more features are being added.
()Must be called before
FeatureToWordHistogram_F64public FeatureToWordHistogram_F64(AssignCluster<double> assignment, boolean hardAssignment)Assigns and configures internal algorithms.
assignment- Specifies the assignment algorithm
hardAssignment- true for hard assignment and false for soft assignment
resetpublic void reset()Description copied from interface:
FeatureToWordHistogramMust be called before
addFeaturepublic void addFeature(TupleDesc_F64 feature)Description copied from interface:
FeatureToWordHistogramAdds a feature to the histogram
processpublic void process()No more features are being added. Normalized the computed histogram.
getHistogrampublic double getHistogram()Histogram of word frequencies. Normalized such that the sum is equal to 1.
getTotalWordspublic int getTotalWords()The total number of words used to create this histogram