26 UINT FeatureExtraction::numFeatureExtractionInstances = 0;
28 FeatureExtraction* FeatureExtraction::createInstanceFromString(
const std::string &featureExtractionType){
30 StringFeatureExtractionMap::iterator iter = getMap()->find( featureExtractionType );
31 if( iter == getMap()->end() ){
34 return iter->second();
38 return createInstanceFromString(featureExtractionType);
42 featureExtractionType =
"NOT_SET";
44 featureDataReady =
false;
45 numInputDimensions = 0;
46 numOutputDimensions = 0;
47 inputType = DATA_TYPE_VECTOR;
48 outputType = DATA_TYPE_VECTOR;
49 numFeatureExtractionInstances++;
50 infoLog.setProceedingText(
"[FeatureExtraction]");
51 warningLog.setProceedingText(
"[WARNING FeatureExtraction]");
52 errorLog.setProceedingText(
"[ERROR FeatureExtraction]");
56 if( --numFeatureExtractionInstances == 0 ){
57 delete stringFeatureExtractionMap;
58 stringFeatureExtractionMap = NULL;
64 if( featureExtractionModule == NULL ){
65 errorLog <<
"copyBaseVariables(const FeatureExtraction *featureExtractionModule) - featureExtractionModule pointer is NULL!" << std::endl;
73 this->featureExtractionType = featureExtractionModule->featureExtractionType;
74 this->initialized = featureExtractionModule->initialized;
75 this->featureDataReady = featureExtractionModule->featureDataReady;
76 this->numInputDimensions = featureExtractionModule->numInputDimensions;
77 this->numOutputDimensions = featureExtractionModule->numOutputDimensions;
78 this->featureVector = featureExtractionModule->featureVector;
79 this->featureMatrix = featureExtractionModule->featureMatrix;
80 this->debugLog = featureExtractionModule->debugLog;
81 this->errorLog = featureExtractionModule->errorLog;
82 this->warningLog = featureExtractionModule->warningLog;
89 if( numOutputDimensions == 0 ){
90 errorLog <<
"init() - Failed to init module, the number of output dimensions is zero!" << std::endl;
96 featureDataReady =
false;
99 featureVector.
resize(numOutputDimensions,0);
113 featureDataReady =
false;
114 featureVector.clear();
121 if( !file.is_open() ){
122 errorLog <<
"saveFeatureExtractionSettingsToFile(fstream &file) - The file is not open!" << std::endl;
128 file <<
"Initialized: " << initialized << std::endl;
135 if( !file.is_open() ){
136 errorLog <<
"loadFeatureExtractionSettingsFromFile(fstream &file) - The file is not open!" << std::endl;
149 if( word !=
"Initialized:" ){
150 errorLog <<
"loadPreProcessingSettingsFromFile(fstream &file) - Failed to read Initialized header!" << std::endl;
165 return featureExtractionType;
169 return numInputDimensions;
173 return numOutputDimensions;
181 return featureDataReady;
185 return featureVector;
189 return featureMatrix;
bool saveBaseSettingsToFile(std::fstream &file) const
virtual bool resize(const unsigned int size)
bool copyMLBaseVariables(const MLBase *mlBase)
bool loadBaseSettingsFromFile(std::fstream &file)