template<class SrcArrayT>
Definition at line 190 of file HarrisLaplaceDetector.h. References Impala::Core::Array::Add(), DoMaxPoints(), Impala::Core::Array::GaussDerivative(), mPrecision, Impala::Core::Array::Mul(), Impala::Core::Array::MulVal(), mUseRecGauss, Impala::Core::Array::ProjectRange(), and Impala::Core::Array::RecGauss(). 00193 { 00194 Real64 sigmaIntegr = sigmaN; 00195 Real64 sigmaDiff = 0.7125 * sigmaN; 00196 00197 Array2dScalarReal64* TLx2 = 0; 00198 Array2dScalarReal64* TLy2 = 0; 00199 Array2dScalarReal64* TLxLy = 0; 00200 00201 for (int d=1 ; d<=imColor->ElemSize() ; d++) { 00202 Array2dScalarReal64* imIntensity = 0; 00203 ProjectRange(imIntensity, imColor, d); 00204 00205 // compute Lx and Ly Gaussian derivatives 00206 Array2dScalarReal64* Lx = 0; 00207 Array2dScalarReal64* Ly = 0; 00208 if(mUseRecGauss) 00209 { 00210 RecGauss(Lx, imIntensity, sigmaDiff, sigmaDiff, 1, 0, mPrecision); 00211 RecGauss(Ly, imIntensity, sigmaDiff, sigmaDiff, 0, 1, mPrecision); 00212 } else { 00213 GaussDerivative(Lx, imIntensity, sigmaDiff, 1, 0, mPrecision); 00214 GaussDerivative(Ly, imIntensity, sigmaDiff, 0, 1, mPrecision); 00215 } 00216 00217 delete imIntensity; 00218 00219 // VERY IMPORTANT: SCALE MULTIPLIER! 00220 Array2dScalarReal64* Lx2 = 0; // aka mu11 00221 Mul(Lx2, Lx, Lx); 00222 MulVal(Lx2, Lx2, sigmaDiff * sigmaDiff); 00223 00224 Array2dScalarReal64* Ly2 = 0; // aka mu22 00225 Mul(Ly2, Ly, Ly); 00226 MulVal(Ly2, Ly2, sigmaDiff * sigmaDiff); 00227 00228 Array2dScalarReal64* LxLy = 0; // aka mu12/mu21 00229 Mul(LxLy, Lx, Ly); 00230 MulVal(LxLy, LxLy, sigmaDiff * sigmaDiff); 00231 00232 delete Lx; 00233 delete Ly; 00234 00235 if(d == 1) { 00236 TLx2 = Lx2; 00237 TLy2 = Ly2; 00238 TLxLy = LxLy; 00239 } else { 00240 Add(TLx2,TLx2,Lx2); 00241 Add(TLy2,TLy2,Ly2); 00242 Add(TLxLy,TLxLy,LxLy); 00243 delete Lx2; 00244 delete Ly2; 00245 delete LxLy; 00246 } 00247 } 00248 00249 // compute Harris 00250 Array2dScalarReal64* harrisOutput = 0; 00251 Array::Harris<Array2dScalarReal64>(harrisOutput, TLx2, TLy2, TLxLy, 00252 sigmaIntegr, harrisK, mUseRecGauss); 00253 delete TLx2; 00254 delete TLy2; 00255 delete TLxLy; 00256 DoMaxPoints(harrisOutput, std::back_inserter(pointList), harrisThreshold); 00257 00258 // write the Harris cornerness to an image on disk 00259 /*std::string output = "debug.png"; 00260 Array2dVec3UInt8* buf = ArrayCreate<Array2dVec3UInt8> 00261 (harrisOutput->CW(), harrisOutput->CH()); 00262 GetRgbPixels(harrisOutput, buf->CPB(), std::string("Stretch")); 00263 00264 WritePng(buf, output); 00265 delete buf;*/ 00266 00267 delete harrisOutput; 00268 }
Here is the call graph for this function:
|