tesseract
4.00.00dev
|
#include <iostream>
#include "allheaders.h"
#include "baseapi.h"
#include "basedir.h"
#include "dict.h"
#include "openclwrapper.h"
#include "osdetect.h"
#include "renderer.h"
#include "simddetect.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 232 of file tesseractmain.cpp.
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 391 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 239 of file tesseractmain.cpp.
void PreloadRenderers | ( | tesseract::TessBaseAPI * | api, |
tesseract::PointerVector< tesseract::TessResultRenderer > * | renderers, | ||
tesseract::PageSegMode | pagesegmode, | ||
const char * | outputbase | ||
) |
Definition at line 328 of file tesseractmain.cpp.
void PrintBanner | ( | ) |
Definition at line 213 of file tesseractmain.cpp.
void PrintHelpForOEM | ( | ) |
Definition at line 136 of file tesseractmain.cpp.
void PrintHelpForPSM | ( | ) |
Definition at line 113 of file tesseractmain.cpp.
void PrintHelpMessage | ( | const char * | program | ) |
Definition at line 147 of file tesseractmain.cpp.
void PrintLangsList | ( | tesseract::TessBaseAPI * | api | ) |
Definition at line 202 of file tesseractmain.cpp.
void PrintUsage | ( | const char * | program | ) |
Definition at line 103 of file tesseractmain.cpp.
void PrintVersionInfo | ( | ) |
Definition at line 54 of file tesseractmain.cpp.
void SetVariablesFromCLArgs | ( | tesseract::TessBaseAPI * | api, |
int | argc, | ||
char ** | argv | ||
) |
Definition at line 178 of file tesseractmain.cpp.