#include <linearrecogniser.h>
Inheritance diagram for LinearRecogniser:

Public Member Functions | |
| LinearRecogniser () | |
| ~LinearRecogniser () | |
| virtual const std::string & | key () const |
| virtual const std::string & | title () const |
| virtual const std::string & | description () const |
| const map< string, string > & | defaultParams () const |
| bool | initTraining (const list< string > &featureKeys, const map< string, string > ¶ms) |
| bool | examineSample (const StlFeatureVec &featureVec, const set< int > &classes) |
| bool | finaliseTraining () |
| bool | writeModelFile (const string &fileName) |
| bool | readModelFile (const string &fileName) |
| StlStroke | flatten (const StlStrokeList &strokes) |
| StlClassProbabilities | classify (const StlFeatureVec &featureVec) |
| LinearRecogniser (JavaVM *jvm) | |
| DECLARE_CLASS_KEY ("linear") | |
| DECLARE_CLASS_TITLE ("Linear Recogniser") | |
| DECLARE_CLASS_DESCRIPTION ("<B>Simple Linear Recogniser</B><BR><BR>""Although it requires 2 or more features to work, ""there are no restrictions on which features can or ""cannot be used.") | |
Static Public Member Functions | |
| static const std::string & | classKey () |
| static const std::string & | classTitle () |
| static const std::string & | classDescription () |
Protected Member Functions | |
| bool | readModelFile (const QString &fileName) |
| ClassProbabilities | classifyGestureImp (const DGestureRecord &gesture, const QVector< FeatureResultT > &featureVec) |
| LinearRecogniser::LinearRecogniser | ( | ) |
| LinearRecogniser::~LinearRecogniser | ( | ) |
| LinearRecogniser::LinearRecogniser | ( | JavaVM * | jvm | ) |
| static const std::string& LinearRecogniser::classKey | ( | ) | [inline, static] |
| virtual const std::string& LinearRecogniser::key | ( | ) | const [inline, virtual] |
Returns the recogniser's "key". This is used for identifying recognisers for purposes such as recording the type of a given trained recogniser and for use in "factories".
This string should only contain lower-case characters. All string matching performed with it will be case-insensitive.
Note: This does not return a (const) reference for the sake of "wrappers" (e.g. JavaRecogniserWrapper and StlRecogniserWrapper), which may have to convert the string from a different structure, usually with the use of a temporary variable. Qt's implicit sharing will help performance.
Implements AbstractRecogniser.
| static const std::string& LinearRecogniser::classTitle | ( | ) | [inline, static] |
| virtual const std::string& LinearRecogniser::title | ( | ) | const [inline, virtual] |
Returns the recogniser's "title". This is used in the application's user interface to label the recogniser in a human friendly / readable manner.
Note: This does not return a (const) reference for the sake of "wrappers" (e.g. JavaRecogniserWrapper and StlRecogniserWrapper), which may have to convert the string from a different structure, usually with the use of a temporary variable. Qt's implicit sharing will help performance.
Implements AbstractRecogniser.
| static const std::string& LinearRecogniser::classDescription | ( | ) | [inline, static] |
| virtual const std::string& LinearRecogniser::description | ( | ) | const [inline, virtual] |
Returns the recogniser's "description". This is used in the application's user interface to provide more information to the user about the recogniser.
A subset of HTML may be used, such as to make the text bold and change its colour, size and alignment. Please see the Qt documentation for more details on its HTML support.
Note: This does not return a (const) reference for the sake of "wrappers" (e.g. JavaRecogniserWrapper and StlRecogniserWrapper), which may have to convert the string from a different structure, usually with the use of a temporary variable. Qt's implicit sharing will help performance.
Implements AbstractRecogniser.
| const map< string, string > & LinearRecogniser::defaultParams | ( | ) | const [virtual] |
Implements AbstractRecogniser.
| bool LinearRecogniser::initTraining | ( | const list< string > & | featureKeys, | |
| const map< string, string > & | params | |||
| ) |
| bool LinearRecogniser::examineSample | ( | const StlFeatureVec & | featureVec, | |
| const set< int > & | classes | |||
| ) |
| bool LinearRecogniser::finaliseTraining | ( | ) | [virtual] |
This is used primarily for building the model if that wasn't (completely) done by examineSample().
This should also be used to free any allocated memory and to clear the state, remembering that train() may be called multiple times.
Implements AbstractRecogniser.
| bool LinearRecogniser::writeModelFile | ( | const string & | fileName | ) |
| bool LinearRecogniser::readModelFile | ( | const string & | fileName | ) |
| StlStroke LinearRecogniser::flatten | ( | const StlStrokeList & | strokes | ) | [virtual] |
This is used to flatten/link/join/merge a (potentially) multi-stroke gesture before feature extraction is performed (and thus examination or classification).
If any filtering needs to be performed on the stroke(s), then it should be done by this method. This includes smoothing the stroke(s) or even reducing the number of points in them.
This default implementation simply joins all of the strokes together. It does not join strokes together based on the location of their start and end points.
Note: This is non-const, as the recogniser may need to examine the stroke's structure and record information about it, ready for use by either classify() or examineSample().
Reimplemented from StlRecogniserInterface.
| StlClassProbabilities LinearRecogniser::classify | ( | const StlFeatureVec & | featureVec | ) | [virtual] |
Implements StlRecogniserInterface.
| LinearRecogniser::DECLARE_CLASS_KEY | ( | "linear" | ) |
| LinearRecogniser::DECLARE_CLASS_TITLE | ( | "Linear Recogniser" | ) |
| LinearRecogniser::DECLARE_CLASS_DESCRIPTION | ( | "<B>Simple Linear Recogniser</B><BR><BR>""Although it requires 2 or more features to | work, | |
| ""there are no restrictions on which features can or""cannot be used." | ||||
| ) |
| bool LinearRecogniser::readModelFile | ( | const QString & | fileName | ) | [protected, virtual] |
This method is called during initialisation, as to load in the recogniser specific model file that was created by the corresponding AbstractRecogniserTrainer::writeModelFile() method. Thus, this method will be called only once.
The fileName is the file name of the model file, including the path (e.g. "/Users/bob/Library/Digest/linear_recog52.model").
Because some recognisers may not require a training phase, or may not use a GestureLab managed model file for some other reason, this method could be implemented to just return true.
There are no restrictions on the file being binary or ascii, nor on its contents.
Implements AbstractRecogniser.
| ClassProbabilities LinearRecogniser::classifyGestureImp | ( | const DGestureRecord & | gesture, | |
| const QVector< FeatureResultT > & | featureVec | |||
| ) | [protected] |
1.5.2