# HG changeset patch # User Chris Cannam # Date 1414770855 0 # Node ID 1ff9ae1dcb507a2dfa22d3d27b0803a8a59455b7 # Parent 7784b0a0dd4d83e82bf31eda547e2b672afa30fc Make smoothing optional (internally, not exposed as a parameter) diff -r 7784b0a0dd4d -r 1ff9ae1dcb50 Finder.cpp --- a/Finder.cpp Fri Oct 31 15:42:40 2014 +0000 +++ b/Finder.cpp Fri Oct 31 15:54:15 2014 +0000 @@ -247,7 +247,7 @@ } // recalculatePathCostMatrix() int -Finder::retrievePath(vector &pathx, vector &pathy) +Finder::retrievePath(bool smooth, vector &pathx, vector &pathy) { int x = pm2->getFrameCount() - 1; int y = pm1->getFrameCount() - 1; @@ -273,9 +273,12 @@ std::reverse(pathx.begin(), pathx.end()); std::reverse(pathy.begin(), pathy.end()); - int smoothedLen = Path().smooth(pathx, pathy, pathx.size()); - - return smoothedLen; + if (smooth) { + int smoothedLen = Path().smooth(pathx, pathy, pathx.size()); + return smoothedLen; + } else { + return pathx.size(); + } } diff -r 7784b0a0dd4d -r 1ff9ae1dcb50 Finder.h --- a/Finder.h Fri Oct 31 15:42:40 2014 +0000 +++ b/Finder.h Fri Oct 31 15:54:15 2014 +0000 @@ -93,8 +93,10 @@ * pathy. Return value is the length of the returned path: only * this many elements from pathx and pathy are valid (any * subsequent ones may be spurious). + * + * @param smooth whether to smooth the path before returning it */ - int retrievePath(std::vector &pathx, std::vector &pathy); + int retrievePath(bool smooth, std::vector &pathx, std::vector &pathy); }; // class Finder diff -r 7784b0a0dd4d -r 1ff9ae1dcb50 MatchVampPlugin.cpp --- a/MatchVampPlugin.cpp Fri Oct 31 15:42:40 2014 +0000 +++ b/MatchVampPlugin.cpp Fri Oct 31 15:54:15 2014 +0000 @@ -487,7 +487,7 @@ Finder *finder = feeder->getFinder(); std::vector pathx; std::vector pathy; - int len = finder->retrievePath(pathx, pathy); + int len = finder->retrievePath(true, pathx, pathy); FeatureSet returnFeatures;