tesseract
3.05.02
|
#include <iostream>
#include "allheaders.h"
#include "baseapi.h"
#include "basedir.h"
#include "dict.h"
#include "openclwrapper.h"
#include "osdetect.h"
#include "renderer.h"
#include "strngs.h"
#include "tprintf.h"
Go to the source code of this file.
Functions | |
void | PrintVersionInfo () |
void | PrintUsage (const char *program) |
void | PrintHelpForPSM () |
void | PrintHelpForOEM () |
void | PrintHelpMessage (const char *program) |
void | SetVariablesFromCLArgs (tesseract::TessBaseAPI *api, int argc, char **argv) |
void | PrintLangsList (tesseract::TessBaseAPI *api) |
void | PrintBanner () |
void | FixPageSegMode (tesseract::TessBaseAPI *api, tesseract::PageSegMode pagesegmode) |
void | ParseArgs (const int argc, char **argv, const char **lang, const char **image, const char **outputbase, const char **datapath, bool *list_langs, bool *print_parameters, GenericVector< STRING > *vars_vec, GenericVector< STRING > *vars_values, int *arg_i, tesseract::PageSegMode *pagesegmode, tesseract::OcrEngineMode *enginemode) |
void | PreloadRenderers (tesseract::TessBaseAPI *api, tesseract::PointerVector< tesseract::TessResultRenderer > *renderers, tesseract::PageSegMode pagesegmode, const char *outputbase) |
int | main (int argc, char **argv) |
void FixPageSegMode | ( | tesseract::TessBaseAPI * | api, |
tesseract::PageSegMode | pagesegmode | ||
) |
We have 2 possible sources of pagesegmode: a config file and the command line. For backwards compatibility reasons, the default in tesseract is tesseract::PSM_SINGLE_BLOCK, but the default for this program is tesseract::PSM_AUTO. We will let the config file take priority, so the command-line default can take priority over the tesseract default, so we use the value from the command line only if the retrieved mode is still tesseract::PSM_SINGLE_BLOCK, indicating no change in any config file. Therefore the only way to force tesseract::PSM_SINGLE_BLOCK is from the command line. It would be simpler if we could set the value before Init, but that doesn't work.
Definition at line 229 of file tesseractmain.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
This program reads in a text file consisting of feature samples from a training page in the following format:
FontName UTF8-char-str xmin ymin xmax ymax page-number NumberOfFeatureTypes(N) FeatureTypeName1 NumberOfFeatures(M) Feature1 ... FeatureM FeatureTypeName2 NumberOfFeatures(M) Feature1 ... FeatureM ... FeatureTypeNameN NumberOfFeatures(M) Feature1 ... FeatureM FontName CharName ...
The result of this program is a binary inttemp file used by the OCR engine.
argc | number of command line arguments |
argv | array of command line arguments |
Definition at line 388 of file tesseractmain.cpp.
void ParseArgs | ( | const int | argc, |
char ** | argv, | ||
const char ** | lang, | ||
const char ** | image, | ||
const char ** | outputbase, | ||
const char ** | datapath, | ||
bool * | list_langs, | ||
bool * | print_parameters, | ||
GenericVector< STRING > * | vars_vec, | ||
GenericVector< STRING > * | vars_values, | ||
int * | arg_i, | ||
tesseract::PageSegMode * | pagesegmode, | ||
tesseract::OcrEngineMode * | enginemode | ||
) |
Definition at line 236 of file tesseractmain.cpp.
void PreloadRenderers | ( | tesseract::TessBaseAPI * | api, |
tesseract::PointerVector< tesseract::TessResultRenderer > * | renderers, | ||
tesseract::PageSegMode | pagesegmode, | ||
const char * | outputbase | ||
) |
Definition at line 325 of file tesseractmain.cpp.
void PrintBanner | ( | ) |
Definition at line 210 of file tesseractmain.cpp.
void PrintHelpForOEM | ( | ) |
Definition at line 133 of file tesseractmain.cpp.
void PrintHelpForPSM | ( | ) |
Definition at line 110 of file tesseractmain.cpp.
void PrintHelpMessage | ( | const char * | program | ) |
Definition at line 144 of file tesseractmain.cpp.
void PrintLangsList | ( | tesseract::TessBaseAPI * | api | ) |
Definition at line 199 of file tesseractmain.cpp.
void PrintUsage | ( | const char * | program | ) |
Definition at line 100 of file tesseractmain.cpp.
void PrintVersionInfo | ( | ) |
Definition at line 53 of file tesseractmain.cpp.
void SetVariablesFromCLArgs | ( | tesseract::TessBaseAPI * | api, |
int | argc, | ||
char ** | argv | ||
) |
Definition at line 175 of file tesseractmain.cpp.