vision
HaarDetector.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __HAAR_DETECTOR_HPP__
4 #define __HAAR_DETECTOR_HPP__
5 
6 #include <yarp/dev/DeviceDriver.h>
7 
8 #include <opencv2/objdetect.hpp>
9 #ifdef HAVE_CV_FACE
10 # include <opencv2/face/facemark.hpp>
11 #endif
12 
13 #include "IDetector.hpp"
14 
15 namespace roboticslab
16 {
17 
23 class HaarDetector : public yarp::dev::DeviceDriver,
24  public IDetector
25 {
26 public:
27  bool open(yarp::os::Searchable& config) override;
28  bool detect(const yarp::sig::Image& inYarpImg, yarp::os::Bottle& detectedObjects) override;
29 
30 private:
31  cv::CascadeClassifier object_cascade;
32 #ifdef HAVE_CV_FACE
33  cv::Ptr<cv::face::Facemark> facemark;
34 #endif
35 };
36 
37 } // namespace roboticslab
38 
39 #endif // __HAAR_DETECTOR_HPP__
Definition: HaarDetector.hpp:25
Interface for object detection.
Definition: IDetector.hpp:17
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:5