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
human_detector.h
Go to the documentation of this file.
1 /******************************************************************************
2 Copyright 2015 RAPP
3 
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 
16 ******************************************************************************/
17 
18 #ifndef RAPP_HUMAN_DETECTOR_NODE
19 #define RAPP_HUMAN_DETECTOR_NODE
20 
21 #include <iostream>
22 
23 #include <opencv2/core/core.hpp>
24 #include <opencv2/highgui/highgui.hpp>
25 #include <opencv2/objdetect/objdetect.hpp>
26 #include <opencv2/imgproc/imgproc.hpp>
27 #include <opencv2/ml/ml.hpp> // for the svm algorithm
28 #include "opencv2/objdetect/objdetect.hpp" // for HOGDescriptor
29 
36 {
37  public:
38 
42  HumanDetector(void);
43 
49  cv::Mat loadImage(std::string file_name);
50 
57  std::vector<cv::Rect> findHuman2D(std::string file_name);
58 
65  std::vector<cv::Rect> detectHuman2D(const cv::Mat& input_img);
66 
67  private:
68 
76  std::vector<cv::Rect> detectHuman2D(const cv::Mat& input_img,
77  const std::string& haar_path);
78 
86  std::vector<cv::Rect> identifyUniqueHumans(
87  const std::vector<cv::Rect> pedestrianVector,
88  const std::vector<cv::Rect> upperbodyVector);
89 };
90 
91 #endif
Class that implements a human detection algorithm based on a Haar cascade classifier.
std::vector< cv::Rect > findHuman2D(std::string file_name)
Finds humans in an image retrieved from a file URL.
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.
std::vector< cv::Rect > detectHuman2D(const cv::Mat &input_img)
Detects humans from a cv::Mat.
cv::Mat loadImage(std::string file_name)
Loads an image from a file URL.
HumanDetector(void)
Default constructor.