diff align/TransformDTWAligner.cpp @ 780:8fa98f89eda8

Add subsequence DTW (not yet in use)
author Chris Cannam
date Wed, 01 Jul 2020 15:34:46 +0100
parents 699b5b130ea2
children b651dc5ff555
line wrap: on
line diff
--- a/align/TransformDTWAligner.cpp	Wed Jul 01 11:41:07 2020 +0100
+++ b/align/TransformDTWAligner.cpp	Wed Jul 01 15:34:46 2020 +0100
@@ -297,19 +297,19 @@
     
     for (int i = 0; in_range_for(alignment, i); ++i) {
 
-        // DTW returns "the index into s2 for each element in s1"
-        sv_frame_t refFrame = refFrames[i];
-
-        if (!in_range_for(otherFrames, alignment[i])) {
+        // DTW returns "the index into s1 for each element in s2"
+        sv_frame_t alignedFrame = otherFrames[i];
+        
+        if (!in_range_for(refFrames, alignment[i])) {
             SVCERR << "TransformDTWAligner::makePath: Internal error: "
-                   << "DTW maps index " << i << " in reference frame vector "
-                   << "(size " << refFrames.size() << ") onto index "
-                   << alignment[i] << " in other frame vector "
-                   << "(only size " << otherFrames.size() << ")" << endl;
+                   << "DTW maps index " << i << " in other frame vector "
+                   << "(size " << otherFrames.size() << ") onto index "
+                   << alignment[i] << " in ref frame vector "
+                   << "(only size " << refFrames.size() << ")" << endl;
             continue;
         }
             
-        sv_frame_t alignedFrame = otherFrames[alignment[i]];
+        sv_frame_t refFrame = refFrames[alignment[i]];
         path.add(PathPoint(alignedFrame, refFrame));
     }
 
@@ -361,7 +361,7 @@
                << "]: serialising DTW to avoid over-allocation" << endl;
 #endif
         QMutexLocker locker(&m_dtwMutex);
-        alignment = dtw.alignSeries(s1, s2);
+        alignment = dtw.alignSequences(s1, s2);
     }
 
 #ifdef DEBUG_TRANSFORM_DTW_ALIGNER
@@ -450,7 +450,7 @@
                << "]: serialising DTW to avoid over-allocation" << endl;
 #endif
         QMutexLocker locker(&m_dtwMutex);
-        alignment = dtw.alignSeries(s1, s2);
+        alignment = dtw.alignSequences(s1, s2);
     }
 
 #ifdef DEBUG_TRANSFORM_DTW_ALIGNER