public class EnsembleClassifier extends Object
Modifier and Type | Field and Description |
---|---|
boolean |
enabled
Whether this classifier is enabled
|
int |
numFeatures
The number of bits per feature (each feature is in fact held as an int of bits, default = 13)
|
int |
numTrees
The number of trees, each with
numFeatures features (default = 10) |
Modifier and Type | Method and Description |
---|---|
float |
calcConfidence(int[] featureVector,
int featureVectorIndex)
sum the probability calculated for each tree with the calculated feature value (which
is in fact the index into the posteriors array)
|
void |
calcFeatureVector(int windowIdx,
int[] featureVector,
int featureVectorIndex)
For a window index, calculate the feature values for each tree.
|
boolean |
filter(int i)
find the proability of this window and return true if this window is more
than 50% likely.
|
void |
learn(FImage img,
boolean positive,
int[] featureVector,
int featureIndex)
Calculate the confidence of the given feature vector at a given index (which is
the feature vector of a particular window).
|
void |
nextIteration(FImage img) |
void |
setScales(Rectangle[] scales) |
void |
setWindowOffsets(int[][] windowOffsets) |
void |
updatePosterior(int treeIdx,
int idx,
boolean positive,
int amount)
An array index is calculated from treeIdx (the y) and the calculated
feature index (the x) so: (y * width) + x where width is the maximum feature
index (2 ^ numverOfFeatures).
|
void |
updatePosteriors(int[] featureVector,
int featureIndex,
boolean positive,
int amount)
Update the calculated feature value in every tree.
|
public boolean enabled
public int numTrees
numFeatures
features (default = 10)public int numFeatures
public void nextIteration(FImage img)
img
- just sets the image internally read to be used to calculate the featurepublic void calcFeatureVector(int windowIdx, int[] featureVector, int featureVectorIndex)
windowIdx
- featureVector
- featureVectorIndex
- public float calcConfidence(int[] featureVector, int featureVectorIndex)
featureVector
- featureVectorIndex
- public boolean filter(int i)
i
- public void updatePosterior(int treeIdx, int idx, boolean positive, int amount)
treeIdx
- idx
- positive
- amount
- public void updatePosteriors(int[] featureVector, int featureIndex, boolean positive, int amount)
featureVector
- featureIndex
- positive
- amount
- public void learn(FImage img, boolean positive, int[] featureVector, int featureIndex)
img
- positive
- featureVector
- featureIndex
- public void setWindowOffsets(int[][] windowOffsets)
windowOffsets
- the location of each window