Definition at line 33 of file KfrDiffExtractor.h. References BINS_PER_CHANNEL, Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::VideoSet::KfrMotionExtractor::ComputeBin(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), Impala::Core::Vector::DivAssign(), Impala::Core::VideoSet::KfrMotionExtractor::GetBinCount(), and Impala::Core::Vector::VectorTem< ElemT >::GetData(). 00034 { 00035 UInt8* data = image->CPB(0, 0); 00036 const int nPix = image->CW() * image->CH(); 00037 00038 VectorReal64 histogram(GetBinCount()); 00039 Real64* histR = histogram.GetData(); 00040 Real64* histG = histR + BINS_PER_CHANNEL; 00041 Real64* histB = histG + BINS_PER_CHANNEL; 00042 00043 for (int i = 0; i < GetBinCount(); i++) 00044 histR[i] = 0; 00045 00046 for (int j = 0; j < nPix; j++) 00047 { 00048 const int r = ComputeBin((int) data[0], 0, 255, BINS_PER_CHANNEL); 00049 histR[r] += 1; 00050 00051 const int g = ComputeBin((int) data[1], 0, 255, BINS_PER_CHANNEL); 00052 histG[g] += 1; 00053 00054 const int b = ComputeBin((int) data[2], 0, 255, BINS_PER_CHANNEL); 00055 histB[b] += 1; 00056 00057 data += 3; 00058 } 00059 00060 const Real64 factor = nPix; 00061 Vector::DivAssign(histogram, factor); 00062 00063 return histogram; 00064 }
Here is the call graph for this function:
|