Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpStatisticalTestMeanAdjustedCUSUM.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_MEAN_ADJUSTED_CUSUM_H
37
#define VP_STATISTICAL_TEST_MEAN_ADJUSTED_CUSUM_H
38
39
#include <visp3/core/vpConfig.h>
40
41
#include <visp3/core/vpStatisticalTestAbstract.h>
42
43
BEGIN_VISP_NAMESPACE
87
class
VISP_EXPORT
vpStatisticalTestMeanAdjustedCUSUM
:
public
vpStatisticalTestAbstract
88
{
89
protected
:
90
float
m_delta
;
91
float
m_h
;
93
float
m_half_delta
;
94
float
m_k
;
95
float
m_sminus
;
96
float
m_splus
;
97
101
virtual
void
computeDeltaAndLimits
();
102
110
virtual
vpMeanDriftType
detectDownwardMeanDrift
() VP_OVERRIDE;
111
117
virtual
vpMeanDriftType
detectUpwardMeanDrift
() VP_OVERRIDE;
118
125
virtual
bool
updateStatistics
(const
float
&signal) VP_OVERRIDE;
126
132
virtual
void
updateTestSignals
(const
float
&signal) VP_OVERRIDE;
133
134
public:
145
vpStatisticalTestMeanAdjustedCUSUM
(const
float
&h = 4.f, const
float
&k = 1.f, const
unsigned
int
&nbPtsForStats = 30);
146
153
inline
float
getDelta
()
const
154
{
155
return
m_delta
;
156
}
157
163
inline
float
getH
()
const
164
{
165
return
m_h
;
166
}
167
173
inline
float
getK
()
const
174
{
175
return
m_k
;
176
}
177
183
inline
float
getTestSignalMinus
()
const
184
{
185
return
m_sminus
;
186
}
187
193
inline
float
getTestSignalPlus
()
const
194
{
195
return
m_splus
;
196
}
197
207
void
init
(
const
float
&h,
const
float
&k,
const
unsigned
int
&nbPtsForStats);
208
218
void
init
(
const
float
&delta,
const
float
&limitDown,
const
float
&limitUp,
const
unsigned
int
&nbPtsForStats);
219
230
void
init
(
const
float
&h,
const
float
&k,
const
float
&mean,
const
float
&stdev);
231
241
void
init
(
const
float
&delta,
const
float
&limitDown,
const
float
&limitUp,
const
float
&mean,
const
float
&stdev);
242
248
inline
void
setDelta
(
const
float
&delta)
249
{
250
m_delta
= delta;
251
m_half_delta
= 0.5f * delta;
252
}
253
260
inline
void
setLimits
(
const
float
&limitDown,
const
float
&limitUp)
261
{
262
m_limitDown
= limitDown;
263
m_limitUp
= limitUp;
264
}
265
};
266
END_VISP_NAMESPACE
267
#endif
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::init
void init()
(Re)Initialize the algorithm.
Definition
vpStatisticalTestAbstract.cpp:157
vpStatisticalTestAbstract::m_limitDown
float m_limitDown
Definition
vpStatisticalTestAbstract.h:116
vpStatisticalTestAbstract::vpStatisticalTestAbstract
vpStatisticalTestAbstract()
Construct a new vpStatisticalTestAbstract object.
Definition
vpStatisticalTestAbstract.cpp:131
vpStatisticalTestAbstract::detectDownwardMeanDrift
virtual vpMeanDriftType detectDownwardMeanDrift()=0
Detects if a downward mean drift occurred.
vpStatisticalTestMeanAdjustedCUSUM::getTestSignalMinus
float getTestSignalMinus() const
Get the latest value of the test signal for downward jumps of the mean.
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:183
vpStatisticalTestMeanAdjustedCUSUM::m_splus
float m_splus
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:96
vpStatisticalTestMeanAdjustedCUSUM::getTestSignalPlus
float getTestSignalPlus() const
Get the latest value of the test signal for upward jumps of the mean.
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:193
vpStatisticalTestMeanAdjustedCUSUM::m_k
float m_k
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:94
vpStatisticalTestMeanAdjustedCUSUM::m_sminus
float m_sminus
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:95
vpStatisticalTestMeanAdjustedCUSUM::detectUpwardMeanDrift
virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE
Detects if a upward jump occurred on the mean.
Definition
vpStatisticalTestMeanAdjustedCUSUM.cpp:60
vpStatisticalTestMeanAdjustedCUSUM::m_delta
float m_delta
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:90
vpStatisticalTestMeanAdjustedCUSUM::getH
float getH() const
Get the alarm factor.
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:163
vpStatisticalTestMeanAdjustedCUSUM::vpStatisticalTestMeanAdjustedCUSUM
vpStatisticalTestMeanAdjustedCUSUM(const float &h=4.f, const float &k=1.f, const unsigned int &nbPtsForStats=30)
Construct a new vpStatisticalTestMeanAdjustedCUSUM object.
Definition
vpStatisticalTestMeanAdjustedCUSUM.cpp:92
vpStatisticalTestMeanAdjustedCUSUM::m_half_delta
float m_half_delta
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:93
vpStatisticalTestMeanAdjustedCUSUM::m_h
float m_h
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:91
vpStatisticalTestMeanAdjustedCUSUM::updateStatistics
virtual bool updateStatistics(const float &signal) VP_OVERRIDE
Update m_s and if enough values are available, compute the mean, the standard deviation and the limit...
Definition
vpStatisticalTestMeanAdjustedCUSUM.cpp:70
vpStatisticalTestMeanAdjustedCUSUM::computeDeltaAndLimits
virtual void computeDeltaAndLimits()
Compute the upper and lower limits of the test signal.
Definition
vpStatisticalTestMeanAdjustedCUSUM.cpp:42
vpStatisticalTestMeanAdjustedCUSUM::setDelta
void setDelta(const float &delta)
Set the slack of the CUSUM test, i.e. the minimum value of the jumps we want to detect.
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:248
vpStatisticalTestMeanAdjustedCUSUM::setLimits
void setLimits(const float &limitDown, const float &limitUp)
Set the upward and downward jump limits.
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:260
vpStatisticalTestMeanAdjustedCUSUM::getDelta
float getDelta() const
Get the slack of the CUSUM test, i.e. amplitude of mean shift we want to be able to detect.
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:153
vpStatisticalTestMeanAdjustedCUSUM::getK
float getK() const
Get the detection factor.
Definition
vpStatisticalTestMeanAdjustedCUSUM.h:173
vpStatisticalTestMeanAdjustedCUSUM::updateTestSignals
virtual void updateTestSignals(const float &signal) VP_OVERRIDE
Update the test signals.
Definition
vpStatisticalTestMeanAdjustedCUSUM.cpp:86
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
core
include
visp3
core
vpStatisticalTestMeanAdjustedCUSUM.h
Generated by
1.17.0