# HG changeset patch # User Chris Cannam # Date 1417699390 0 # Node ID 6636aca831c082e99c3fc20d1a9b69f04d711e9a # Parent 593054bf647638ab5606bc1b34644cf439bbf591 Feature size is not actually needed in Matcher diff -r 593054bf6476 -r 6636aca831c0 src/MatchVampPlugin.cpp --- a/src/MatchVampPlugin.cpp Thu Dec 04 13:05:16 2014 +0000 +++ b/src/MatchVampPlugin.cpp Thu Dec 04 13:23:10 2014 +0000 @@ -331,8 +331,8 @@ m_fe2 = new FeatureExtractor(m_feParams); m_fc1 = new FeatureConditioner(m_fcParams); m_fc2 = new FeatureConditioner(m_fcParams); - m_pm1 = new Matcher(m_params, 0, m_fe1->getFeatureSize()); - m_pm2 = new Matcher(m_params, m_pm1, m_fe2->getFeatureSize()); + m_pm1 = new Matcher(m_params, 0); + m_pm2 = new Matcher(m_params, m_pm1); m_pm1->setOtherMatcher(m_pm2); m_feeder = new MatchFeatureFeeder(m_pm1, m_pm2); } diff -r 593054bf6476 -r 6636aca831c0 src/Matcher.cpp --- a/src/Matcher.cpp Thu Dec 04 13:05:16 2014 +0000 +++ b/src/Matcher.cpp Thu Dec 04 13:23:10 2014 +0000 @@ -25,13 +25,12 @@ //#define DEBUG_MATCHER 1 -Matcher::Matcher(Parameters parameters, Matcher *p, int m_featureSize_) : +Matcher::Matcher(Parameters parameters, Matcher *p) : m_params(parameters), - m_featureSize(m_featureSize_), m_metric(parameters.distanceNorm) { #ifdef DEBUG_MATCHER - cerr << "Matcher::Matcher(" << m_params.sampleRate << ", " << p << ", " << m_featureSize << ")" << endl; + cerr << "Matcher::Matcher(" << m_params.sampleRate << ", " << p << ")" << endl; #endif m_otherMatcher = p; // the first matcher will need this to be set later @@ -60,8 +59,7 @@ { if (m_initialised) return; - m_frames = vector > - (m_blockSize, vector(m_featureSize, -1.0)); + m_frames = vector >(m_blockSize); m_distXSize = m_blockSize * 2; diff -r 593054bf6476 -r 6636aca831c0 src/Matcher.h --- a/src/Matcher.h Thu Dec 04 13:05:16 2014 +0000 +++ b/src/Matcher.h Thu Dec 04 13:23:10 2014 +0000 @@ -119,11 +119,8 @@ * this one is going to be matched. Some information is shared * between the two matchers (currently one possesses the distance * matrix and optimal path matrix). - * - * @param featureSize Number of values in each of the feature - * vectors that will be provided. */ - Matcher(Parameters parameters, Matcher *p, int featureSize); + Matcher(Parameters parameters, Matcher *p); /** Destructor for Matcher. */ @@ -165,8 +162,8 @@ * updating the optimal path matrix using the dynamic time * warping algorithm. * - * The supplied feature must be of the size that was passed as - * featureSize to the constructor. + * The supplied features must always be of the same size (within + * any pair of Matcher objects). */ void consumeFeatureVector(std::vector feature); @@ -297,9 +294,6 @@ */ int m_runCount; - /** The number of values in a feature vector. */ - int m_featureSize; - /** A block of previously seen feature frames is stored in this * structure for calculation of the distance matrix as the new * frames are received. One can think of the structure of the