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

template<int INDEX_SIZE, int ORI_SIZE>
void Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::SamplePoint ( Real64 descriptor,
Array::Array2dScalarReal64 magnitude,
Array::Array2dScalarReal64 direction,
Real64  scale,
Real64  y,
Real64  x,
Real64  pointOrientation 
) [inline]

Definition at line 291 of file KoenFIST2.h.

References Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::InternalSample(), Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::mCustomNorm, Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::mNoMaxBins, Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::mOutputMultiplier, and Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::VecLength.

Referenced by Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::DoCalculateFISTDescriptors().

00294     {
00295         for(int j = 0; j < VecLength; j++)
00296         {
00297             descriptor[j] = 0.0;
00298         }
00299 
00300         InternalSample(descriptor, magnitude, direction, scale, y, x, pointOrientation);
00301         
00302         if(mCustomNorm < 0)
00303         {
00304             // Normalize length of vec
00305             Real64 sqlen = 0.0;
00306             for (int j = 0; j < VecLength; j++)
00307                 sqlen += (descriptor[j] * descriptor[j]);
00308     
00309             Real64 factor = 1.0 / sqrt(sqlen);
00310             if(sqlen == 0.0) factor = 1.0;
00311             //std::cout << x << " " << sqlen << " " << factor << std::endl;
00312     
00313             const Real64 maxBinValue = 0.2f;
00314             for (int j = 0; j < VecLength; j++)
00315             {
00316                 descriptor[j] = descriptor[j] * factor;
00317                 if(descriptor[j] > maxBinValue)
00318                 {
00319                     descriptor[j] = maxBinValue;
00320                 }
00321             }
00322     
00323             // Normalize length of vec
00324             sqlen = 0.0;
00325             for (int j = 0; j < VecLength; j++)
00326                 sqlen += (descriptor[j] * descriptor[j]);
00327     
00328             factor = 1.0 / sqrt(sqlen);
00329             if(sqlen == 0.0) factor = 1.0;
00330             //std::cout << x << " " << factor << std::endl;
00331             
00332             for (int j = 0; j < VecLength; j++)
00333                 descriptor[j] = static_cast<int>(descriptor[j] * factor * mOutputMultiplier);
00334         }
00335         else if(mCustomNorm == 0)
00336         {
00337             for (int j = 0; j < VecLength; j++)
00338                 descriptor[j] = descriptor[j] * mOutputMultiplier;
00339         }
00340         else
00341         {
00342             // Normalize length of vec
00343             Real64 sqlen = 0.0;
00344             for (int j = 0; j < VecLength; j++)
00345                 sqlen += pow(descriptor[j], mCustomNorm);
00346     
00347             Real64 factor = 1.0 / pow(sqlen, 1.0 / mCustomNorm);
00348             if(sqlen == 0.0) factor = 1.0;
00349 
00350             if(!mNoMaxBins)
00351             {
00352                 const Real64 maxBinValue = 0.2f;
00353                 for (int j = 0; j < VecLength; j++)
00354                 {
00355                     descriptor[j] = descriptor[j] * factor;
00356                     if(descriptor[j] > maxBinValue)
00357                     {
00358                         descriptor[j] = maxBinValue;
00359                     }
00360                 }
00361         
00362                 // Normalize length of vec
00363                 sqlen = 0.0;
00364                 for (int j = 0; j < VecLength; j++)
00365                     sqlen += pow(descriptor[j], mCustomNorm);
00366         
00367                 factor = 1.0 / pow(sqlen, 1.0 / mCustomNorm);
00368                 if(sqlen == 0.0) factor = 1.0;
00369             }
00370     
00371             for (int j = 0; j < VecLength; j++)
00372                 descriptor[j] = descriptor[j] * factor * mOutputMultiplier;
00373         }
00374     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:10:14 2010 for ImpalaSrc by  doxygen 1.5.1