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

template<class T>
int Impala::Core::VideoSet::HistogramExtractor::ComputeBin ( const T  val,
const T  low,
const T  high,
const int  nrBins 
) const [inline, protected]

Definition at line 94 of file HistogramExtractor.h.

References ILOG_WARN.

Referenced by Impala::Core::VideoSet::RgbHistExtractor::ComputeHistogram(), Impala::Core::VideoSet::LabHistExtractor::ComputeHistogram(), and Impala::Core::VideoSet::LabHist3dExtractor::ComputeHistogram().

00095     {
00096         const int bin = (nrBins * (val - low)) / (high - low);
00097         if (bin >= 0 && bin < nrBins)
00098             return bin;
00099 
00100         if (val == high)
00101             return nrBins - 1;
00102 
00103         ILOG_WARN("Unexpected value: " << val << 
00104             " is not in range [" << low << ", " << high << "]");
00105         return (bin < 0) ? 0 : nrBins-1;
00106     }


Generated on Thu Jan 13 09:21:53 2011 for ImpalaSrc by  doxygen 1.5.1