February 2018
Intermediate to advanced
378 pages
10h 14m
English
There are two versions of the algorithm (with locality constraint, and without it). We'll implement both.
The full source code for the application we are developing in this chapter can be found in the MotionClassification folder of supplementary materials.
Let's define a DTW structure, and create a static function distance in it:
func distance(sVec: [Double], tVec: [Double]) -> Double {
First, we're creating a distance matrix of size (n+1 x m+1), and populating it with some values: the first cell of the matrix should be equal to zero, and the first row and the first column should be equal to a maximum double value. This is needed to handle border conditions in a proper way later. The first cell plays a role of ...
Read now
Unlock full access