Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions
tesseract::CharClassifierFactory Class Reference

`#include <classifier_factory.h>`

List of all members.

## Static Public Member Functions

static CharClassifier * | Create (const string &data_file_path, const string &lang, LangModel *lang_mod, CharSet *char_set, TuningParams *params)

## Detailed Description

Definition at line 31 of file classifier_factory.h.

## Member Function Documentation

CharClassifier * tesseract::CharClassifierFactory::Create | ( | const string & | data_file_path,
|  | const string & | lang,
|  | LangModel * | lang_mod,
|  | CharSet * | char_set,
|  | TuningParams * | params
| ) |  |

static

Definition at line 35 of file classifier_factory.cpp.

{
// create the feature extraction object
FeatureBase *feat_extract;
switch (params->TypeFeature()) {
case TuningParams::BMP:
feat_extract = new FeatureBmp(params);
break;
case TuningParams::CHEBYSHEV:
feat_extract = new FeatureChebyshev(params);
break;
case TuningParams::HYBRID:
feat_extract = new FeatureHybrid(params);
break;
default:
fprintf(stderr, "Cube ERROR (CharClassifierFactory::Create): invalid "
"feature type.\n");
return NULL;
}
if (feat_extract == NULL) {
fprintf(stderr, "Cube ERROR (CharClassifierFactory::Create): unable "
"to instantiate feature extraction object.\n");
return NULL;
}
// create the classifier object
CharClassifier *classifier_obj;
switch (params->TypeClassifier()) {
case TuningParams::NN:
classifier_obj = new ConvNetCharClassifier(char_set, params,
feat_extract);
break;
case TuningParams::HYBRID_NN:
classifier_obj = new HybridNeuralNetCharClassifier(char_set, params,
feat_extract);
break;
default:
fprintf(stderr, "Cube ERROR (CharClassifierFactory::Create): invalid "
"classifier type.\n");
return NULL;
}
if (classifier_obj == NULL) {
fprintf(stderr, "Cube ERROR (CharClassifierFactory::Create): error "
"allocating memory for character classifier object.\n");
return NULL;
}
// Init the classifier
if (!classifier_obj->Init(data_file_path, lang, lang_mod)) {
delete classifier_obj;
fprintf(stderr, "Cube ERROR (CharClassifierFactory::Create): unable "
"to Init() character classifier object.\n");
return NULL;
}
return classifier_obj;
}

The documentation for this class was generated from the following files:

- /mnt/data/src/tesseract-ocr/cube/classifier_factory.h
- /mnt/data/src/tesseract-ocr/cube/classifier_factory.cpp