multiplies the values in the vector 'texture' with the Gabor filters to create an image in: texture, posX, posY out: image Definition at line 117 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(). 00119 { 00120 Array::Array2dVec3Real64 mix(3*mFilterSize, mFilterSize, 0, 0); 00121 00122 int y; 00123 double* ip; 00124 for(y=0 ; y<mFilterSize ; y++) 00125 { 00126 ip = mix.CPB(0,y); 00127 int x; 00128 for(x=0 ; x<3*mFilterSize ; x++) 00129 { 00130 *ip = 0.0; 00131 ip++; 00132 } 00133 } 00134 00135 for(y=0 ; y<mFilterSize ; y++) 00136 { 00137 int i; 00138 for(i=0 ; i<mFilters.size() ; i++) 00139 { 00140 double *fp; 00141 ip = mix.CPB(0, y); 00142 fp = mFilters[i]->CPB(0, y); 00143 int x; 00144 for(x=0 ; x<mFilterSize ; x++) 00145 { 00146 double *tp; // texture pointer 00147 tp = texture.CPB(i*3, 0); 00148 // red 00149 *ip += *tp * *fp; 00150 tp++; 00151 ip++; 00152 // green 00153 *ip += *tp * *fp; 00154 tp++; 00155 ip++; 00156 // blue 00157 *ip += *tp * *fp; 00158 ip++; 00159 fp++; 00160 } 00161 } 00162 } 00163 00164 for(y=0 ; y<mFilterSize ; y++) 00165 { 00166 ip = mix.CPB(0, y); 00167 int x; 00168 for(x=0 ; x<3*mFilterSize ; x++) 00169 { 00170 *ip /= (double)mFilters.size(); //divide by the number of filters 00171 ip++; 00172 } 00173 } 00174 00175 //now add the images at the correct position 00176 for(y=0 ; y<mFilterSize ; y++) 00177 { 00178 if(y+posY>=0 && y+posY<image.CH()) 00179 { 00180 double *mp = mix.CPB(0, y); 00181 double *ip = image.CPB(posX, y+posY); 00182 for(int x=0 ; x<mFilterSize ; x++) 00183 { 00184 if(x+posX>=0 && x+posX<image.CW()) 00185 { 00186 ip[3*x] += mp[3*x]; 00187 ip[3*x+1] += mp[3*x+1]; 00188 ip[3*x+2] += mp[3*x+2]; 00189 } 00190 } 00191 } 00192 } 00193 }
Here is the call graph for this function:
|