X-Boost  2.3.8
Candidate.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  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20 
21 #ifndef _CANDIDATE_H
22 #define _CANDIDATE_H
23 
24 #include "Types.h"
25 
30 namespace detail {
31 
35  float scale;
37  int step;
41  int category;
42 };
43 
44 }
45 
47 struct Candidate
48 {
49  bool grouped;
50 
51  int category;
52 
53  double response;
54 
55  int xr,yr;
56 
57  float scale;
58 
60 
62 
63  unsigned int flags;
64 
65 
66 public:
67 
69  void Set(int x, int y, double val, const detail::CandidateParam & param)
70  {
71  response = val;
72  xr = x;
73  yr = y;
74  scale = param.scale;
75  category = param.category;
76  int _x = x * param.step; // coordinates corrected with step
77  int _y = y * param.step;
78  box.x0 = _x*scale;
79  box.y0 = _y*scale;
80  box.x1 = (_x+param.cl_geom.width)*scale;
81  box.y1 = (_y+param.cl_geom.height)*scale;
82  grouped = false;
83  flags=0;
84  }
85 
87  inline bool operator < (const Candidate & b) const
88  {
89  return response > b.response; // invert
90  }
91 
92 };
93 //
94 
95 //
96 
97 #endif
unsigned int flags
user flags: the user can use this value
Definition: Candidate.h:63
Types involved in boosting.
size cl_geom
classifier geometry
Definition: Candidate.h:39
parameters used in the NMS step
Definition: Candidate.h:33
int step
response step. Multiplication factor to convert from (x,y) to box coordinates
Definition: Candidate.h:37
int category
category
Definition: Candidate.h:41
int category
category
Definition: Candidate.h:51
image/size TODO namespace
Definition: Types.h:39
double response
response value
Definition: Candidate.h:53
int yr
top left corner in response image coordinates
Definition: Candidate.h:55
bool operator<(const Candidate &b) const
used for std::sort
Definition: Candidate.h:87
void Set(int x, int y, double val, const detail::CandidateParam &param)
method called by NonMaximaSuppression
Definition: Candidate.h:69
bool grouped
used internally by Group Rectangles
Definition: Candidate.h:49
a rectangle structure
Definition: Types.h:55
the object reported by classifier
Definition: Candidate.h:47
float scale
detection scale
Definition: Candidate.h:57
rect box
the object area in the original image reference frame
Definition: Candidate.h:59
float scale
detection scale. Multiplication factor to convert from (x,y) and size to box coordinates ...
Definition: Candidate.h:35