|
@@ -60,12 +60,10 @@ BoWFeatureConverter::~BoWFeatureConverter()
|
|
|
void BoWFeatureConverter::calcHistogram ( const NICE::VVector & features,
|
|
|
NICE::Vector & histogram , const bool & b_resetHistogram )
|
|
|
{
|
|
|
- if ( b_resetHistogram )
|
|
|
+ if ( b_resetHistogram || (histogram.size() != this->codebook->getCodebookSize() ) )
|
|
|
{
|
|
|
histogram.resize( this->codebook->getCodebookSize() );
|
|
|
histogram.set(0);
|
|
|
-
|
|
|
- fprintf (stderr, "BoWFeatureConverter: number of features = %d, codebook size = %d\n", (int)features.size(), (int)codebook->getCodebookSize());
|
|
|
}
|
|
|
|
|
|
int cluster_index = 0;
|
|
@@ -78,7 +76,7 @@ void BoWFeatureConverter::calcHistogram ( const NICE::VVector & features,
|
|
|
featIt++ )
|
|
|
{
|
|
|
const NICE::Vector & x = *featIt;
|
|
|
- this->codebook->vote ( x, histogram, cluster_index, weight, distance );
|
|
|
+ this->codebook->voteVQ ( x, cluster_index, weight, distance );
|
|
|
histogram[ cluster_index ] ++;
|
|
|
}
|
|
|
}
|