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 java.lang.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
AssignClusterfor the details.
-
-
Constructor Summary
Constructors Constructor and Description FeatureToWordHistogram_F64(AssignCluster<double[]> assignment, boolean hardAssignment)Assigns and configures internal algorithms.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddFeature(TupleDesc_F64 feature)Adds a feature to the histogramdouble[]getHistogram()Histogram of word frequencies.intgetTotalWords()The 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 Detail
-
FeatureToWordHistogram_F64
public FeatureToWordHistogram_F64(AssignCluster<double[]> assignment, boolean hardAssignment)
Assigns and configures internal algorithms.- Parameters:
assignment- Specifies the assignment algorithmhardAssignment- true for hard assignment and false for soft assignment
-
-
Method Detail
-
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
public void addFeature(TupleDesc_F64 feature)
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>
-
-
DataMelt 3.0 © DataMelt by jWork.ORG