Package boofcv.alg.scene
Interface FeatureToWordHistogram<Desc extends TupleDesc>
- All Known Implementing Classes:
FeatureToWordHistogram_F64
public interface FeatureToWordHistogram<Desc extends TupleDesc>
Used to construct a normalized histogram which represents the frequency of certain words in an image for use
in a BOW based classifier. Features are added one at a time and internally placed in the histogram. When
there are no more features left
process()
is called and the histogram computed. The returned histogram
will be normalized such that it sums up to one. This normalization makes it more tolerant to images of
different sized and sampling frequency. Call reset()
when the next image is ready.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeature
(Desc feature) Adds a feature to the histogramdouble[]
Histogram of word frequencies.int
Number of elements in the histogram.void
process()
No more features are being added.void
reset()
Must be called beforeaddFeature(boofcv.struct.feature.TupleDesc)
is called.
-
Method Details
-
reset
void reset()Must be called beforeaddFeature(boofcv.struct.feature.TupleDesc)
is called. -
addFeature
Adds a feature to the histogram- Parameters:
feature
- A feature which is to be matched to words. Not modified.
-
process
void process()No more features are being added. Normalized the computed histogram. -
getHistogram
double[] getHistogram()Histogram of word frequencies. Normalized such that the sum is equal to 1.- Returns:
- histogram
-
getTotalWords
int getTotalWords()Number of elements in the histogram. Which is the number of words the features are assigned to.
-