Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpStatisticalTestAbstract.h
1
/*
2
* ViSP, open source Visual Servoing Platform software.
3
* Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4
*
5
* This software is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
* See the file LICENSE.txt at the root directory of this source
10
* distribution for additional information about the GNU GPL.
11
*
12
* For using ViSP with software that can not be combined with the GNU
13
* GPL, please contact Inria about acquiring a ViSP Professional
14
* Edition License.
15
*
16
* See https://visp.inria.fr for more information.
17
*
18
* This software was developed at:
19
* Inria Rennes - Bretagne Atlantique
20
* Campus Universitaire de Beaulieu
21
* 35042 Rennes Cedex
22
* France
23
*
24
* If you have questions regarding the use of this file, please contact
25
* Inria at visp@inria.fr
26
*
27
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29
*/
30
35
36
#ifndef VP_STATISTICAL_TEST_ABSTRACT_H
37
#define VP_STATISTICAL_TEST_ABSTRACT_H
38
39
#include <algorithm>
40
#include <cmath>
41
#include <iostream>
42
#include <string>
43
44
#include <visp3/core/vpConfig.h>
45
46
BEGIN_VISP_NAMESPACE
63
class
VISP_EXPORT
vpStatisticalTestAbstract
64
{
65
public
:
69
typedef
enum
vpMeanDriftType
70
{
71
MEAN_DRIFT_NONE
= 0,
72
MEAN_DRIFT_DOWNWARD
= 1,
73
MEAN_DRIFT_UPWARD
= 2,
74
MEAN_DRIFT_BOTH
= 3,
75
MEAN_DRIFT_COUNT
= 4,
76
MEAN_DRIFT_UNKNOWN
=
MEAN_DRIFT_COUNT
77
} vpMeanDriftType;
78
85
static
std::string vpMeanDriftTypeToString(
const
vpMeanDriftType &type);
86
93
static
vpMeanDriftType vpMeanDriftTypeFromString(
const
std::string &name);
94
103
static
std::string getAvailableMeanDriftType(
const
std::string &prefix =
"<"
,
const
std::string &sep =
" , "
,
104
const
std::string &suffix =
">"
);
105
111
static
void
print(
const
vpMeanDriftType &type);
112
113
protected
:
114
bool
m_areStatisticsComputed
;
115
float
m_count
;
116
float
m_limitDown
;
117
float
m_limitUp
;
118
float
m_mean
;
119
unsigned
int
m_nbSamplesForStatistics
;
120
float
*
m_s
;
121
float
m_stdev
;
122
float
m_stdevmin
;
123
float
m_sumForMean
;
124
132
virtual
vpMeanDriftType
detectDownwardMeanDrift
() = 0;
133
141
virtual
vpMeanDriftType
detectUpwardMeanDrift
() = 0;
142
151
virtual
bool
updateStatistics
(
const
float
&signal);
152
158
virtual
void
updateTestSignals
(
const
float
&signal) = 0;
159
public
:
163
vpStatisticalTestAbstract
();
164
168
vpStatisticalTestAbstract
(
const
vpStatisticalTestAbstract
&other);
169
173
virtual
~vpStatisticalTestAbstract
();
174
181
inline
void
getLimits
(
float
&limitDown,
float
&limitUp)
const
182
{
183
limitDown =
m_limitDown
;
184
limitUp =
m_limitUp
;
185
}
186
192
inline
float
getMean
()
const
193
{
194
return
m_mean
;
195
}
196
202
inline
float
getStdev
()
const
203
{
204
return
m_stdev
;
205
}
206
210
void
init();
211
218
vpStatisticalTestAbstract
&operator=(
const
vpStatisticalTestAbstract
&other);
219
226
void
setMinStdev
(
const
float
&stdevmin)
227
{
228
m_stdevmin
= stdevmin;
229
}
230
237
void
setNbSamplesForStat(
const
unsigned
int
&nbSamples);
238
248
vpMeanDriftType testDownUpwardMeanDrift(
const
float
&signal);
249
259
vpMeanDriftType testDownwardMeanDrift(
const
float
&signal);
260
270
vpMeanDriftType testUpwardMeanDrift(
const
float
&signal);
271
};
272
END_VISP_NAMESPACE
273
#endif
vpStatisticalTestAbstract
Base class for methods detecting the drift of the mean of a process.
Definition
vpStatisticalTestAbstract.h:64
vpStatisticalTestAbstract::m_sumForMean
float m_sumForMean
Definition
vpStatisticalTestAbstract.h:123
vpStatisticalTestAbstract::m_stdevmin
float m_stdevmin
Definition
vpStatisticalTestAbstract.h:122
vpStatisticalTestAbstract::m_limitUp
float m_limitUp
Definition
vpStatisticalTestAbstract.h:117
vpStatisticalTestAbstract::vpMeanDriftType
vpMeanDriftType
Enum that indicates if a drift of the mean occurred.
Definition
vpStatisticalTestAbstract.h:70
vpStatisticalTestAbstract::MEAN_DRIFT_UPWARD
@ MEAN_DRIFT_UPWARD
Definition
vpStatisticalTestAbstract.h:73
vpStatisticalTestAbstract::MEAN_DRIFT_COUNT
@ MEAN_DRIFT_COUNT
Definition
vpStatisticalTestAbstract.h:75
vpStatisticalTestAbstract::MEAN_DRIFT_UNKNOWN
@ MEAN_DRIFT_UNKNOWN
Definition
vpStatisticalTestAbstract.h:76
vpStatisticalTestAbstract::MEAN_DRIFT_DOWNWARD
@ MEAN_DRIFT_DOWNWARD
Definition
vpStatisticalTestAbstract.h:72
vpStatisticalTestAbstract::MEAN_DRIFT_BOTH
@ MEAN_DRIFT_BOTH
Definition
vpStatisticalTestAbstract.h:74
vpStatisticalTestAbstract::MEAN_DRIFT_NONE
@ MEAN_DRIFT_NONE
Definition
vpStatisticalTestAbstract.h:71
vpStatisticalTestAbstract::getLimits
void getLimits(float &limitDown, float &limitUp) const
Get the upper and lower limits of the test signal.
Definition
vpStatisticalTestAbstract.h:181
vpStatisticalTestAbstract::detectUpwardMeanDrift
virtual vpMeanDriftType detectUpwardMeanDrift()=0
Detects if a upward mean drift occurred.
vpStatisticalTestAbstract::m_s
float * m_s
Definition
vpStatisticalTestAbstract.h:120
vpStatisticalTestAbstract::setMinStdev
void setMinStdev(const float &stdevmin)
Set the minimum value of the standard deviation that is expected. The computed standard deviation can...
Definition
vpStatisticalTestAbstract.h:226
vpStatisticalTestAbstract::m_limitDown
float m_limitDown
Definition
vpStatisticalTestAbstract.h:116
vpStatisticalTestAbstract::vpStatisticalTestAbstract
vpStatisticalTestAbstract()
Construct a new vpStatisticalTestAbstract object.
Definition
vpStatisticalTestAbstract.cpp:131
vpStatisticalTestAbstract::updateStatistics
virtual bool updateStatistics(const float &signal)
Update m_s and if enough values are available, compute the mean, the standard deviation and the limit...
Definition
vpStatisticalTestAbstract.cpp:103
vpStatisticalTestAbstract::m_mean
float m_mean
Definition
vpStatisticalTestAbstract.h:118
vpStatisticalTestAbstract::updateTestSignals
virtual void updateTestSignals(const float &signal)=0
Update the test signals.
vpStatisticalTestAbstract::m_stdev
float m_stdev
Definition
vpStatisticalTestAbstract.h:121
vpStatisticalTestAbstract::m_areStatisticsComputed
bool m_areStatisticsComputed
Definition
vpStatisticalTestAbstract.h:114
vpStatisticalTestAbstract::m_count
float m_count
Definition
vpStatisticalTestAbstract.h:115
vpStatisticalTestAbstract::getMean
float getMean() const
Get the mean used as reference.
Definition
vpStatisticalTestAbstract.h:192
vpStatisticalTestAbstract::m_nbSamplesForStatistics
unsigned int m_nbSamplesForStatistics
Definition
vpStatisticalTestAbstract.h:119
vpStatisticalTestAbstract::getStdev
float getStdev() const
Get the standard deviation used as reference.
Definition
vpStatisticalTestAbstract.h:202
vpStatisticalTestAbstract::detectDownwardMeanDrift
virtual vpMeanDriftType detectDownwardMeanDrift()=0
Detects if a downward mean drift occurred.
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
core
include
visp3
core
vpStatisticalTestAbstract.h
Generated by
1.17.0