1. A computer-implemented method of detecting a waving motion in a sequence of ordered points, the method comprising: receiving the sequence of ordered points; selecting a subset of the sequence of ordered points; determining a set of successive extreme points from the subset; determining a line segment between each pair of successive extreme points; determining a center point of the subset and a center point of each of the line segments; determining the waving motion based on a distance between the center point of the subset and the center point of each of the line segments is between a first threshold and a second threshold; and storing an indication of the waving motion on a memory.