RAPP Platform  v0.6.0
RAPP Platform is a collection of ROS nodes and back-end processes that aim to deliver ready-to-use generic services to robots
 All Classes Namespaces Files Functions Variables Macros
FaceDetector Class Reference

Class that implements a face detection algorithm based on a Haar cascade classifier. More...

#include <face_detector.h>

Public Member Functions

 FaceDetector (void)
 Default constructor. More...
 
std::vector< cv::Rect > detectFaces (const cv::Mat &input_img, bool fast=false)
 Detects faces from a cv::Mat. More...
 
std::vector< cv::Rect > findFaces (std::string file_name, bool fast=false)
 Finds faces in an image retrieved from a file URL. More...
 
cv::Mat loadImage (std::string file_name)
 Loads an image from a file URL. More...
 

Private Member Functions

std::vector< cv::Rect > detectFaces (const cv::Mat &input_img, const std::string &haar_path)
 Detects faces from a cv::Mat. More...
 
std::vector< cv::Rect > identifyUniqueFaces (const std::vector< cv::Rect > firstFaceVector, const std::vector< cv::Rect > secondFaceVector)
 Identify unique faces from two sets of faces. More...
 

Detailed Description

Class that implements a face detection algorithm based on a Haar cascade classifier.

Definition at line 33 of file face_detector.h.

Constructor & Destructor Documentation

FaceDetector::FaceDetector ( void  )

Default constructor.

Definition at line 26 of file face_detector.cpp.

Member Function Documentation

std::vector< cv::Rect > FaceDetector::detectFaces ( const cv::Mat &  input_img,
bool  fast = false 
)

Detects faces from a cv::Mat.

Parameters
input_img[const cv::Mat&] The input image
fast[bool] True for fast detection – frontal only
Returns
[std::vector<cv::Rect>] A vector containing the detected faces. Each face is represented by a rectangle.

Definition at line 50 of file face_detector.cpp.

std::vector< cv::Rect > FaceDetector::detectFaces ( const cv::Mat &  input_img,
const std::string &  haar_path 
)
private

Detects faces from a cv::Mat.

Parameters
input_img[const cv::Mat&] The input image
haar_path[const std::string] The Haar training model path
Returns
[std::vector<cv::Rect>] A vector containing the detected faces. Each face is represented by a rectangle.

Definition at line 89 of file face_detector.cpp.

std::vector< cv::Rect > FaceDetector::findFaces ( std::string  file_name,
bool  fast = false 
)

Finds faces in an image retrieved from a file URL.

Parameters
file_name[std::string] The image file's URL
fast[bool] True for fast detection – frontal only
Returns
[std::vector<cv::Rect>] A vector containing the detected faces. Each face is represented by a rectangle.

Definition at line 168 of file face_detector.cpp.

std::vector< cv::Rect > FaceDetector::identifyUniqueFaces ( const std::vector< cv::Rect >  firstFaceVector,
const std::vector< cv::Rect >  secondFaceVector 
)
private

Identify unique faces from two sets of faces.

Parameters
frontFaceVector[const std::vector<cv::Rect>&] The first set of faces
secondFaceVector[const std::vector<cv::Rect>&] The second set of faces
Returns
[std::vector<cv::Rect>] A vector containing the unique faces. Each face is represented by a rectangle.

Definition at line 140 of file face_detector.cpp.

cv::Mat FaceDetector::loadImage ( std::string  file_name)

Loads an image from a file URL.

Parameters
file_name[std::string] The image's file URL
Returns
[cv::Mat] The image in OpenCV representation

Definition at line 35 of file face_detector.cpp.


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