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

void Impala::Core::VideoSet::Lbp ( Array::Array2dScalarUInt8 *&  dst,
Array::Array2dScalarReal64 *  src,
int *  patternMap,
int  samples,
int  radius 
)

Definition at line 124 of file LbpEval.h.

References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), ILOG_ERROR, ILOG_VAR, InterpolateAtPtr(), and MakePoints().

Referenced by Impala::Core::VideoSet::LbpEval::HandleNewFrame().

00129 {
00130     ILOG_VAR(Impala.Core.VidSet.LbpEval);
00131     int border2 = radius * 2;
00132     int height = src->CH();
00133     int width = src->CW();
00134     if(dst == 0)
00135         dst = new Array::Array2dScalarUInt8(width - border2, height - border2, 0, 0);
00136     if(patternMap == 0)
00137     {
00138         ILOG_ERROR("LBP features without map not supported");
00139         return;
00140     }
00141     
00142     // by multiplying with width+1 we go down and sideways at the same time
00143     double* center = src->CPB() + radius * (1 + width);
00144     double** ptr = new double*[samples];
00145     Geometry::PointZ* points;
00146     double* multipliers;
00147     MakePoints(samples, radius, points, multipliers);
00148 
00149     for(int i=0 ; i<samples ; i++)
00150         ptr[i] = center + points[i].mX + points[i].mY * width;
00151 
00152     for(int y=0 ; y<height-border2 ; y++)
00153     {
00154         unsigned char* dstPtr = dst->CPB(0,y);
00155         for(int x=0 ; x<width-border2 ; x++)
00156         {
00157             unsigned int value = 0;
00158             unsigned int base = 1;
00159             for (int i=0;i<samples;i++)
00160             {
00161                 if (InterpolateAtPtr(ptr[i],i,width,multipliers) >= *center)
00162                     value |= base;
00163                 base <<= 1;
00164                 ptr[i]++;
00165             }
00166             center++;
00167             *dstPtr = patternMap[value];
00168             ++dstPtr;
00169         }
00170         for(int i=0 ; i<samples ; i++)
00171             ptr[i] += border2;
00172         center += border2;
00173     }
00174 
00175     delete points;
00176     delete multipliers;
00177     delete ptr;
00178 }

Here is the call graph for this function:


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