#include <ThresholdDetection.h>
GRT::ThresholdDetection::ThresholdDetection |
( |
UINT |
bufferLength = 100 , |
|
|
UINT |
numDimensions = 1 , |
|
|
double |
alpha = 4.0 , |
|
|
double |
beta = 1.2 |
|
) |
| |
Copy constructor, copies the ThresholdDetection from the rhs instance to this instance.
- Parameters
-
GRT::ThresholdDetection::~ThresholdDetection |
( |
| ) |
|
|
virtual |
bool GRT::ThresholdDetection::computeFeatures |
( |
const VectorDouble & |
inputVector | ) |
|
|
virtual |
Sets the FeatureExtraction computeFeatures function, overwriting the base FeatureExtraction function. This function is called by the GestureRecognitionPipeline when any new input data needs to be processed (during the prediction phase for example). This function calls the ThresholdDetection's update function.
- Parameters
-
const | VectorDouble &inputVector: the inputVector that should be processed. Must have the same dimensionality as the FeatureExtraction module |
- Returns
- returns true if the data was processed, false otherwise
bool GRT::ThresholdDetection::deepCopyFrom |
( |
const FeatureExtraction * |
featureExtraction | ) |
|
|
virtual |
Sets the FeatureExtraction deepCopyFrom function, overwriting the base FeatureExtraction function. This function is used to deep copy the values from the input pointer to this instance of the FeatureExtraction module. This function is called by the GestureRecognitionPipeline when the user adds a new FeatureExtraction module to the pipeline.
- Parameters
-
FeatureExtraction | *featureExtraction: a pointer to another instance of a ThresholdDetection, the values of that instance will be cloned to this instance |
- Returns
- returns true if the deep copy was successful, false otherwise
CircularBuffer< VectorDouble > GRT::ThresholdDetection::getBufferData |
( |
| ) |
|
Get the circular buffer.
- Returns
- a copy of the circular buffer
const CircularBuffer< VectorDouble > & GRT::ThresholdDetection::getBufferData |
( |
| ) |
const |
Gets a reference to the circular buffer.
- Returns
- a reference to the circular buffer
bool GRT::ThresholdDetection::init |
( |
UINT |
bufferLength, |
|
|
UINT |
numDimensions, |
|
|
double |
alpha, |
|
|
double |
beta |
|
) |
| |
Initializes the MovementTrajectoryFeatures
bool GRT::ThresholdDetection::loadModelFromFile |
( |
string |
filename | ) |
|
|
virtual |
This saves the feature extraction settings to a file.
- Parameters
-
fstream | &file: a reference to the file to save the settings to |
- Returns
- returns true if the settings were saved successfully, false otherwise
bool GRT::ThresholdDetection::loadModelFromFile |
( |
fstream & |
file | ) |
|
|
virtual |
This loads the feature extraction settings from a file. This overrides the loadSettingsFromFile function in the FeatureExtraction base class.
- Parameters
-
fstream | &file: a reference to the file to load the settings from |
- Returns
- returns true if the settings were loaded successfully, false otherwise
Sets the equals operator, copies the data from the rhs instance to this instance.
- Parameters
-
- Returns
- a reference to this instance of ThresholdDetection
bool GRT::ThresholdDetection::reset |
( |
| ) |
|
|
virtual |
Sets the FeatureExtraction reset function, overwriting the base FeatureExtraction function. This function is called by the GestureRecognitionPipeline when the pipelines main reset() function is called. This function resets the feature extraction by re-initiliazing the instance.
- Returns
- true if the filter was reset, false otherwise
bool GRT::ThresholdDetection::saveModelToFile |
( |
string |
filename | ) |
const |
|
virtual |
This saves the feature extraction settings to a file.
- Parameters
-
const | string filename: the filename to save the settings to |
- Returns
- returns true if the settings were saved successfully, false otherwise
bool GRT::ThresholdDetection::saveModelToFile |
( |
fstream & |
file | ) |
const |
|
virtual |
This saves the feature extraction settings to a file. This overrides the saveSettingsToFile function in the FeatureExtraction base class.
- Parameters
-
fstream | &file: a reference to the file to save the settings to |
- Returns
- returns true if the settings were saved successfully, false otherwise
VectorDouble GRT::ThresholdDetection::update |
( |
double |
x | ) |
|
Computes the features from the input, this should only be called if the dimensionality of this instance was set to 1.
- Parameters
-
double | x: the value to compute features from, this should only be called if the dimensionality of the filter was set to 1 |
- Returns
- a vector containing the features, an empty vector will be returned if the features were not computed
VectorDouble GRT::ThresholdDetection::update |
( |
const VectorDouble & |
x | ) |
|
Computes the features from the input, the dimensionality of x should match that of this instance.
- Parameters
-
const | vector<double> &x: a vector containing the values to be processed, must be the same size as the numInputDimensions |
- Returns
- a vector containing the features, an empty vector will be returned if the features were not computed
double GRT::ThresholdDetection::alpha |
|
protected |
double GRT::ThresholdDetection::beta |
|
protected |
UINT GRT::ThresholdDetection::bufferLength |
|
protected |
CircularBuffer< VectorDouble > GRT::ThresholdDetection::dataBuffer |
|
protected |
bool GRT::ThresholdDetection::inNoise |
|
protected |
RegisterFeatureExtractionModule< ThresholdDetection > GRT::ThresholdDetection::registerModule |
|
staticprotected |
The documentation for this class was generated from the following files: