Skip to content

Gesture identifier implemented with Kernel Principal Component Analysis on top of ROS

License

Notifications You must be signed in to change notification settings

rtzoeller/kpca-gesture-identifier

Repository files navigation

KPCA Gesture Identifier

What is it?

KPCA Gesture Identifier is a ROS package for recognizing and matching gestures and trajectories with training data. It uses Kernel Principal Component Analysis to separate the training data, and a simple K-nearest neighbors algorithm to perform classification on this space.

Usage

The package is comprised of a number of generic source files that do not depend on ROS, located in src/. ROS nodes live in nodes/. Several launch files exist in launch/ — these can be used directly to interface with the training data, or modified to use a different data set.

It may be useful to run the command rostopic echo /trajectory_shape for debugging purposes — this is the topic that the matched gesture will be published on.

Support is included for recognizing mouse movement with in a dedicated window, although this serves primarily as a demo. It is likely desirable to replace this front end with a custom one suited for your application.

Front End/Utility Nodes Back End Nodes
MouseTrackerNode TrajectoryNormalizerNode
TrajectorySaverNode NormalizedTrajectoryMatcherNode
BlobTrackerNode

As part of matching trajectories, both the training data as well as the test data must be normalized. Built in normalization methods include:

Name Description
default Alias for linear_time_invariant, may change.
linear Points are resampled uniformly by time — linear interpolation is used between points. Each axis of the input data is scaled independently.
linear_time_invariant Points are resampled uniformly by distance — linear interpolation is used between points. Each axis of the input data is scaled independently.
cubic_spline Points are resampled uniformly by time — cubic splines are used to interpolate between points. Each axis of the input_data is scaled independently.
linear_scale_uniform Like linear, except axes are not scaled independently.
linear_time_invariant_scale_uniform Like linear_time_invariant, except axes are not scaled independently.
cubic_spline_scale_uniform Like cubic_spline, except axes are not scaled independently.
none Indicates you will handle interpolation yourself. See below.

If a built in normalization method is sufficient, launching a TrajectoryNormalizerNode and specifying an interpolation_strategy on the parameter server will automatically normalize and convert TrajectoryStamped messages into the Trajectory message accepted by NormalizedTrajectoryMatcherNode.

In the case that you want to handle normalization yourself, you must specify none as the interpolation_strategy and additionally ensure all training data has been normalized prior to being saved to disk.

About

Gesture identifier implemented with Kernel Principal Component Analysis on top of ROS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published