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
HumanDetector Class Reference

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

#include <human_detector.h>

Public Member Functions

 HumanDetector (void)
 Default constructor. More...
 
std::vector< cv::Rect > detectHuman2D (const cv::Mat &input_img)
 Detects humans from a cv::Mat. More...
 
std::vector< cv::Rect > findHuman2D (std::string file_name)
 Finds humans 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 > detectHuman2D (const cv::Mat &input_img, const std::string &haar_path)
 Detects humans from a cv::Mat. More...
 
std::vector< cv::Rect > identifyUniqueHumans (const std::vector< cv::Rect > pedestrianVector, const std::vector< cv::Rect > upperbodyVector)
 Identify unique humans from two sets of humans. More...
 

Detailed Description

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

Definition at line 35 of file human_detector.h.

Constructor & Destructor Documentation

HumanDetector::HumanDetector ( void  )

Default constructor.

Definition at line 23 of file human_detector.cpp.

Member Function Documentation

std::vector< cv::Rect > HumanDetector::detectHuman2D ( const cv::Mat &  input_img)

Detects humans from a cv::Mat.

Parameters
input_img[const cv::Mat&] The input image
Returns
[std::vector<cv::Rect>] A vector containing the detected humans. Each human is represented by a rectangle.

Definition at line 46 of file human_detector.cpp.

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

Detects humans 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 humans. Each human is represented by a rectangle.

Definition at line 80 of file human_detector.cpp.

std::vector< cv::Rect > HumanDetector::findHuman2D ( std::string  file_name)

Finds humans in an image retrieved from a file URL.

Parameters
file_name[std::string] The image file's URL
Returns
[std::vector<cv::Rect>] A vector containing the detected humans. Each human is represented by a rectangle.

Definition at line 166 of file human_detector.cpp.

std::vector< cv::Rect > HumanDetector::identifyUniqueHumans ( const std::vector< cv::Rect >  pedestrianVector,
const std::vector< cv::Rect >  upperbodyVector 
)
private

Identify unique humans from two sets of humans.

Parameters
pedestrianVector[const std::vector<cv::Rect>&] The first set of humans
upperbodyVector[const std::vector<cv::Rect>&] The second set of humans
Returns
[std::vector<cv::Rect>] A vector containing the unique humans. Each human is represented by a rectangle.

Definition at line 139 of file human_detector.cpp.

cv::Mat HumanDetector::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 32 of file human_detector.cpp.


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