public class FeatureToWordHistogram_F64 extends java.lang.Object implements FeatureToWordHistogram<boofcv.struct.feature.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 and Description |
|---|
FeatureToWordHistogram_F64(org.ddogleg.clustering.AssignCluster<double[]> assignment,
boolean hardAssignment)
Assigns and configures internal algorithms.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFeature(boofcv.struct.feature.TupleDesc_F64 feature)
Adds a feature to the histogram
|
double[] |
getHistogram()
Histogram of word frequencies.
|
int |
getTotalWords()
The total number of words used to create this histogram
|
void |
process()
No more features are being added.
|
void |
reset()
Must be called before
FeatureToWordHistogram.addFeature(boofcv.struct.feature.TupleDesc) is called. |
public FeatureToWordHistogram_F64(org.ddogleg.clustering.AssignCluster<double[]> assignment,
boolean hardAssignment)
assignment - Specifies the assignment algorithmhardAssignment - true for hard assignment and false for soft assignmentpublic void reset()
FeatureToWordHistogramFeatureToWordHistogram.addFeature(boofcv.struct.feature.TupleDesc) is called.reset in interface FeatureToWordHistogram<boofcv.struct.feature.TupleDesc_F64>public void addFeature(boofcv.struct.feature.TupleDesc_F64 feature)
FeatureToWordHistogramaddFeature in interface FeatureToWordHistogram<boofcv.struct.feature.TupleDesc_F64>feature - A feature which is to be matched to words. Not modified.public void process()
process in interface FeatureToWordHistogram<boofcv.struct.feature.TupleDesc_F64>public double[] getHistogram()
getHistogram in interface FeatureToWordHistogram<boofcv.struct.feature.TupleDesc_F64>public int getTotalWords()
getTotalWords in interface FeatureToWordHistogram<boofcv.struct.feature.TupleDesc_F64>