| Home | Trees | Indices | Help |
|---|
|
|
An umbrella package containing all Computer Vision packages.
For researchers, if you are using any of the methods in this package,
please accept the following term:
- Any published result, involving training a weak classifier using
Haar-like features, based on running any method in the 'haar.py'
module, must cite the following paper:
@INPROCEEDINGS{Pham2007a,
author = {Minh-Tri Pham and Tat-Jen Cham},
title = {Fast Training and Selection of Haar features using Statistisc in Boosting-based Face Detection},
booktitle = {11th IEEE International Conference on Computer Vision (ICCV 2007)},
year = {2007},
address = {Rio de Janeiro, Brazil}
}
|
|||
| |||
|
|||
|
ImageView A rotated rectangular view of an image. |
|||
| THaarClassifier | |||
| ObjectDetectionInfo | |||
| ObjectDetector | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| __doc__ | |||
datapath =
|
|||
|
|||
Convert a POINTER(CvMat) into numpy.array
|
Convert a POINTER(IplImage) into numpy.array
|
Convert an image of type uint8 into an image integral of type double.
|
Convert an image of type uint8 into an image integral of type uint32.
|
Similar to stats.statslist(), but integrate each image of type uint8 first, then vectorize, then do the stats.
|
Convert an image of type uint8 into an image integral of type int32.
|
Given a J-class ClassificationDataset of image patches. The patches are either in 'uint8' raw form (vi = False), or in 'double' vectorintegrated form (vi = True)
|
Given a list of image patches, integrate then vectorize them all.
|
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()
|
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
|
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
|
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
|
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 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
|
|
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
|
Find all Haar-like features, applied on a M-by-N image patch.
|
|
|||
datapath
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Mon Feb 25 10:24:14 2008 | http://epydoc.sourceforge.net |