Fawkes API  Fawkes Development Version
firevision::FacesClassifier Class Reference

Faces classifier. More...

#include <>>

Inheritance diagram for firevision::FacesClassifier:

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. More...
 
virtual ~FacesClassifier ()
 Destructor. More...
 
virtual std::list< ROI > * classify ()
 Classify image. More...
 
- Public Member Functions inherited from firevision::Classifier
 Classifier (const char *name)
 Constructor. More...
 
virtual ~Classifier ()
 Destructor. More...
 
virtual void set_src_buffer (unsigned char *yuv422_planar, unsigned int width, unsigned int height)
 Set source buffer. More...
 
virtual const char * name () const
 Get name of classifier. More...
 

Additional Inherited Members

- Protected Attributes inherited from firevision::Classifier
unsigned char * _src
 Source buffer, encoded as YUV422_PLANAR. More...
 
unsigned int _width
 Width in pixels of _src buffer. More...
 
unsigned int _height
 Height in pixels of _src buffer. More...
 

Detailed Description

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.

Author
Tim Niemueller

Definition at line 38 of file faces.h.

Constructor & Destructor Documentation

◆ FacesClassifier()

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.

Parameters
haarcascade_fileHaar cascade file to use
pixel_widthwidth of images that will be processed
pixel_heightheight of images that will be processed
imageOptional 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_factorHaar scale factor
min_neighboursminimum neighbours
flagsflags, can only be CV_HAAR_DO_CANNY_PRUNING at the moment.

Definition at line 64 of file faces.cpp.

◆ ~FacesClassifier()

firevision::FacesClassifier::~FacesClassifier ( )
virtual

Destructor.

Definition at line 96 of file faces.cpp.

Member Function Documentation

◆ classify()

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.

Returns
disjunct list of extracted 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.


The documentation for this class was generated from the following files: