| Home | Trees | Indices | Help |
|---|
|
|
|
|||
| THaarClassifier | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Generate all rectangular Haar-like features, of a specific 'appearance'. All rectangles are bounded by a M-by-N image patch.
|
Find all Haar-like features, applied on a M-by-N image patch.
|
Take a set of Haar features and subsample it.
Input:
haars: a set of Haar features, output of generate_Haars()
ratio: the ratio to subsample, if 'haars' has N features,
the output 'haars' will have roughly ratio*N features
Output:
ohaars: a smaller set of Haar features
|
Consider T Haar features generated by generate_Haars().
For each feature: project, compute the statistics of the two classes,
then refine if needed. Return a list of J*2-class Stats2e, each for each
type of Haar features.
Input:
stats2: The 'global' statistics of the two classes, can be obtained
by calling compute_Stats2_integral()
haars: the T Haar features generated, by caling generate_Haars()
Output:
B: a list of J*2-class Stats2e, each for each type of Haar features.
invert: a list of numpy.arrays, each array tells whether which feature
needs negating its projection direction
|
Take a 2-class ClassificationDataset, obtain the global statistics,
then project using different Haar directions.
Input:
cd: a 2-class ClassificationDataset
haars: the generated Haar feature set of J features
Output: output of _project_Haar_stats() actually
B: a list of J*2-class Stats2e, each for each type of Haar features.
invert: a list of numpy.arrays, each array tells whether which feature
needs negating its projection direction
|
Project the input data into a line using haar direction specified by coefficients 'A' and indices 'ind'
|
|
Given local statistics, train a THaarClassifier.
Select the 'best' Haar feature in the set.
The features are trained using one of three criteria:
crit = 0: param1 is 'thelambda', then call gaussian.find_classification_threshold()
crit = 1: param1 is 'minDR', then call gaussian.find_filtering_threshold()
crit = 2: param1 is 'maxFAR', then call gaussian.find_filtering_threshold2()
Input:
Binvert: (B,invert), is output of get_local_stats() actually
B: a list of J*2-class Stats2e, each for each type of Haar features.
invert: a list of numpy.arrays, each array tells whether which feature
needs negating its projection direction
haars: the generated Haar feature set of J features
crit, param1: as mentioned above
Output:
lc: a THaarClassifier, with lc.err as the estimated 'error'
|
Take a 2-class ClassificationDataset, then train a THaarClassifier. Select the 'best' Haar feature in the set. This function actually calls get_local_stats(), followed by train_Haar_with_local_stats()
|
Take a ScoringCDataset, then train a THaarClassifier 'filter' using UAC.
Select the 'best' Haar feature in the set.
Input:
scd: a ScoringCDataset -- must be vectorintegrated
haars: the generated Haar feature set
rmaxFRR, rmaxFAR: train 'filter' to reject if there is a classifier
that can do FRR <= rmaxFRR and FAR <= rmaxFAR
Output:
lc: a THaarClassifier, with:
lc.sol: training (FRR,FAR)
c: voting coefficient
both lc and c will be None if there's no filter satisfied
|
Take a ScoringCDataset, then train a THaarClassifier 'filter' using UAC.
Select the 'best' Haar feature in the set.
Input:
scd: a ScoringCDataset -- must be vectorintegrated
haars: the generated Haar feature set
rmaxFRR, rmaxFAR: train 'filter' to reject if there is a classifier
that can do FRR <= rmaxFRR and FAR <= rmaxFAR
Output:
lc: a THaarClassifier, with:
lc.sol: training (FRR,FAR)
c: voting coefficient
both lc and c will be None if there's no filter satisfied
|
Take a ScoringCDataset, then train a THaarClassifier 'improver' using UAC. Select the 'best' Haar feature in the set.
|
Take a CDataset, then train a GeneralizedCascade of THaarClassifiers.
Input:
scd: a 2-class ScoringCDataset -- must be vectorintegrated
scd *is modified* after the training process
cdgenerator: a CDGenerator that can generate negative points for scd
haars: the generated Haar feature set
thelambda: the goal for 'improver' is to minimize thelambda*FRR+FAR
rmaxFRR, rmaxFAR: train 'filter' to reject if there is a classifier
that can do FRR <= rmaxFRR and FAR <= rmaxFAR
Output:
gc: a GeneralizedCascade
|
Train Sparse Rectangular features and select the best feature classifier.
Suppose we have 2 classes c: positive and negative.
Suppose the vector-integrated version of an image of size 'len'-by-'len'
is a random vector y.
Let 'stats' be the Stats2 statistics of the two classes.
Consider 'criterion' and 'param1' described in sdGTSolve().
Now consider the following features called Sparse Rectangular features:
H = \sum_{k=1}^{nrects} a_k \pi(x_k,y_k,w_k,h_k)
This function trains and selects the 'best' Sparse Rectangular feature
classifier based on sdGTSolve()'s criterion.
The classifier is as follows:
return sign( (H \convolve I) - threshold )
The underlying algorithm is Differential Evolution.
It runs for 'nseconds' seconds.
:Parameters:
stats : Stats2
Statistics of the 2 classes
criterion : int
from 0 to 3, used in conjunction with param1, see sdGTSolve()
param1 : double
see 'criterion'
nrects : int
number of rectangles of the sparse feature
nseconds : double
this algorithm uses Differential Evolution, so this tells at
most how many seconds to run
:Returns:
fc: THaarClassifier
the best feature classifier obtained
fc.err is the estimated 'error' obtained
ngen : int
number of generations used in DE
ngenome : int
number of genomes generated in DE
nvgenome : int
number of *valid* genomes generated in DE
|
A training function that takes in a WeightedCDataset and produces a weak BinaryClassifier. This training function uses train_SRClassifier() to train but with 6 rectangles and 2 seconds. Also, the threshold of the weak classifier is refined after training. The objective is to minimize classification error with lambda = 1.0
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Mon Feb 25 10:24:14 2008 | http://epydoc.sourceforge.net |