CVB++ 14.0
teach_parameters.hpp
1#pragma once
2
3#include "dnc.hpp"
4
5namespace Cvb
6{
7
8CVB_BEGIN_INLINE_NS
9
10namespace Dnc
11{
12
14
16#pragma pack (push, 4)
17class TeachParameters final
18{
19public:
20
22
25 TeachParameters() = default;
26
29
38 double HeightSensitivity() const noexcept
39 {
40 return heightSensitivity_;
41 }
42
45
49 void SetHeightSensitivity(double value)
50 {
51 if (value < 0.0)
52 throw std::invalid_argument("HeightSensitivity must not be < 0.0");
53 heightSensitivity_ = value;
54 }
55
57
71 int DerivativePatchSize() const noexcept
72 {
73 return derivativePatchSize_;
74 }
75
77
81 void SetDerivativePatchSize(int value)
82 {
83 if (value < 3)
84 throw std::invalid_argument("DerivativePatchSize must not be < 3");
85 derivativePatchSize_ = value;
86 }
87
89
98 int LocalDistributionSize() const noexcept
99 {
100 return localDistributionSize_;
101 }
102
104
109 {
110 if (value < 0)
111 throw std::invalid_argument("LocalDistributionSize must not be < 0");
112 localDistributionSize_ = value;
113 }
114
116
126 int NumGradientFeatures() const noexcept
127 {
128 return numGradientFeatures_;
129 }
130
132
137 {
138 if (value < 0)
139 throw std::invalid_argument("NumGradientFeatures must not be < 0");
140 numGradientFeatures_ = value;
141 }
142
144
154 int NumNormalFeatures() const noexcept
155 {
156 return numNormalFeatures_;
157 }
158
160
164 void SetNumNormalFeatures(int value)
165 {
166 if (value < 0)
167 throw std::invalid_argument("NumNormalFeatures must not be < 0");
168 numNormalFeatures_ = value;
169 }
170
172
181 int ICPShrink() const noexcept
182 {
183 return icpShrink_;
184 }
185
187
191 void SetICPShrink(int value)
192 {
193 if (value < 1)
194 throw std::invalid_argument("ICPShrink must not be < 1");
195 icpShrink_ = value;
196 }
197
199
208 double DistanceKernelSize() const noexcept
209 {
210 return distanceKernelSize_;
211 }
212
214
218 void SetDistanceKernelSize(double value)
219 {
220 if (value < 1.0)
221 throw std::invalid_argument("DistanceKernelSize must not be < 1.0");
222 distanceKernelSize_ = value;
223 }
224
225private:
226
227 double heightSensitivity_ = 1.0;
228 int derivativePatchSize_ = 3;
229 int localDistributionSize_ = 8;
230 int numGradientFeatures_ = 100;
231 int numNormalFeatures_ = 100;
232 int icpShrink_ = 4;
233 double distanceKernelSize_ = 2.0;
234
235};
236#pragma pack (pop)
237
238}
239
240CVB_END_INLINE_NS
241
242}
Parameters for teaching a DNC finder.
Definition: teach_parameters.hpp:18
void SetNumNormalFeatures(int value)
Set the number of normal vector features retained in the classifier.
Definition: teach_parameters.hpp:164
double DistanceKernelSize() const noexcept
Get the factor for Distance transform calculation.
Definition: teach_parameters.hpp:208
int DerivativePatchSize() const noexcept
Get smoothing area in pixels for gradient and normal calculation.
Definition: teach_parameters.hpp:71
int NumNormalFeatures() const noexcept
Get the number of normal vector features retained in the classifier.
Definition: teach_parameters.hpp:154
TeachParameters()=default
Default teach parameters.
void SetNumGradientFeatures(int value)
Set the number of gradient features retained in the classifier.
Definition: teach_parameters.hpp:136
void SetDistanceKernelSize(double value)
Set the factor for Distance transform calculation.
Definition: teach_parameters.hpp:218
void SetDerivativePatchSize(int value)
Set smoothing area in pixels for gradient and normal calculation.
Definition: teach_parameters.hpp:81
void SetICPShrink(int value)
Set the subsample factor for ICP.
Definition: teach_parameters.hpp:191
void SetHeightSensitivity(double value)
Set the minimum gradient magnitude to accept a local gradient as a feature in the depth images.
Definition: teach_parameters.hpp:49
int NumGradientFeatures() const noexcept
Get the number of gradient features retained in the classifier.
Definition: teach_parameters.hpp:126
int LocalDistributionSize() const noexcept
Get the size of area in which local features are distributed (in pixels).
Definition: teach_parameters.hpp:98
double HeightSensitivity() const noexcept
Get the minimum gradient magnitude to accept a local gradient as a feature in the depth images.
Definition: teach_parameters.hpp:38
void SetLocalDistributionSize(int value)
Set the size of area in which local features are distributed (in pixels).
Definition: teach_parameters.hpp:108
int ICPShrink() const noexcept
Get the subsample factor for ICP.
Definition: teach_parameters.hpp:181
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24