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
ConstructorDescriptionFeatureToWordHistogram_F64
(AssignCluster<double[]> assignment, boolean hardAssignment) Assigns and configures internal algorithms. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeature
(TupleDesc_F64 feature) Adds a feature to the histogramdouble[]
Histogram of word frequencies.int
The total number of words used to create this histogramvoid
process()
No more features are being added.void
reset()
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:FeatureToWordHistogram
Must be called beforeFeatureToWordHistogram.addFeature(boofcv.struct.feature.TupleDesc)
is called.- Specified by:
reset
in interfaceFeatureToWordHistogram<TupleDesc_F64>
-
addFeature
Description copied from interface:FeatureToWordHistogram
Adds a feature to the histogram- Specified by:
addFeature
in 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:
process
in interfaceFeatureToWordHistogram<TupleDesc_F64>
-
getHistogram
public double[] getHistogram()Histogram of word frequencies. Normalized such that the sum is equal to 1.- Specified by:
getHistogram
in interfaceFeatureToWordHistogram<TupleDesc_F64>
- Returns:
- histogram
-
getTotalWords
public int getTotalWords()The total number of words used to create this histogram- Specified by:
getTotalWords
in interfaceFeatureToWordHistogram<TupleDesc_F64>
-