Doxygen
|
|
header file for face detection routines More...
Go to the source code of this file.
Classes | |
struct | square |
Typedefs | |
typedef Matrix< long double, Dynamic, Dynamic > | MatrixXld |
Functions | |
MatrixXf * | convertToColor (const char *inputName, int &nRows, int &nCols, bool &isColor) |
convert a grayscale image to a RGB More... | |
VectorXf | readInCascade (vector< stumpRule > *&cascade) |
cascade More... | |
int | round (int digit, double scale) |
round the real number digit*scale More... | |
void | postProcessing (int nRows, int nCols, float nFriends, vector< square > &areas) |
toss out several more false positives and beautify the highlighting More... | |
void | highlight (const char *inputName, vector< square > &areas, int PPMode, float nFriends) |
highlight the faces so that we can see them More... | |
bool | detectFace (square const &area, MatrixXld &integralImage, double varianceNormalizer, VectorXf &tweaks, vector< stumpRule > const *cascade, int defaultLayerNumber) |
detect face in an image subwindow More... | |
double | computeFeature (int featureIndex, square const &area, MatrixXld &integralImage, bool removeMean) |
compute the feature from an image subwindow More... | |
void | scan (const char *file, int defaultLayerNumber, float nFriends) |
detect faces on an image More... | |
void | gaussianSmoothing (MatrixXf *image, float sigma) |
convolute an image with a Gaussian kernel More... | |
float | gaussianKernel (float sigmaSquare, int ref, int cur) |
calculate the gaussian density up to a constant More... | |
void | gaussianRowSmoothing (MatrixXf &image, float sigma, int row, int nRows) |
convolute row-wise an image with a Gaussian kernel More... | |
bool | zoomOutNegative (MatrixXf *&image, int shrinkedSize, int defaultLayerNumber, vector< stumpRule > *cascade, VectorXf &tweaks) |
try to make an example out of a false positive window More... | |
bool | exampleScan (MatrixXf &example, int defaultLayerNumber, vector< stumpRule > const *cascade, VectorXf &tweaks) |
scan a standard example More... | |
void | tscan (const char *file, int &nRows, int &nCols, int defaultLayerNumber, vector< stumpRule > *cascade, VectorXf &tweaks, vector< square > &toMark) |
scan the whole image using a cascade More... | |
void | computeHaarLikeFeatures (MatrixXf &image, VectorXf *&features, const char *toFile, bool enforceShape, bool inTrain) |
compute Haar-like features with integral image More... | |
void | rotateCoordinate (int input_i, int input_j, int center_i, int center_j, float theta, int &output_i, int &output_j) |
void | rotateImage (const char *infile, const char *outfile, float theta, int ¢er_i, int ¢er_j) |
bool | isLegal (square &area, int nRows, int nCols) |
header file for face detection routines
Definition in file detectUtil.h.
typedef Matrix<long double,Dynamic,Dynamic> MatrixXld |
Definition at line 30 of file detectUtil.h.
double computeFeature | ( | int | featureIndex, |
square const & | area, | ||
MatrixXld & | integralImage, | ||
bool | removeMean | ||
) |
compute the feature from an image subwindow
featureIndex | which feature |
area | the subwindow in question |
integralImage | the whole image's integral image |
removeMean | in the preprocessing, shall we remove the subwindow's mean |
Definition at line 369 of file detectUtil.cpp.
void computeHaarLikeFeatures | ( | MatrixXf & | image, |
VectorXf *& | features, | ||
const char * | toFile, | ||
bool | enforceShape, | ||
bool | inTrain | ||
) |
compute Haar-like features with integral image
integralImage | its integral image |
features | all the features from this image |
the | order in which features are arranged are put in toFile |
enforceShape | the original Viola-Jones's proposal or more extensive definition of rectangle features (requires significantly more memory if disabled) |
inTrain | am I in the training mode |
Definition at line 726 of file detectUtil.cpp.
MatrixXf* convertToColor | ( | const char * | inputName, |
int & | nRows, | ||
int & | nCols, | ||
bool & | isColor | ||
) |
convert a grayscale image to a RGB
inputName | which image |
the | return image's row numbers |
the | return image's column numbers |
Definition at line 187 of file detectUtil.cpp.
bool detectFace | ( | square const & | area, |
MatrixXld & | integralImage, | ||
double | varianceNormalizer, | ||
VectorXf & | tweaks, | ||
vector< stumpRule > const * | cascade, | ||
int | defaultLayerNumber | ||
) |
detect face in an image subwindow
area | the subwindow's parameters |
integralImage | the whole image's integral image |
varianceNormalizer | for the image preprocessing |
tweaks | shifts applied to the cascade layers |
cascade | |
defaultLayerNumber | how many layers should be used |
Definition at line 325 of file detectUtil.cpp.
bool exampleScan | ( | MatrixXf & | example, |
int | defaultLayerNumber, | ||
vector< stumpRule > const * | cascade, | ||
VectorXf & | tweaks | ||
) |
scan a standard example
example | a standard training or validation example |
defaultLayerNumber | how many layers are there in the cascade |
cascade | |
tweaks | shifts applied to the cascade layers |
Definition at line 488 of file detectUtil.cpp.
|
inline |
calculate the gaussian density up to a constant
2 | times Gaussian kernel's variance |
ref | the point on which the density is centered |
cur | the point for which the density shall be computed |
Definition at line 68 of file detectUtil.cpp.
void gaussianRowSmoothing | ( | MatrixXf & | image, |
float | sigma, | ||
int | row, | ||
int | nRows | ||
) |
convolute row-wise an image with a Gaussian kernel
image | |
Gaussian | kernel's standard deviation |
row | which row |
nRows | the number of pixels in this row |
Definition at line 77 of file detectUtil.cpp.
void gaussianSmoothing | ( | MatrixXf * | image, |
float | sigma | ||
) |
convolute an image with a Gaussian kernel
image | |
sigma | the standard deviation of the kernel |
Definition at line 53 of file detectUtil.cpp.
void highlight | ( | const char * | inputName, |
vector< square > & | areas, | ||
int | PPMode, | ||
float | nFriends | ||
) |
highlight the faces so that we can see them
inputName | which image |
areas | where the found faces are |
Definition at line 272 of file detectUtil.cpp.
bool isLegal | ( | square & | area, |
int | nRows, | ||
int | nCols | ||
) |
Definition at line 602 of file detectUtil.cpp.
void postProcessing | ( | int | nRows, |
int | nCols, | ||
float | nFriends, | ||
vector< square > & | areas | ||
) |
toss out several more false positives and beautify the highlighting
nRows | |
nCols | |
areas | selected by the cascade and refined by postProcessing |
Definition at line 637 of file detectUtil.cpp.
VectorXf readInCascade | ( | vector< stumpRule > *& | cascade | ) |
cascade
cascade | returned cascade |
Definition at line 158 of file detectUtil.cpp.
void rotateCoordinate | ( | int | input_i, |
int | input_j, | ||
int | center_i, | ||
int | center_j, | ||
float | theta, | ||
int & | output_i, | ||
int & | output_j | ||
) |
Definition at line 933 of file detectUtil.cpp.
void rotateImage | ( | const char * | infile, |
const char * | outfile, | ||
float | theta, | ||
int & | center_i, | ||
int & | center_j | ||
) |
Definition at line 952 of file detectUtil.cpp.
|
inline |
round the real number digit*scale
digit | |
scale |
Definition at line 361 of file detectUtil.cpp.
void scan | ( | const char * | file, |
int | defaultLayerNumber, | ||
float | nFriends | ||
) |
detect faces on an image
file | image name |
defaultLayerNumber | how many layers should be used |
Definition at line 513 of file detectUtil.cpp.
void tscan | ( | const char * | file, |
int & | nRows, | ||
int & | nCols, | ||
int | defaultLayerNumber, | ||
vector< stumpRule > * | cascade, | ||
VectorXf & | tweaks, | ||
vector< square > & | toMark | ||
) |
scan the whole image using a cascade
file | image |
defaultLayerNumber | how many layers are there in the cascade |
cascade | |
tweaks | shifts applied to the cascade layers |
toMark | the windows recognized as a face |
Definition at line 550 of file detectUtil.cpp.
bool zoomOutNegative | ( | MatrixXf *& | image, |
int | shrinkedSize, | ||
int | defaultLayerNumber, | ||
vector< stumpRule > * | cascade, | ||
VectorXf & | tweaks | ||
) |
try to make an example out of a false positive window
image | a false positive window |
default | example size |
defaultLayerNumber | how many layers are there in the cascade |
cascade | |
tweaks | shifts applied to the cascade layers |
Definition at line 106 of file detectUtil.cpp.