Definition at line 678 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, mLastCodebookVectors, Impala::Core::Feature::PointDescriptorTable::ReplaceAllDescriptors(), Impala::Core::Table::Table::Size(), Impala::Timer::SplitTimeStr(), and Impala::Core::Matrix::VectorQuantize(). Referenced by ProjectOntoCodebook(). 00680 { 00681 using namespace Matrix; 00682 Timer timerProjection; 00683 if(mDescriptorReduce) 00684 { 00685 matrixDescriptors = MatMul(matrixDescriptors, mDescriptorReduce); 00686 } 00687 Mat* matrixCodebook = mCodebook->GetColumn2()->GetStorage(); 00688 ILOG_DEBUG("Codebook projection (init) took: " << 00689 timerProjection.SplitTimeStr()); 00690 // result will be a (#descriptors, 2) matrix 00691 Mat* assignment = 00692 Core::Matrix::VectorQuantize(matrixDescriptors, matrixCodebook); 00693 ILOG_INFO("Codebook projection (matrix) took: " << 00694 timerProjection.SplitTimeStr()); 00695 00696 Array::Array2dScalarReal64* newDesc = new Array::Array2dScalarReal64(1, 00697 pointData->Size(), 0, 0); 00698 for(int vj = 0; vj < MatNrRow(matrixDescriptors); vj++) 00699 { 00700 Real64 bestDistance = *MatE(assignment, vj, 1); 00701 int bestIndex = static_cast<int>(*MatE(assignment, vj, 0)); 00702 *MatE(newDesc, vj, 0) = bestIndex; 00703 } 00704 // this call also takes ownership 00705 pointData->ReplaceAllDescriptors(newDesc); 00706 delete assignment; 00707 for(int i = 0; i < mLastCodebookVectors.size(); i++) 00708 delete mLastCodebookVectors[i]; 00709 mLastCodebookVectors.clear(); 00710 if(mDescriptorReduce) 00711 { 00712 delete matrixDescriptors; 00713 } 00714 }
Here is the call graph for this function:
|