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
face_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_FACE_DETECTOR_NODE
19 #define RAPP_FACE_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 
34 {
35  public:
36 
40  FaceDetector(void);
41 
47  cv::Mat loadImage(std::string file_name);
48 
56  std::vector<cv::Rect> findFaces(std::string file_name, bool fast = false);
57 
65  std::vector<cv::Rect> detectFaces(const cv::Mat& input_img,
66  bool fast = false);
67 
68  private:
69 
77  std::vector<cv::Rect> detectFaces(const cv::Mat& input_img,
78  const std::string& haar_path);
79 
87  std::vector<cv::Rect> identifyUniqueFaces(
88  const std::vector<cv::Rect> firstFaceVector,
89  const std::vector<cv::Rect> secondFaceVector);
90 };
91 
92 #endif
Class that implements a face detection algorithm based on a Haar cascade classifier.
Definition: face_detector.h:33
std::vector< cv::Rect > detectFaces(const cv::Mat &input_img, bool fast=false)
Detects faces from a cv::Mat.
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.
std::vector< cv::Rect > findFaces(std::string file_name, bool fast=false)
Finds faces in an image retrieved from a file URL.
cv::Mat loadImage(std::string file_name)
Loads an image from a file URL.
FaceDetector(void)
Default constructor.