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

void Impala::Core::Feature::InterestPointFeature::ProjectHardIndex ( Mat matrixDescriptors,
PointDescriptorTable pointData 
) [inline, private]

Definition at line 950 of file InterestPointFeature.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::GetColumn2(), ILOG_DEBUG, ILOG_INFO, Impala::Core::Matrix::MatE(), Impala::Core::Matrix::MatMul(), Impala::Core::Matrix::MatNrRow(), mCodebook, mDescriptorReduce, Impala::Core::Feature::PointDescriptorTable::ReplaceAllDescriptors(), Impala::Core::Table::Table::Size(), Impala::Timer::SplitTimeStr(), and Impala::Core::Matrix::VectorQuantize().

Referenced by ProjectOntoCodebook().

00951     {
00952         using namespace Matrix;
00953         Timer timerProjection;
00954         if(mDescriptorReduce)
00955         {
00956             matrixDescriptors = MatMul(matrixDescriptors, mDescriptorReduce);
00957         }
00958         Mat* matrixCodebook = mCodebook->GetColumn2()->GetStorage();
00959         ILOG_DEBUG("Codebook projection (init) took: " <<
00960                    timerProjection.SplitTimeStr());
00961         // result will be a (#descriptors, 2) matrix
00962         Mat* assignment =
00963             Core::Matrix::VectorQuantize(matrixDescriptors, matrixCodebook);
00964         ILOG_INFO("Codebook projection (matrix) took: " <<
00965                   timerProjection.SplitTimeStr());
00966 
00967         Array::Array2dScalarReal64* newDesc = new Array::Array2dScalarReal64(1, 
00968                                                    pointData->Size(), 0, 0);
00969         for(int vj = 0; vj < MatNrRow(matrixDescriptors); vj++)
00970         {
00971             Real64 bestDistance = *MatE(assignment, vj, 1);
00972             int    bestIndex = static_cast<int>(*MatE(assignment, vj, 0));
00973             *MatE(newDesc, vj, 0) = bestIndex;
00974         }
00975         // this call also takes ownership
00976         pointData->ReplaceAllDescriptors(newDesc);
00977         delete assignment;
00978         if(mDescriptorReduce)
00979         {
00980             delete matrixDescriptors;
00981         }
00982     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:19:21 2011 for ImpalaSrc by  doxygen 1.5.1