Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpStatisticalTestHinkley.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_HINKLEY_H
37#define VP_STATISTICAL_TEST_HINKLEY_H
38
39#include <visp3/core/vpConfig.h>
40
41#include <visp3/core/vpStatisticalTestAbstract.h>
42
95{
96protected:
97 float m_dmin2;
98 float m_alpha;
99 float m_Sk;
100 float m_Mk;
101 float m_Tk;
102 float m_Nk;
105 float m_h;
106 float m_k;
107
111 virtual void computeAlphaDelta();
112
119 void computeMean(double signal);
120
126 void computeSk(double signal);
127
131 void computeMk();
132
138 void computeTk(double signal);
139
143 void computeNk();
144
150 virtual vpMeanDriftType detectDownwardMeanDrift() VP_OVERRIDE;
151
159 virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE;
160
167 virtual bool updateStatistics(const float &signal) VP_OVERRIDE;
168
174 virtual void updateTestSignals(const float &signal) VP_OVERRIDE;
175
176public:
186
197 vpStatisticalTestHinkley(const float &alpha, const float &delta, const unsigned int &nbSamplesForInit = 30);
198
208 vpStatisticalTestHinkley(const float &h, const float &k, const bool &computeAlphaDeltaFromStdev, const unsigned int &nbSamplesForInit = 30);
209
219 vpStatisticalTestHinkley(const float &h, const float &k, const float &mean, const float &stdev);
220
226 inline float getAlpha() const { return m_alpha; }
227
233 inline float getSk() const { return m_Sk; }
234
240 inline float getMk() const { return m_Mk; }
241
248 inline float getTk() const { return m_Tk; }
249
255 inline float getNk() const { return m_Nk; }
256
261 void init();
262
271 void init(const float &alpha, const float &delta, const unsigned int &nbSamplesForInit);
272
282 void init(const float &h, const float &k, const bool &computeAlphaDeltaFromStdev, const unsigned int &nbSamplesForInit);
283
292 void init(const float &alpha, const float &delta, const float &mean);
293
303 void init(const float &h, const float &k, const float &mean, const float &stdev);
304
310 void setDelta(const float &delta);
311
317 void setAlpha(const float &alpha);
318};
319END_VISP_NAMESPACE
320#endif
vpMeanDriftType
Enum that indicates if a drift of the mean occurred.
void init()
(Re)Initialize the algorithm.
vpStatisticalTestAbstract()
Construct a new vpStatisticalTestAbstract object.
virtual vpMeanDriftType detectDownwardMeanDrift()=0
Detects if a downward mean drift occurred.
vpStatisticalTestHinkley()
Construct a new vpStatisticalTestHinkley object. Call init() to initialise the Hinkley's test and set...
virtual void computeAlphaDelta()
Compute and from the standard deviation of the signal.
float getAlpha() const
Get the threshold indicating that a mean drift occurs.
float getNk() const
Get the minimum of the test signal for upward mean drift .
void computeTk(double signal)
Compute .
void computeMk()
Compute , the maximum value of .
virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE
Detects if an upward mean drift occurred on the mean.
void computeNk()
Compute , the minimum value of .
float getTk() const
Get the test signal for upward mean drift..
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...
void computeSk(double signal)
Compute .
void computeMean(double signal)
Compute the mean value of the signal. The mean value must be computed before the mean drift is estim...
float getSk() const
Get the test signal for downward mean drift.
virtual void updateTestSignals(const float &signal) VP_OVERRIDE
Update the test signals.
float getMk() const
Get the maximum of the test signal for downward mean drift .