"Fossies" - the Fresh Open Source Software Archive

Member "tesseract-ocr/doc/html/classtesseract_1_1_char_classifier_factory.html" (26 Oct 2012, 16548 Bytes) of package /linux/misc/old/tesseract-ocr-3.02.02-doc-html.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the tesseract-ocr-3.02.02-doc-html.tar.gz project site itself.

Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tesseract::CharClassifierFactory Class Reference

#include <classifier_factory.h>

List of all members.

Static Public Member Functions

static CharClassifierCreate (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()) {
feat_extract = new FeatureBmp(params);
break;
feat_extract = new FeatureChebyshev(params);
break;
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()) {
classifier_obj = new ConvNetCharClassifier(char_set, params,
feat_extract);
break;
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: