X-Boost  2.3.8
IntegralChannelFeatureGenerators.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 _INTEGRAL_CHANNEL_FEATURE_GENERATORS_H
22 #define _INTEGRAL_CHANNEL_FEATURE_GENERATORS_H
23 
29 #include "Types.h"
30 
33 public:
34 
36  unsigned int m_mw, m_mh;
37 
39  unsigned int m_nchannel;
40 
42  unsigned int m_minFeatArea;
43 
45  unsigned int m_minWidth;
46 
48  unsigned int m_step;
49 
51  unsigned int m_border;
52 
53 public:
54 
56 
57 public:
60 
62  void SetGeometry(unsigned int mw, unsigned int mh, unsigned int n);
63 
65  void SetFeatureMinArea(int minArea) {
66  m_minFeatArea = minArea;
67  }
69  void SetFeatureMinWidth(int minWidth) {
70  m_minWidth = minWidth;
71  }
73  void SetStep(int step) {
74  m_step = step;
75  }
76 
78  void SetBorder(int border) {
79  m_border = border;
80  }
81 
83  unsigned int W() const {
84  return m_mw;
85  }
86  unsigned int H() const {
87  return m_mh;
88  }
89  unsigned int N() const {
90  return m_nchannel;
91  }
92  unsigned int Size() const {
93  return m_mw*m_mh*m_nchannel;
94  }
95 
96  void SetParams(int nchn, int w,int h)
97  {
98  m_nchannel = nchn;
99  m_mw = w;
100  m_mh = h;
101 
102  }
103 
104 
105 };
106 
109  unsigned int m_featCount;
110 
112  std::vector< rect> m_rects;
113 
114 public:
115 
118 
119  void Reset();
120 
121  unsigned int Count() const {
122  return m_rects.size() * m_nchannel;
123  }
124 
126  bool Next(IntegralChannelFeature & out);
127 };
128 
132  int m_cur;
133 
135  int m_featRand;
136 
137 public:
138 
139  RandomIntegralChannelFeatureGenerator(int nFeat) : BaseIntegralChannelFeatureGenerator(), m_cur(0), m_featRand(nFeat) { }
141 
142  unsigned int Count() const {
143  return m_featRand;
144  }
145 
146  bool Next(IntegralChannelFeature & out);
147 
148  void Reset();
149 
150 };
151 
152 #endif
void SetGeometry(unsigned int mw, unsigned int mh, unsigned int n)
Width Height Channels.
Feature FeatureType
The feature type generate by this generator.
Definition: FeatureGenerator.h:41
A library able to generate any IC Feature.
Definition: IntegralChannelFeatureGenerators.h:108
Types involved in boosting.
unsigned int W() const
Return the generator geometry.
Definition: IntegralChannelFeatureGenerators.h:83
Definition: FeatureGenerator.h:36
void SetStep(int step)
Set the search step.
Definition: IntegralChannelFeatureGenerators.h:73
unsigned int m_border
a Border where skip elements
Definition: IntegralChannelFeatureGenerators.h:51
unsigned int m_step
Search Step.
Definition: IntegralChannelFeatureGenerators.h:48
unsigned int m_mw
rectangle geometry
Definition: IntegralChannelFeatureGenerators.h:36
bool Next(IntegralChannelFeature &out)
Provide a new feature, or return false.
void SetFeatureMinArea(int minArea)
A constraint on minimum area of a feature (width x height > minArea)
Definition: IntegralChannelFeatureGenerators.h:65
this file declare the virtual feature generator for Integral Channel Features
void SetBorder(int border)
Set a skip border.
Definition: IntegralChannelFeatureGenerators.h:78
void Reset()
reset any interal counters
Sum of a rectangular area, implemented on top of Integral Image.
Definition: IntegralChannelFeature.h:42
unsigned int Count() const
return the count of feature available
Definition: IntegralChannelFeatureGenerators.h:121
void SetFeatureMinWidth(int minWidth)
Set the minimum feature size.
Definition: IntegralChannelFeatureGenerators.h:69
This generator, instead of exhaustive, use a Random sampling approach.
Definition: IntegralChannelFeatureGenerators.h:130
unsigned int m_minFeatArea
dimensione minima
Definition: IntegralChannelFeatureGenerators.h:42
unsigned int Count() const
return the count of feature available
Definition: IntegralChannelFeatureGenerators.h:142
void Reset()
reset any interal counters
unsigned int m_nchannel
number of channel
Definition: IntegralChannelFeatureGenerators.h:39
unsigned int m_minWidth
min Width/Height
Definition: IntegralChannelFeatureGenerators.h:45
Base Feature Generator for IntegralChannelFeatureGenerators.
Definition: IntegralChannelFeatureGenerators.h:32