CVB++ 14.1
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
39 double HeightSensitivity() const noexcept
40 {
41 return heightSensitivity_;
42 }
43
46
53 void SetHeightSensitivity(double value)
54 {
55 if (value < 0.0)
56 throw std::invalid_argument("HeightSensitivity must not be < 0.0");
57 heightSensitivity_ = value;
58 }
59
61
74 int DerivativePatchSize() const noexcept
75 {
76 return derivativePatchSize_;
77 }
78
80
87 void SetDerivativePatchSize(int value)
88 {
89 if (value < 3)
90 throw std::invalid_argument("DerivativePatchSize must not be < 3");
91 derivativePatchSize_ = value;
92 }
93
95
104 int LocalDistributionSize() const noexcept
105 {
106 return localDistributionSize_;
107 }
108
110
118 {
119 if (value < 0)
120 throw std::invalid_argument("LocalDistributionSize must not be < 0");
121 localDistributionSize_ = value;
122 }
123
125
134 int NumGradientFeatures() const noexcept
135 {
136 return numGradientFeatures_;
137 }
138
140
148 {
149 if (value < 0)
150 throw std::invalid_argument("NumGradientFeatures must not be < 0");
151 numGradientFeatures_ = value;
152 }
153
155
164 int NumNormalFeatures() const noexcept
165 {
166 return numNormalFeatures_;
167 }
168
170
177 void SetNumNormalFeatures(int value)
178 {
179 if (value < 0)
180 throw std::invalid_argument("NumNormalFeatures must not be < 0");
181 numNormalFeatures_ = value;
182 }
183
185
194 int ICPShrink() const noexcept
195 {
196 return icpShrink_;
197 }
198
200
207 void SetICPShrink(int value)
208 {
209 if (value < 1)
210 throw std::invalid_argument("ICPShrink must not be < 1");
211 icpShrink_ = value;
212 }
213
215
224 double DistanceKernelSize() const noexcept
225 {
226 return distanceKernelSize_;
227 }
228
230
237 void SetDistanceKernelSize(double value)
238 {
239 if (value < 1.0)
240 throw std::invalid_argument("DistanceKernelSize must not be < 1.0");
241 distanceKernelSize_ = value;
242 }
243
244private:
245
246 double heightSensitivity_ = 1.0;
247 int derivativePatchSize_ = 3;
248 int localDistributionSize_ = 8;
249 int numGradientFeatures_ = 100;
250 int numNormalFeatures_ = 100;
251 int icpShrink_ = 4;
252 double distanceKernelSize_ = 2.0;
253
254};
255#pragma pack (pop)
256
257}
258
259CVB_END_INLINE_NS
260
261}
Parameters for teaching a Match3D 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:177
double DistanceKernelSize() const noexcept
Get the factor for distance transform calculation.
Definition: teach_parameters.hpp:224
int DerivativePatchSize() const noexcept
Get smoothing area in pixels for gradient and normal calculation.
Definition: teach_parameters.hpp:74
int NumNormalFeatures() const noexcept
Get the number of normal vector features retained in the classifier.
Definition: teach_parameters.hpp:164
TeachParameters()=default
Default teach parameters.
void SetNumGradientFeatures(int value)
Set the number of gradient features retained in the classifier.
Definition: teach_parameters.hpp:147
void SetDistanceKernelSize(double value)
Set the factor for Distance transform calculation.
Definition: teach_parameters.hpp:237
void SetDerivativePatchSize(int value)
Set smoothing area in pixels for gradient and normal calculation.
Definition: teach_parameters.hpp:87
void SetICPShrink(int value)
Set the subsample factor for ICP.
Definition: teach_parameters.hpp:207
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:53
int NumGradientFeatures() const noexcept
Get the number of gradient features retained in the classifier.
Definition: teach_parameters.hpp:134
int LocalDistributionSize() const noexcept
Get the size of area in which local features are distributed (in pixels).
Definition: teach_parameters.hpp:104
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:39
void SetLocalDistributionSize(int value)
Set the size of area in which local features are distributed (in pixels).
Definition: teach_parameters.hpp:117
int ICPShrink() const noexcept
Get the subsample factor for ICP.
Definition: teach_parameters.hpp:194
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24