Faces classifier. More...
#include <classifiers/faces.h>
Public Member Functions | |
FacesClassifier (const char *haarcascade_file, unsigned int pixel_width, unsigned int pixel_height, IplImage *image=0, float haar_scale_factor=1.1, int min_neighbours=3, int flags=0) | |
Constructor. | |
virtual | ~FacesClassifier () |
Destructor. | |
virtual std::list< ROI > * | classify () |
Classify image. |
Faces classifier.
This class provides a classifier that uses OpenCV to detect images in the given image. The faces are reported back as regions of interest. Each ROI is considered to contain a face.
This code is based on the OpenCV example provided and works with the Haar cascade files that come with OpenCV. The code is based on investigations by Stefan Schiffer.
Definition at line 38 of file faces.h.
firevision::FacesClassifier::FacesClassifier | ( | const char * | haarcascade_file, | |
unsigned int | pixel_width, | |||
unsigned int | pixel_height, | |||
IplImage * | image = 0 , |
|||
float | haar_scale_factor = 1.1 , |
|||
int | min_neighbours = 3 , |
|||
int | flags = 0 | |||
) |
Constructor.
haarcascade_file | Haar cascade file to use | |
pixel_width | width of images that will be processed | |
pixel_height | height of images that will be processed | |
image | Optional image that is used by the classifier. If this image is NULL an internal IplImage is created and the buffer converted. If you need the buffer anyway pass a pointer to this image to do the conversion only once. In that case the classifier assume that the image has already been converted! | |
haar_scale_factor | Haar scale factor | |
min_neighbours | minimum neighbours | |
flags | flags, can only be CV_HAAR_DO_CANNY_PRUNING at the moment. |
firevision::FacesClassifier::~FacesClassifier | ( | ) | [virtual] |
std::list< ROI > * firevision::FacesClassifier::classify | ( | ) | [virtual] |
Classify image.
The current buffer is processed and scanned for the features the classifier has been written and initialized for. It returns a list of disjunct regions of interest.
Implements firevision::Classifier.
Definition at line 107 of file faces.cpp.
References firevision::Classifier::_height, firevision::Classifier::_src, firevision::Classifier::_width, firevision::IplImageAdapter::convert_image_bgr(), and firevision::ROI::num_hint_points.