GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
GRT::TimeSeriesClassificationSampleTrimmer Class Reference

Public Member Functions

 TimeSeriesClassificationSampleTrimmer (double trimThreshold=0.1, double maximumTrimPercentage=80)
 
 ~TimeSeriesClassificationSampleTrimmer ()
 
TimeSeriesClassificationSampleTrimmeroperator= (const TimeSeriesClassificationSampleTrimmer &rhs)
 
bool trimTimeSeries (TimeSeriesClassificationSample &timeSeries)
 

Detailed Description

Definition at line 51 of file TimeSeriesClassificationSampleTrimmer.h.

Constructor & Destructor Documentation

GRT::TimeSeriesClassificationSampleTrimmer::TimeSeriesClassificationSampleTrimmer ( double  trimThreshold = 0.1,
double  maximumTrimPercentage = 80 
)

Default Constructor.

Definition at line 25 of file TimeSeriesClassificationSampleTrimmer.cpp.

GRT::TimeSeriesClassificationSampleTrimmer::~TimeSeriesClassificationSampleTrimmer ( )

Default Destructor

Definition at line 33 of file TimeSeriesClassificationSampleTrimmer.cpp.

Member Function Documentation

TimeSeriesClassificationSampleTrimmer& GRT::TimeSeriesClassificationSampleTrimmer::operator= ( const TimeSeriesClassificationSampleTrimmer rhs)
inline

Defines the equals operator. Copies the settings from the rhs instance to this instance

Parameters
constTimeSeriesClassificationSampleTrimmer &rhs: the instance from which the settings will be copied
Returns
returns a reference to this instance

Definition at line 70 of file TimeSeriesClassificationSampleTrimmer.h.

bool GRT::TimeSeriesClassificationSampleTrimmer::trimTimeSeries ( TimeSeriesClassificationSample timeSeries)

The function attempts to detect and remove these static areas of data. This is done by computing the summed absolute energy of the timeseries data, normalizing the energy profile by the maximum energy value, and then searching for areas at the start and end of the timeseries that are below a specific trimthreshold (set by the user).

Any data that is below the trimthreshold will be removed, up until the first value that exceeds the threshold. This search is run both from the start of the timeseries (searching forward) and the end of the timeseries (searching backwards). If the length of the new timeseries is below the maximumTrimPercentage, then the timeseries will be trimmed and the trimTimeSeries function will return true. If the length of the new is above the maximumTrimPercentage, then the timeseries will not be trimmed and the trimTimeSeries function will return false. Set the maximumTrimPercentage to 100 if you want the timeseries to always be trimmed.

Parameters
TimeSeriesClassificationSample&timeSeries: the timeseries to be trimmed (will be trimmed in place)
Returns
returns true if the timeseries was trimmed, false otherwise

Definition at line 35 of file TimeSeriesClassificationSampleTrimmer.cpp.


The documentation for this class was generated from the following files: