public class TldFernClassifier<T extends boofcv.struct.image.ImageGray<T>>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected TldFernDescription[] |
ferns |
protected TldFernManager[] |
managers |
protected int |
maxN |
protected int |
maxP |
| Modifier | Constructor and Description |
|---|---|
protected |
TldFernClassifier() |
|
TldFernClassifier(java.util.Random rand,
int numFerns,
int descriptorSize,
int numLearnRandom,
float fernLearnNoise,
boofcv.alg.interpolate.InterpolatePixelS<T> interpolate)
Configures fern algorithm
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
computeFernValue(float c_x,
float c_y,
float rectWidth,
float rectHeight,
TldFernDescription fern)
Computes the value of the specified fern at the specified location in the image.
|
protected int |
computeFernValueRand(float c_x,
float c_y,
float rectWidth,
float rectHeight,
TldFernDescription fern)
Computes the value of a fern after adding noise to the image being sampled.
|
int |
getMaxN() |
int |
getMaxP() |
void |
learnFern(boolean positive,
boofcv.struct.ImageRectangle r)
Learns a fern from the specified region.
|
void |
learnFernNoise(boolean positive,
boofcv.struct.ImageRectangle r)
Computes the value for each fern inside the region and update's their P and N value.
|
boolean |
lookupFernPN(TldRegionFernInfo info)
For the specified regions, computes the values of each fern inside of it and then retrives their P and N values.
|
void |
renormalizeN()
Renormalizes fern.numN to avoid overflow
|
void |
renormalizeP()
Renormalizes fern.numP to avoid overflow
|
void |
reset()
Discard all information on fern values and their probabilities
|
void |
setImage(T gray)
Call before any other functions.
|
protected int maxP
protected int maxN
protected TldFernDescription[] ferns
protected TldFernManager[] managers
public TldFernClassifier(java.util.Random rand,
int numFerns,
int descriptorSize,
int numLearnRandom,
float fernLearnNoise,
boofcv.alg.interpolate.InterpolatePixelS<T> interpolate)
rand - Random number generated used for creating fernsnumFerns - Number of ferns to created. Typically 10descriptorSize - Size of each fern's descriptor. Typically 10numLearnRandom - Number of ferns which will be generated by adding noise to the imagefernLearnNoise - The noise's standard deviationinterpolate - Interpolation function for the imageprotected TldFernClassifier()
public void reset()
public void setImage(T gray)
gray - Input image.public void learnFern(boolean positive,
boofcv.struct.ImageRectangle r)
public void learnFernNoise(boolean positive,
boofcv.struct.ImageRectangle r)
public boolean lookupFernPN(TldRegionFernInfo info)
info - (Input) Location/Rectangle (output) P and N valuesprotected int computeFernValue(float c_x,
float c_y,
float rectWidth,
float rectHeight,
TldFernDescription fern)
protected int computeFernValueRand(float c_x,
float c_y,
float rectWidth,
float rectHeight,
TldFernDescription fern)
public void renormalizeP()
public void renormalizeN()
public int getMaxP()
public int getMaxN()