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

void Impala::Core::Tracking::KernelSet::Apply ( double *  buffer,
Array::Array2dVec3Real64 image,
int  posX,
int  posY 
) [inline]

todo make this a template member? [type of image]

Definition at line 50 of file KernelSet.h.

References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::BH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::BW(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), mFilters, and mFilterSize.

Referenced by Impala::Core::Tracking::TrackerBackFore::ComputeBackgroundResponse(), Impala::Core::Tracking::TrackerBackFore::SetForeground(), and Impala::Core::Tracking::TrackerBackFore::UpdateObject().

00051     {
00052         // first clear result
00053         int i;
00054         for(i=0 ; i<3*mFilters.size() ; i++)
00055             buffer[i] = 0;
00056 
00057         // check for out of bounds
00058         int radius = mFilterSize / 2;
00059         if (posX-radius <= -image.BW() ||
00060             posY-radius <= -image.BH() ||
00061             posX+radius >= image.CW() + image.BW() ||
00062             posY+radius >= image.CH() + image.BH())
00063         {
00064             return;
00065         }
00066 
00067         posX -= radius;
00068         posY -= radius;
00069         int y;
00070         for(y=0 ; y<mFilterSize ; y++)
00071         {
00072             for(i=0 ; i<mFilters.size() ; i++)
00073             {
00074                 double* ip; // image pointer
00075                 double* fp; // filter pointer
00076                 ip = image.CPB(posX, y+posY);
00077                 fp = mFilters[i]->CPB(0, y);
00078                 int x;
00079                 for(x=0 ; x<mFilterSize ; x++)
00080                 {
00081                     double* tp; // texture pointer
00082                     tp = buffer+(i*3);
00083                     *tp += *ip * *fp;
00084                     tp++;
00085                     ip++;
00086                     *tp += *ip * *fp;
00087                     tp++;
00088                     ip++;
00089                     *tp += *ip * *fp;
00090                     ip++;
00091                     fp++;
00092                 }
00093             }
00094         }
00095 
00096         double total=0;
00097         for(i=0 ; i<3*mFilters.size() ; i++)
00098         {
00099             buffer[i] /= (double)mFilterSize*mFilterSize;
00100             total += buffer[i];
00101         }
00102     }

Here is the call graph for this function:


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