GistEstimatorConfigurator.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "Neuro/GistEstimatorConfigurator.H"
00040 #include "Component/OptionManager.H"
00041 #include "Neuro/GistEstimatorStd.H"
00042 #include "Neuro/GistEstimatorGen.H"
00043 #include "Neuro/GistEstimatorFFT.H"
00044 #include "Neuro/GistEstimatorTexton.H"
00045 #include "Neuro/GistEstimatorBeyondBoF.H"
00046 #include "Neuro/GistEstimatorContextBased.H"
00047 #include "Neuro/GistEstimatorSurfPMK.H"
00048 #include "Neuro/GistEstimatorStub.H"
00049 #include "Neuro/NeuroOpts.H"
00050
00051
00052 GistEstimatorConfigurator::
00053 GistEstimatorConfigurator(OptionManager& mgr,
00054 const std::string& descrName,
00055 const std::string& tagName) :
00056 ModelComponent(mgr, descrName, tagName),
00057 itsGEtype(&OPT_GistEstimatorType, this),
00058 itsGE(new GistEstimatorStub(mgr))
00059 {
00060 addSubComponent(itsGE);
00061 }
00062
00063
00064 GistEstimatorConfigurator::~GistEstimatorConfigurator()
00065 { }
00066
00067
00068 nub::ref<GistEstimator> GistEstimatorConfigurator::getGE() const
00069 { return itsGE; }
00070
00071
00072 void GistEstimatorConfigurator::paramChanged(ModelParamBase* const param,
00073 const bool valueChanged,
00074 ParamClient::ChangeStatus* status)
00075 {
00076 ModelComponent::paramChanged(param, valueChanged, status);
00077
00078
00079 if (param == &itsGEtype) {
00080
00081
00082
00083 removeSubComponent(*itsGE);
00084
00085
00086 if (itsGEtype.getVal().compare("None") == 0 ||
00087 itsGEtype.getVal().compare("Stub") == 0)
00088 itsGE.reset(new GistEstimatorStub(getManager()));
00089 else if (itsGEtype.getVal().compare("Std") == 0)
00090 itsGE.reset(new GistEstimatorStd(getManager()));
00091 #ifdef HAVE_FFTW3_H
00092 else if (itsGEtype.getVal().compare("FFT") == 0)
00093 itsGE.reset(new GistEstimatorFFT(getManager()));
00094 #endif
00095 else if (itsGEtype.getVal().compare("Texton") == 0)
00096 itsGE.reset(new GistEstimatorTexton(getManager()));
00097 else if (itsGEtype.getVal().compare("BeyondBoF") == 0 ||
00098 itsGEtype.getVal().compare("BBoF") == 0 ||
00099 itsGEtype.getVal().compare("bbof") == 0)
00100 itsGE.reset(new GistEstimatorBeyondBoF(getManager()));
00101 else if (itsGEtype.getVal().compare("SurfPMK") == 0 ||
00102 itsGEtype.getVal().compare("Surf") == 0 ||
00103 itsGEtype.getVal().compare("surf") == 0)
00104 itsGE.reset(new GistEstimatorSurfPMK(getManager()));
00105 else if (itsGEtype.getVal().compare("ContextBased") == 0 ||
00106 itsGEtype.getVal().compare("CB") == 0)
00107 itsGE.reset(new GistEstimatorContextBased(getManager()));
00108 else if (itsGEtype.getVal().compare("Gen") == 0)
00109 itsGE.reset(new GistEstimatorGen(getManager()));
00110 else
00111 LFATAL("Unknown GistEstimator type %s", itsGEtype.getVal().c_str());
00112
00113
00114
00115
00116
00117
00118 addSubComponent(itsGE);
00119
00120
00121 itsGE->exportOptions(MC_RECURSE);
00122
00123
00124 LINFO("Selected GE of type %s", itsGEtype.getVal().c_str());
00125 }
00126 }
00127
00128
00129
00130
00131
00132
00133