Home || Visual Search || Applications || Architecture || 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 55 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().

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

Here is the call graph for this function:


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