Definition at line 105 of file KernelSet.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(), mFilters, and mFilterSize. Referenced by Impala::Core::Tracking::TrackerBackFore::SearchObject(). 00106 { 00107 //multiply the values in the vector 'texture' with the Gabor filters to create an image 00108 Array::Array2dVec3Real64 mix(3*mFilterSize, mFilterSize, 0, 0); 00109 00110 int y; 00111 double* ip; 00112 for(y=0 ; y<mFilterSize ; y++) 00113 { 00114 ip = mix.CPB(0,y); 00115 int x; 00116 for(x=0 ; x<3*mFilterSize ; x++) 00117 { 00118 *ip = 0.0; 00119 ip++; 00120 } 00121 } 00122 00123 for(y=0 ; y<mFilterSize ; y++) 00124 { 00125 int i; 00126 for(i=0 ; i<mFilters.size() ; i++) 00127 { 00128 double *fp; 00129 ip = mix.CPB(0, y); 00130 fp = mFilters[i]->CPB(0, y); 00131 int x; 00132 for(x=0 ; x<mFilterSize ; x++) 00133 { 00134 double *tp; // texture pointer 00135 tp = texture.CPB(i*3, 0); 00136 // red 00137 *ip += *tp * *fp; 00138 tp++; 00139 ip++; 00140 // green 00141 *ip += *tp * *fp; 00142 tp++; 00143 ip++; 00144 // blue 00145 *ip += *tp * *fp; 00146 ip++; 00147 fp++; 00148 } 00149 } 00150 } 00151 00152 for(y=0 ; y<mFilterSize ; y++) 00153 { 00154 ip = mix.CPB(0, y); 00155 int x; 00156 for(x=0 ; x<3*mFilterSize ; x++) 00157 { 00158 *ip /= (double)mFilters.size(); //divide by the number of filters 00159 ip++; 00160 } 00161 } 00162 00163 //now add the images at the correct position 00164 for(y=0 ; y<mFilterSize ; y++) 00165 { 00166 if(y+posY>=0 && y+posY<image.CH()) 00167 { 00168 double *mp = mix.CPB(0, y); 00169 double *ip = image.CPB(posX, y+posY); 00170 for(int x=0 ; x<mFilterSize ; x++) 00171 { 00172 if(x+posX>=0 && x+posX<image.CW()) 00173 { 00174 ip[3*x] += mp[3*x]; 00175 ip[3*x+1] += mp[3*x+1]; 00176 ip[3*x+2] += mp[3*x+2]; 00177 } 00178 } 00179 } 00180 } 00181 }
Here is the call graph for this function:
|