Mercurial > hg > match-vamp
comparison Finder.cpp @ 31:1ff9ae1dcb50
Make smoothing optional (internally, not exposed as a parameter)
author | Chris Cannam |
---|---|
date | Fri, 31 Oct 2014 15:54:15 +0000 |
parents | 7784b0a0dd4d |
children | 333832a6ee5e |
comparison
equal
deleted
inserted
replaced
30:7784b0a0dd4d | 31:1ff9ae1dcb50 |
---|---|
245 prevRowStop = c; | 245 prevRowStop = c; |
246 } | 246 } |
247 } // recalculatePathCostMatrix() | 247 } // recalculatePathCostMatrix() |
248 | 248 |
249 int | 249 int |
250 Finder::retrievePath(vector<int> &pathx, vector<int> &pathy) | 250 Finder::retrievePath(bool smooth, vector<int> &pathx, vector<int> &pathy) |
251 { | 251 { |
252 int x = pm2->getFrameCount() - 1; | 252 int x = pm2->getFrameCount() - 1; |
253 int y = pm1->getFrameCount() - 1; | 253 int y = pm1->getFrameCount() - 1; |
254 | 254 |
255 pathx.clear(); | 255 pathx.clear(); |
271 } | 271 } |
272 | 272 |
273 std::reverse(pathx.begin(), pathx.end()); | 273 std::reverse(pathx.begin(), pathx.end()); |
274 std::reverse(pathy.begin(), pathy.end()); | 274 std::reverse(pathy.begin(), pathy.end()); |
275 | 275 |
276 int smoothedLen = Path().smooth(pathx, pathy, pathx.size()); | 276 if (smooth) { |
277 | 277 int smoothedLen = Path().smooth(pathx, pathy, pathx.size()); |
278 return smoothedLen; | 278 return smoothedLen; |
279 } else { | |
280 return pathx.size(); | |
281 } | |
279 } | 282 } |
280 | 283 |
281 | 284 |