GestureRecognitionToolkit
Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
|
Public Member Functions | |
TimeSeriesClassificationSampleTrimmer (Float trimThreshold=0.1, Float maximumTrimPercentage=80) | |
~TimeSeriesClassificationSampleTrimmer () | |
TimeSeriesClassificationSampleTrimmer & | operator= (const TimeSeriesClassificationSampleTrimmer &rhs) |
bool | trimTimeSeries (TimeSeriesClassificationSample &timeSeries) |
Protected Attributes | |
Float | trimThreshold |
Float | maximumTrimPercentage |
WarningLog | warningLog |
ErrorLog | errorLog |
Definition at line 50 of file TimeSeriesClassificationSampleTrimmer.h.
GRT_BEGIN_NAMESPACE TimeSeriesClassificationSampleTrimmer::TimeSeriesClassificationSampleTrimmer | ( | Float | trimThreshold = 0.1 , |
Float | maximumTrimPercentage = 80 |
||
) |
Default Constructor.
Definition at line 26 of file TimeSeriesClassificationSampleTrimmer.cpp.
TimeSeriesClassificationSampleTrimmer::~TimeSeriesClassificationSampleTrimmer | ( | ) |
Default Destructor
Definition at line 33 of file TimeSeriesClassificationSampleTrimmer.cpp.
|
inline |
Defines the equals operator. Copies the settings from the rhs instance to this instance
rhs | the instance from which the settings will be copied |
Definition at line 69 of file TimeSeriesClassificationSampleTrimmer.h.
bool 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.
timeSeries | the timeseries to be trimmed (will be trimmed in place) |
Definition at line 35 of file TimeSeriesClassificationSampleTrimmer.cpp.