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

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

Definition at line 125 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().

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

Here is the call graph for this function:


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