Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class ArrayT>
void Impala::Core::Vector::HistogramAccumulation ( VectorSet< ArrayT > *  vs,
bool  doNormalizeHeight,
bool  doNormalizeWeight,
bool *  filter 
) [inline]

Treat vectors as histograms and turn them into cumulative histograms.

Todo:
: the name is not correct??

Definition at line 22 of file HistogramAccumulation.h.

References DivAssign(), Impala::Core::Vector::VectorSet< ArrayT >::GetVector(), Impala::Core::Vector::VectorSet< ArrayT >::Size(), and Sum().

Referenced by Impala::Core::Feature::VisSem::ComputeRegionDescriptor().

00024 {
00025     for (int i=0 ; i<vs->Size() ; i++)
00026     {
00027         if (filter && (!filter[i]))
00028             continue;
00029         typename VectorSet<ArrayT>::VectorT v = vs->GetVector(i, true);
00030         typename VectorSet<ArrayT>::ElemT* p = v.GetData();
00031         for (int i=1 ; i<v.Size() ; i++)
00032             p[i] += p[i-1];
00033         if (doNormalizeHeight || doNormalizeWeight)
00034         {
00035             typename VectorSet<ArrayT>::ElemT factor;
00036             factor = (doNormalizeHeight) ? p[v.Size()-1] : Sum(v);
00037             if (factor == 0)
00038                 v = 0;
00039             else
00040                 DivAssign(v, factor);
00041         }
00042     }
00043 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:27:07 2010 for ImpalaSrc by  doxygen 1.5.1