X-Boost  2.3.8
ObjectDetector.h
Go to the documentation of this file.
1 /* XBoost: Ada-Boost and Friends on Haar/ICF/HOG Features, Library and ToolBox
2  *
3  * Copyright (c) 2008-2014 Paolo Medici <medici@ce.unipr.it>
4  * Copyright (c) 2013-2014 Luca Castangia <l.caio@ce.unipr.it>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef _OBJECT_DETECTOR_H
23 #define _OBJECT_DETECTOR_H
24 
25 #include <vector>
26 #include <iostream>
27 #include "Types.h"
28 #include "Image.h"
29 #include "Thread/thread.h" // hardware_concurrency
30 #include "Candidate.h"
31 
44  bool enabled;
46  int category;
48  double th;
50  int step_mode;
53 
55  std::vector<std::pair<int,int> > m_srcSearchRanges;
57  std::vector<rect> m_searchRoi;
58 
63 
64  ObjectDetectorParams() : enabled(true), category(0), th(0.0), step_mode(1), downsampling(1), sz(0,0) { }
65 };
66 
72  int nScales;
75 
76 
77  ObjectDetectorGlobalParams() : octave_mode(1), nScales(4), concurrent_jobs(sprint::thread::hardware_concurrency() ) { }
78 };
79 
83 
84 public:
85 
86  virtual ~ObjectDetector();
87 
89  virtual std::string getSignature() const = 0;
90 
93  virtual int addClassifier(const char* pth_cls, const ObjectDetectorParams & params) = 0;
94 
96  virtual void setClassifierParams(int index, const ObjectDetectorParams & params) = 0;
98  virtual const ObjectDetectorParams & getClassifierParams(int index) = 0;
99 
101  virtual void setParams(const ObjectDetectorGlobalParams & params) = 0;
102  virtual const ObjectDetectorGlobalParams & getParams() const = 0;
103 
105  virtual void Detect(std::vector<Candidate>& out, const ImageHandle & src) = 0;
106 
107 };
108 
109 
110 #endif
bool enabled
Is this classifier enabled?
Definition: ObjectDetector.h:44
virtual void setClassifierParams(int index, const ObjectDetectorParams &params)=0
set per-classifier params
Types involved in boosting.
Definition: Image.h:35
int concurrent_jobs
number of concurrent jobs
Definition: ObjectDetector.h:74
virtual void setParams(const ObjectDetectorGlobalParams &params)=0
Set the Global Params.
Over-Classifier params.
Definition: ObjectDetector.h:68
int step_mode
how many step per octave are used
Definition: ObjectDetector.h:50
int nScales
Number of Scales per Octave.
Definition: ObjectDetector.h:72
image/size TODO namespace
Definition: Types.h:39
abstracting thread
int category
class associated with classifier
Definition: ObjectDetector.h:46
std::vector< rect > m_searchRoi
subregions ROI(s)
Definition: ObjectDetector.h:57
virtual int addClassifier(const char *pth_cls, const ObjectDetectorParams &params)=0
method to hold an image
virtual void Detect(std::vector< Candidate > &out, const ImageHandle &src)=0
detect object
double th
algorithm threshold
Definition: ObjectDetector.h:48
Definition: ObjectDetector.h:42
int downsampling
response precision
Definition: ObjectDetector.h:52
virtual const ObjectDetectorParams & getClassifierParams(int index)=0
get per-classifier params
size sz
Definition: ObjectDetector.h:62
std::vector< std::pair< int, int > > m_srcSearchRanges
search ranges
Definition: ObjectDetector.h:55
virtual std::string getSignature() const =0
return the classifier signature
Candidate object.
Definition: ObjectDetector.h:82
int octave_mode
use octave or linear search mode (deprecated)
Definition: ObjectDetector.h:70