Definition at line 58 of file InterestPointFeature.h. References Impala::Util::TimeStats::AddGroup(), Impala::Core::Feature::FeatureDefinition::AddParameter(), Impala::CmdOptions::GetBool(), Impala::Util::StringParser::GetDouble(), Impala::Core::Feature::GetDSurfOptions(), Impala::CmdOptions::GetInt(), Impala::Util::StringParser::GetString(), Impala::CmdOptions::GetString(), Impala::MakeString(), mClusterInput, mDenseSamplingScales, mDescriptorReduceFilename, mDynamicPointSelector, mDynamicPointSelectorConfig, mFeatureDefinition, mKeepLimited, mName, mOutputFormat, mPointSelector, mRNG, mStripBorder, mSurfParams, mTimeStats, mUseRecGauss, mVerbose, Impala::Util::Random::RandomizeSeed(), Impala::StringReplace(), Impala::StringReplaceAll(), Impala::StringStartsWith(), and Impala::Util::StringParser::TheEnd(). 00058 : 00059 mVerbose(0), 00060 mStripBorder(0), 00061 mUseRecGauss(false), 00062 mKeepLimited(0), 00063 mCodebook(0), 00064 mDescriptorReduce(0), 00065 mExtraBoxes(0), 00066 mResultOutput(0), 00067 mClusterInput(false), 00068 mClusterInputData(0), 00069 mDynamicPointSelector(false) 00070 { 00071 mVerbose = options.GetInt("verb"); 00072 mUseRecGauss = options.GetBool("recGauss"); 00073 mStripBorder = options.GetInt("borderWidth"); 00074 mOutputFormat = options.GetString("outputFormat"); 00075 00076 mClusterInput = options.GetBool("clusterInput"); 00077 mKeepLimited = options.GetInt("keepLimited"); 00078 if (!options.GetBool("noRandomizeSeed")) 00079 mRNG.RandomizeSeed(); 00080 mTimeStats.AddGroup("detector"); 00081 mTimeStats.AddGroup("descriptor"); 00082 mTimeStats.AddGroup("projection"); 00083 00084 String detector = options.GetString("detector"); 00085 mName = detector + "-" + options.GetString("descriptor"); 00086 mFeatureDefinition = FeatureDefinition(options.GetString("featurePrefix") + mName); 00087 00088 String descriptor = options.GetString("descriptor"); 00089 if((descriptor.size() >= 4) && 00090 (descriptor.substr(descriptor.size()-4,4) == "surf")) 00091 { 00092 Core::Feature::GetDSurfOptions(options, mSurfParams[0], 00093 mSurfParams[1], mSurfParams[2]); 00094 mFeatureDefinition.AddParameter 00095 ("sc", MakeString(mSurfParams[0]) + "-" + 00096 MakeString(mSurfParams[1]) + "-" + MakeString(mSurfParams[2])); 00097 } 00098 if((detector == "harrislaplace") || (detector == "harrislaplace2")) 00099 { 00100 if(options.GetString("harrisThreshold") != "1e-9") 00101 { 00102 mFeatureDefinition.AddParameter 00103 ("ht", options.GetString("harrisThreshold")); 00104 } 00105 } 00106 if((detector == "densesampling") || (detector == "denseall")) 00107 { 00108 // detector config 00109 int spacing = options.GetInt("ds_spacing"); 00110 String scales = options.GetString("ds_scales"); 00111 00112 Util::StringParser sp(scales); 00113 while(!sp.TheEnd()) 00114 { 00115 Real64 scale = sp.GetDouble('+', false, true); 00116 mDenseSamplingScales.push_back(scale); 00117 } 00118 if(mDenseSamplingScales.size() == 0) 00119 { 00120 // fallback to estimate 00121 Real64 scale = Real64(spacing) / 5; 00122 // Most computation code uses 4*scale for the circular region size. 00123 // Therefore, it makes sense to not provide the 'actual' region of 00124 // interest here, but something smaller. 00125 mDenseSamplingScales.push_back(scale); 00126 } 00127 String name = MakeString(spacing); 00128 for(int i = 0; i < mDenseSamplingScales.size(); i++) 00129 { 00130 name += "-" + MakeString(mDenseSamplingScales[i]); 00131 } 00132 mFeatureDefinition.AddParameter("ds", name); 00133 } 00134 00135 mDescriptorReduceFilename = options.GetString("descriptorReduce"); 00136 if(!mDescriptorReduceFilename.empty()) 00137 mFeatureDefinition.AddParameter("red", "1"); 00138 00139 if(!options.GetString("descriptorOpponentWeight").empty()) 00140 { 00141 mFeatureDefinition.AddParameter 00142 ("ow", options.GetString("descriptorOpponentWeight")); 00143 } 00144 if(StringStartsWith(options.GetString("pointSelector"), "dynamic-")) 00145 { 00146 // keep mPointSelector empty: we load it on-demand 00147 mDynamicPointSelector = true; 00148 String config = options.GetString("pointSelector"); 00149 mFeatureDefinition.AddParameter("ps", config); 00150 config = StringReplace(config, "dynamic-", ""); 00151 mDynamicPointSelectorConfig = config; 00152 } 00153 else if(options.GetString("pointSelector").size() != 0) 00154 { 00155 // filter on location (spatial pyramid) 00156 String config = options.GetString("pointSelector"); 00157 String configName = config; 00158 if(config == "pyramid-1x1-2x2") 00159 { 00160 config = "P1x1#0+P2x2#0+P2x2#1+P2x2#2+P2x2#3"; 00161 } 00162 else if(config == "pyramid-1x1-2x2-3x1") 00163 { // this is vertical (!) 00164 config = "P1x1#0+P2x2#0+P2x2#1+P2x2#2+P2x2#3+P3x1#0+P3x1#1+P3x1#2"; 00165 } 00166 else if(config == "pyramid-1x1-2x2-1x3") 00167 { 00168 // this is division into three horizontal bars 00169 config = "P1x1#0+P2x2#0+P2x2#1+P2x2#2+P2x2#3+P1x3#0+P1x3#1+P1x3#2"; 00170 } 00171 else if(config == "pyramid-1x1-2x2-4x4") 00172 { 00173 // this is three levels classic 00174 config = "P1x1#0+P2x2#0+P2x2#1+P2x2#2+P2x2#3+P4x4#0+P4x4#1+P4x4#2+P4x4#3+P4x4#4+P4x4#5+P4x4#6+P4x4#7+P4x4#8+P4x4#9+P4x4#10+P4x4#11+P4x4#12+P4x4#13+P4x4#14+P4x4#15"; 00175 } 00176 else if(config == "pyramid-1x1-2x2-4x4-1x3") 00177 { 00178 // this is three levels classic plus horizontal bars 00179 config = "P1x1#0+P2x2#0+P2x2#1+P2x2#2+P2x2#3+P4x4#0+P4x4#1+P4x4#2+P4x4#3+P4x4#4+P4x4#5+P4x4#6+P4x4#7+P4x4#8+P4x4#9+P4x4#10+P4x4#11+P4x4#12+P4x4#13+P4x4#14+P4x4#15+P1x3#0+P1x3#1+P1x3#2"; 00180 } 00181 Util::StringParser sp(config); 00182 while(!sp.TheEnd()) 00183 { 00184 String selectorConfig = sp.GetString('+', false); 00185 if(selectorConfig.size() == 0) break; 00186 InterestPointSelector* selector = 00187 new InterestPointSelector(selectorConfig, mStripBorder); 00188 mPointSelector.push_back(selector); 00189 } 00190 configName = StringReplaceAll(configName, "+", ""); 00191 configName = StringReplaceAll(configName, "#", "x"); 00192 mFeatureDefinition.AddParameter("ps", configName); 00193 } 00194 else 00195 { 00196 // default: a filter spanning the complete image 00197 InterestPointSelector* selector = 00198 new InterestPointSelector("P1x1#0", mStripBorder); 00199 mPointSelector.push_back(selector); 00200 } 00201 }
Here is the call graph for this function:
|