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

void Impala::Core::Feature::CalculateFISTDescriptors ( Array::Array2dVec3UInt8 *  inputNoBorder,
PointDescriptorTable *  pointData,
String  descriptor 
)

Definition at line 486 of file KoenFIST2.h.

References Impala::atoi(), Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::DoCalculateFISTDescriptorsAndEat(), GetColorChannels(), ILOG_DEBUG, ILOG_INFO, ILOG_VAR, Impala::Core::Matrix::MatConcatenateHorizontal(), Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::mCustomNorm, Impala::Core::Feature::FISTDescriptor< INDEX_SIZE, ORI_SIZE >::mNoMaxBins, Impala::Core::Array::MulVal(), Impala::Core::Array::Pow(), Impala::Core::Feature::PointDescriptorTable::ReplaceAllDescriptors(), Impala::Core::Array::sRGB2RGB(), StringIsFullyNumeric(), and Impala::StringReplace().

Referenced by Impala::Core::Feature::InterestPointFeature::ComputeDescriptors().

00489 {
00490     using namespace Impala::Core::Array;
00491 
00492     ILOG_VAR(Core.Feature.CalculateFISTDescriptors);
00493     FISTDescriptor<4, 8> defaultFIST(false);
00494     Array2dVec3Real64* input2 = 0;
00495     if (descriptor.find("fist") != String::npos)
00496     {
00497         ILOG_INFO("No max bins in norm");
00498         defaultFIST.mNoMaxBins = true;
00499         defaultFIST.mCustomNorm = 2;
00500     }
00501     if (descriptor.find("g0sift") != String::npos)
00502     {
00503         sRGB2RGB(input2, inputNoBorder);
00504     }
00505     else if (descriptor.find("g1sift") != String::npos)
00506     {
00507         sRGB2RGB(input2, inputNoBorder);
00508         Pow(input2, input2, 1.0 / 1.8);
00509     }
00510     else if (descriptor.find("g2sift") != String::npos)
00511     {
00512         sRGB2RGB(input2, inputNoBorder);
00513         Pow(input2, input2, 1.0 / 2.0);
00514     }
00515     else if (descriptor.find("g3sift") != String::npos)
00516     {
00517         sRGB2RGB(input2, inputNoBorder);
00518         MulVal(input2, input2, 1.0 / 255.0);
00519         Pow(input2, input2, 1.0 / 1.8);
00520         MulVal(input2, input2, 255.0);
00521     }
00522     else if (descriptor.find("g4sift") != String::npos)
00523     {
00524         sRGB2RGB(input2, inputNoBorder);
00525         MulVal(input2, input2, 1.0 / 255.0);
00526         Pow(input2, input2, 1.0 / 2.0);
00527         MulVal(input2, input2, 255.0);
00528     }
00529     else
00530     {
00531         MulVal(input2, inputNoBorder, 1.0);
00532     }
00533     descriptor = StringReplace(descriptor, "g0sift", "");
00534     descriptor = StringReplace(descriptor, "g1sift", "");
00535     descriptor = StringReplace(descriptor, "g2sift", "");
00536     descriptor = StringReplace(descriptor, "g3sift", "");
00537     descriptor = StringReplace(descriptor, "g4sift", "");
00538     descriptor = StringReplace(descriptor, "sift", "");
00539     descriptor = StringReplace(descriptor, "fist", "");
00540     if(descriptor.size() >= 2)
00541     {
00542         if((descriptor[descriptor.size() - 2] == 'n') && (StringIsFullyNumeric(descriptor.substr(descriptor.size() - 1, 1))))
00543         {
00544             defaultFIST.mCustomNorm = atoi(descriptor.substr(descriptor.size() - 1, 1));
00545             descriptor = descriptor.substr(0, descriptor.size() - 2);
00546         }
00547         if(descriptor.size() >= 3)
00548         {
00549             if((descriptor[descriptor.size() - 3] == 'n') && (StringIsFullyNumeric(descriptor.substr(descriptor.size() - 2, 2))))
00550             {
00551                 defaultFIST.mCustomNorm = atoi(descriptor.substr(descriptor.size() - 2, 2));
00552                 descriptor = descriptor.substr(0, descriptor.size() - 3);
00553             }
00554         }
00555         ILOG_DEBUG("Set custom norm: " << defaultFIST.mCustomNorm);
00556     }
00557 
00558     /* assumption: inputNoBorder has RGB input image */
00559     std::vector<Array2dScalarReal64*> channels =
00560         Core::Feature::GetColorChannels(input2, descriptor);
00561     delete input2;
00562     std::vector<Matrix::Mat*> channelDescriptors;
00563     for(int i=0 ; i<channels.size() ; i++)
00564     {
00565         channelDescriptors.push_back(defaultFIST.DoCalculateFISTDescriptorsAndEat(channels[i], pointData));
00566     }
00567     
00568     if(channelDescriptors.size() == 1)
00569     {
00570         // takes ownership of memory
00571         pointData->ReplaceAllDescriptors(channelDescriptors[0]);
00572     }
00573     else
00574     {
00575         // now turn them all into a big descriptor
00576         Matrix::Mat* descriptors =
00577             Matrix::MatConcatenateHorizontal(channelDescriptors);
00578         
00579         // takes ownership of memory
00580         pointData->ReplaceAllDescriptors(descriptors);
00581 
00582         for(int i=0 ; i<channelDescriptors.size() ; i++)
00583             delete channelDescriptors[i];
00584     }
00585 
00586 }

Here is the call graph for this function:


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