tesseract
3.03
|
#include <stdio.h>
#include "base/commandlineflags.h"
#include "baseapi.h"
#include "commontraining.h"
#include "cubeclassifier.h"
#include "mastertrainer.h"
#include "params.h"
#include "strngs.h"
#include "tessclassifier.h"
Go to the source code of this file.
Enumerations | |
enum | ClassifierName { CN_PRUNER, CN_FULL, CN_CUBE, CN_CUBETESS, CN_COUNT } |
Functions | |
STRING_PARAM_FLAG (classifier,"","Classifier to test") | |
STRING_PARAM_FLAG (lang,"eng","Language to test") | |
STRING_PARAM_FLAG (tessdata_dir,"","Directory of traineddata files") | |
DECLARE_INT_PARAM_FLAG (debug_level) | |
DECLARE_STRING_PARAM_FLAG (T) | |
int | main (int argc, char **argv) |
Variables | |
const char * | names [] = {"pruner", "full", "cube", "cubetess", NULL } |
enum ClassifierName |
Definition at line 37 of file classifier_tester.cpp.
{ CN_PRUNER, CN_FULL, CN_CUBE, CN_CUBETESS, CN_COUNT };
DECLARE_INT_PARAM_FLAG | ( | debug_level | ) |
int main | ( | int | argc, |
char ** | argv | ||
) |
---------------------------------------------------------------------------- Public Function Prototypes ----------------------------------------------------------------------------
Definition at line 132 of file classifier_tester.cpp.
{ ParseArguments(&argc, &argv); STRING file_prefix; tesseract::MasterTrainer* trainer = tesseract::LoadTrainingData( argc, argv, false, NULL, &file_prefix); tesseract::TessBaseAPI* api; // Decode the classifier string. tesseract::ShapeClassifier* shape_classifier = InitializeClassifier( FLAGS_classifier.c_str(), trainer->unicharset(), argc, argv, &api); if (shape_classifier == NULL) { fprintf(stderr, "Classifier init failed!:%s\n", FLAGS_classifier.c_str()); return 1; } // We want to test junk as well if it is available. // trainer->IncludeJunk(); // We want to test with replicated samples too. trainer->ReplicateAndRandomizeSamplesIfRequired(); trainer->TestClassifierOnSamples(tesseract:: CT_UNICHAR_TOP1_ERR, MAX(3, FLAGS_debug_level), false, shape_classifier, NULL); delete shape_classifier; delete api; delete trainer; return 0; } /* main */
STRING_PARAM_FLAG | ( | classifier | , |
"" | , | ||
"Classifier to test" | |||
) |
STRING_PARAM_FLAG | ( | lang | , |
"eng" | , | ||
"Language to test" | |||
) |
STRING_PARAM_FLAG | ( | tessdata_dir | , |
"" | , | ||
"Directory of traineddata files" | |||
) |
const char* names[] = {"pruner", "full", "cube", "cubetess", NULL } |
Definition at line 45 of file classifier_tester.cpp.