comparison align/TransformDTWAligner.cpp @ 769:a316cb6fed81 pitch-align

Fixes to notification and completion in aligners
author Chris Cannam
date Thu, 28 May 2020 17:04:36 +0100
parents 1b1960009be6
children 1d6cca5a5621
comparison
equal deleted inserted replaced
768:1b1960009be6 769:a316cb6fed81
239 for (auto e: events) { 239 for (auto e: events) {
240 s2.push_back(m_outputPreprocessor(e.getValue())); 240 s2.push_back(m_outputPreprocessor(e.getValue()));
241 } 241 }
242 } 242 }
243 243
244 SVCERR << "TransformDTWAligner[" << this << "]: performAlignment: " 244 SVCERR << "TransformDTWAligner[" << this << "]: performAlignmentMagnitude: "
245 << "Have " << s1.size() << " events from reference, " 245 << "Have " << s1.size() << " events from reference, "
246 << s2.size() << " from toAlign" << endl; 246 << s2.size() << " from toAlign" << endl;
247 247
248 MagnitudeDTW dtw; 248 MagnitudeDTW dtw;
249 vector<size_t> alignment; 249 vector<size_t> alignment;
255 QMutexLocker locker(&mutex); 255 QMutexLocker locker(&mutex);
256 256
257 alignment = dtw.alignSeries(s1, s2); 257 alignment = dtw.alignSeries(s1, s2);
258 } 258 }
259 259
260 SVCERR << "TransformDTWAligner[" << this << "]: performAlignment: " 260 SVCERR << "TransformDTWAligner[" << this << "]: performAlignmentMagnitude: "
261 << "DTW produced " << alignment.size() << " points:" << endl; 261 << "DTW produced " << alignment.size() << " points:" << endl;
262 for (int i = 0; i < alignment.size() && i < 100; ++i) { 262 for (int i = 0; i < alignment.size() && i < 100; ++i) {
263 SVCERR << alignment[i] << " "; 263 SVCERR << alignment[i] << " ";
264 } 264 }
265 SVCERR << endl; 265 SVCERR << endl;
276 sourceFrame += resolution; 276 sourceFrame += resolution;
277 } 277 }
278 278
279 alignmentModel->setPath(path); 279 alignmentModel->setPath(path);
280 280
281 SVCERR << "TransformDTWAligner[" << this << "]: performAlignment: Done" 281 SVCERR << "TransformDTWAligner[" << this << "]: performAlignmentMagnitude: Done"
282 << endl; 282 << endl;
283 283
284 m_incomplete = false; 284 m_incomplete = false;
285 return true; 285 return true;
286 } 286 }
325 convertEvents(referenceOutputSTVM->getAllEvents()); 325 convertEvents(referenceOutputSTVM->getAllEvents());
326 326
327 vector<RiseFallDTW::Value> s2 = 327 vector<RiseFallDTW::Value> s2 =
328 convertEvents(toAlignOutputSTVM->getAllEvents()); 328 convertEvents(toAlignOutputSTVM->getAllEvents());
329 329
330 SVCERR << "TransformDTWAligner[" << this << "]: performAlignment: " 330 SVCERR << "TransformDTWAligner[" << this << "]: performAlignmentRiseFall: "
331 << "Have " << s1.size() << " events from reference, " 331 << "Have " << s1.size() << " events from reference, "
332 << s2.size() << " from toAlign" << endl; 332 << s2.size() << " from toAlign" << endl;
333 333
334 RiseFallDTW dtw; 334 RiseFallDTW dtw;
335 335
342 QMutexLocker locker(&mutex); 342 QMutexLocker locker(&mutex);
343 343
344 alignment = dtw.alignSeries(s1, s2); 344 alignment = dtw.alignSeries(s1, s2);
345 } 345 }
346 346
347 SVCERR << "TransformDTWAligner[" << this << "]: performAlignment: " 347 SVCERR << "TransformDTWAligner[" << this << "]: performAlignmentRiseFall: "
348 << "DTW produced " << alignment.size() << " points:" << endl; 348 << "DTW produced " << alignment.size() << " points:" << endl;
349 for (int i = 0; i < alignment.size() && i < 100; ++i) { 349 for (int i = 0; i < alignment.size() && i < 100; ++i) {
350 SVCERR << alignment[i] << " "; 350 SVCERR << alignment[i] << " ";
351 } 351 }
352 SVCERR << endl; 352 SVCERR << endl;
363 sourceFrame += resolution; 363 sourceFrame += resolution;
364 } 364 }
365 365
366 alignmentModel->setPath(path); 366 alignmentModel->setPath(path);
367 367
368 SVCERR << "TransformDTWAligner[" << this << "]: performAlignment: Done" 368 SVCERR << "TransformDTWAligner[" << this << "]: performAlignmentRiseFall: Done"
369 << endl; 369 << endl;
370 370
371 m_incomplete = false; 371 m_incomplete = false;
372 return true; 372 return true;
373 } 373 }