comparison src/Matcher.cpp @ 91:35e50f28720f refactors

Remove some debug out
author Chris Cannam
date Thu, 27 Nov 2014 13:02:28 +0000
parents 7785bb8a1be6
children 8b33cb568b10
comparison
equal deleted inserted replaced
90:7bb586054b16 91:35e50f28720f
304 // - no previous value in current row (resp. column) 304 // - no previous value in current row (resp. column)
305 // - no diagonal value if prev. dir. == curr. dirn 305 // - no diagonal value if prev. dir. == curr. dirn
306 306
307 double min2 = getPathCost(m_frameCount - 1, index); 307 double min2 = getPathCost(m_frameCount - 1, index);
308 308
309 cerr << "NOTE: missing value at i = " << m_frameCount << ", j = " 309 // cerr << "NOTE: missing value at i = " << m_frameCount << ", j = "
310 << index << " (first = " << m_firstPM << ")" << endl; 310 // << index << " (first = " << m_firstPM << ")" << endl;
311 311
312 // if ((m_firstPM && (first[m_frameCount - 1] == index)) || 312 // if ((m_firstPM && (first[m_frameCount - 1] == index)) ||
313 // (!m_firstPM && (m_last[index-1] < m_frameCount))) 313 // (!m_firstPM && (m_last[index-1] < m_frameCount)))
314 if (m_first[m_frameCount - 1] == index) { 314 if (m_first[m_frameCount - 1] == index) {
315 315
331 } else { 331 } else {
332 332
333 double min1 = getPathCost(m_frameCount, index - 1); 333 double min1 = getPathCost(m_frameCount, index - 1);
334 double min2 = getPathCost(m_frameCount - 1, index); 334 double min2 = getPathCost(m_frameCount - 1, index);
335 double min3 = getPathCost(m_frameCount - 1, index - 1); 335 double min3 = getPathCost(m_frameCount - 1, index - 1);
336
337 if (m_frameCount == 15 && index == 2) {
338 cerr << "i = "<< m_frameCount << ", j = " << index << ", "
339 << " min1 = " << min1 << ", "
340 << " min2 = " << min2 << ", "
341 << " min3 = " << min3 << endl;
342 }
343 336
344 double cost1 = min1 + distance; 337 double cost1 = min1 + distance;
345 double cost2 = min2 + distance; 338 double cost2 = min2 + distance;
346 double cost3 = min3 + diagDistance; 339 double cost3 = min3 + diagDistance;
347 340
382 } 375 }
383 376
384 if (m_firstPM) { 377 if (m_firstPM) {
385 378
386 m_distance[i][j - m_first[i]] = dMN; 379 m_distance[i][j - m_first[i]] = dMN;
387
388 if (i == 3 && j == 56) {
389 cerr << "i = "<< i << ", j = " << j << ", dir = "
390 << advanceToString(dir)
391 << ", dMN = " << dMN << ", diagonalWeight = "
392 << m_params.diagonalWeight << ", weighted = "
393 << weighted << ", result = " << value + weighted << endl;
394 }
395
396 setPathCost(i, j, dir, value + weighted); 380 setPathCost(i, j, dir, value + weighted);
397 381
398 } else { 382 } else {
399 383
400 if (dir == AdvanceThis) dir = AdvanceOther; 384 if (dir == AdvanceThis) dir = AdvanceOther;
401 else if (dir == AdvanceOther) dir = AdvanceThis; 385 else if (dir == AdvanceOther) dir = AdvanceThis;
402
403 if (i == 15 && j == 2) {
404 cerr << "i = "<< i << ", j = " << j << ", dir = "
405 << advanceToString(dir)
406 << ", dMN = " << dMN << ", diagonalWeight = "
407 << m_params.diagonalWeight << ", weighted = "
408 << weighted << ", value = " << value << ", result = " << value + weighted << endl;
409 }
410 386
411 int idx = i - m_otherMatcher->m_first[j]; 387 int idx = i - m_otherMatcher->m_first[j];
412 388
413 if (idx == (int)m_otherMatcher->m_distance[j].size()) { 389 if (idx == (int)m_otherMatcher->m_distance[j].size()) {
414 // This should never happen, but if we allow arbitrary 390 // This should never happen, but if we allow arbitrary