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

void Impala::Core::VideoSet::KfrMotionExtractor::LoadEnergyTemplate ( int  bWidth,
int  bHeight 
) [inline]

Definition at line 529 of file KfrMotionExtractor.h.

References DumpWeightMatrix(), m_TPLMax, m_TPLMin, m_verbose2, m_Weight, and TPL_NUM.

Referenced by HandleNewFrame().

00530     {
00531         int i=0,j=0;
00532 
00533         // pan: horizontal template
00534         int base = 1;
00535         int delta = 4;
00536         for (i=0; i<bWidth; i++)
00537             for (j=0; j<bHeight; j++)
00538             {
00539                 m_Weight[0][j*bWidth+i] = base + delta*i;
00540             }
00541         m_TPLMin[0] = base;
00542         m_TPLMax[0] = base + delta*(bWidth-1);
00543 
00544         // tilt: vertical tempate
00545         delta = 5;
00546         for (j=0; j<bHeight; j++)   
00547             for (i=0; i<bWidth; i++)
00548             {
00549                 m_Weight[1][j*bWidth+i] = base + delta*j;
00550             }
00551         m_TPLMin[1] = base;
00552         m_TPLMax[1] = base + delta*(bHeight-1);
00553 
00554         // zoom: radial tempate
00555         delta=16;
00556         int k=0;
00557         int dim = (bWidth<=bHeight) ? bWidth: bHeight;
00558         for (k=0; k<dim/2; k++)
00559         {
00560             // first column: left
00561             i=0+k;
00562             for (j=0+k; j<bHeight-k; j++)
00563             {
00564                 m_Weight[2][j*bWidth+i] = base + delta*k;
00565             }
00566 
00567             // last colum: right
00568             i=bWidth-1-k;
00569             for (j=0+k; j<bHeight-k; j++)
00570             {
00571                 m_Weight[2][j*bWidth+i] = base + delta*k;
00572             }
00573 
00574             // first row: top
00575             j=0+k;
00576             for (i=0+k; i<bWidth-k; i++)
00577             {
00578                 m_Weight[2][j*bWidth+i] = base + delta*k;
00579             }
00580 
00581             // last row: bottom
00582             j=bHeight-1-k;
00583             for (i=0+k; i<bWidth-k; i++)
00584             {
00585                 m_Weight[2][j*bWidth+i] = base + delta*k;
00586             }
00587 
00588             //DumpWeightMatrix(m_Weight[2], bWidth, bHeight, 2);
00589 
00590         }
00591 
00592         // if dim is odd, one row or one colum will NOT be process.
00593         // here, we will do this processing for the left one.
00594         m_TPLMin[2] = base;
00595         m_TPLMax[2] = base + delta*k;
00596         if (dim%2==1)
00597         {
00598             if (bWidth >= bHeight)
00599             {
00600                 // middle row
00601                 j=0+k;
00602                 for (i=0+k; i<bWidth-k; i++)
00603                 {
00604                     m_Weight[2][j*bWidth+i] = base + delta*k;
00605                 }
00606             }
00607             else
00608             {
00609                 // middle column
00610                 i=0+k;
00611                 for (j=0+k; j<bHeight-k; j++)
00612                 {
00613                     m_Weight[2][j*bWidth+i] = base + delta*k;
00614                 }
00615             }
00616 
00617             //DumpWeightMatrix(m_Weight[2], bWidth, bHeight, 2);
00618         }
00619 
00620         // output the weight matrix
00621         if (m_verbose2)
00622         {
00623             for (int t=0;t<TPL_NUM;t++)
00624             {
00625                 DumpWeightMatrix(m_Weight[t], bWidth, bHeight, t);
00626             }
00627         }
00628 
00629     }

Here is the call graph for this function:


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