Package boofcv.alg.scene
Class FeatureToWordHistogram_F64
java.lang.Object
boofcv.alg.scene.FeatureToWordHistogram_F64
- All Implemented Interfaces:
FeatureToWordHistogram<TupleDesc_F64>
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.
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureToWordHistogram_F64(AssignCluster<double[]> assignment, boolean hardAssignment) Assigns and configures internal algorithms. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeature(TupleDesc_F64 feature) Adds a feature to the histogramdouble[]Histogram of word frequencies.intThe total number of words used to create this histogramvoidprocess()No more features are being added.voidreset()Must be called beforeFeatureToWordHistogram.addFeature(boofcv.struct.feature.TupleDesc)is called.
-
Constructor Details
-
FeatureToWordHistogram_F64
Assigns and configures internal algorithms.- Parameters:
assignment- Specifies the assignment algorithmhardAssignment- true for hard assignment and false for soft assignment
-
-
Method Details
-
reset
public void reset()Description copied from interface:FeatureToWordHistogramMust be called beforeFeatureToWordHistogram.addFeature(boofcv.struct.feature.TupleDesc)is called.- Specified by:
resetin interfaceFeatureToWordHistogram<TupleDesc_F64>
-
addFeature
Description copied from interface:FeatureToWordHistogramAdds a feature to the histogram- Specified by:
addFeaturein interfaceFeatureToWordHistogram<TupleDesc_F64>- Parameters:
feature- A feature which is to be matched to words. Not modified.
-
process
public void process()No more features are being added. Normalized the computed histogram.- Specified by:
processin interfaceFeatureToWordHistogram<TupleDesc_F64>
-
getHistogram
public double[] getHistogram()Histogram of word frequencies. Normalized such that the sum is equal to 1.- Specified by:
getHistogramin interfaceFeatureToWordHistogram<TupleDesc_F64>- Returns:
- histogram
-
getTotalWords
public int getTotalWords()The total number of words used to create this histogram- Specified by:
getTotalWordsin interfaceFeatureToWordHistogram<TupleDesc_F64>
-