Documentation ¶
Index ¶
- func Version() string
- type BoxCharacter
- type BoxText
- type PageSegMode
- type Tess
- func (t *Tess) AvailableLanguages() []string
- func (tess *Tess) BoxText(pagenumber int) (*BoxText, error)
- func (t *Tess) BoxTextRaw(pagenumber int) string
- func (t *Tess) Clear()
- func (t *Tess) Close()
- func (t *Tess) DumpVariables()
- func (t *Tess) HOCRText(pagenumber int) string
- func (t *Tess) InitializedLanguages() string
- func (t *Tess) LoadedLanguages() []string
- func (t *Tess) SetImagePix(pix *leptonica.Pix)
- func (t *Tess) SetInputName(filename string)
- func (tess *Tess) SetPageSegMode(psm PageSegMode)
- func (t *Tess) SetRectangle(left, top, width, height int)
- func (t *Tess) SetVariable(name, value string) error
- func (t *Tess) Text() string
- func (t *Tess) UNLVText() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoxCharacter ¶
type BoxText ¶
type BoxText struct {
Characters []BoxCharacter
}
TODO: make this: `type BoxText []BoxCharacter` ?
type PageSegMode ¶
type PageSegMode int
typedef enum TessPageSegMode { PSM_OSD_ONLY, PSM_AUTO_OSD, PSM_AUTO_ONLY, PSM_AUTO, PSM_SINGLE_COLUMN, PSM_SINGLE_BLOCK_VERT_TEXT, PSM_SINGLE_BLOCK, PSM_SINGLE_LINE, PSM_SINGLE_WORD, PSM_CIRCLE_WORD, PSM_SINGLE_CHAR, PSM_COUNT } TessPageSegMode;
const ( PSM_OSD_ONLY PageSegMode = iota PSM_AUTO_OSD PSM_AUTO_ONLY PSM_AUTO PSM_SINGLE_COLUMN PSM_SINGLE_BLOCK_VERT_TEXT PSM_SINGLE_BLOCK PSM_SINGLE_LINE PSM_SINGLE_WORD PSM_CIRCLE_WORD PSM_SINGLE_CHAR PSM_COUNT )
type Tess ¶
type Tess struct {
// contains filtered or unexported fields
}
Tess represents a tesseract instance
func (*Tess) AvailableLanguages ¶
AvailableLanguages returns the languages available to the given tesseract instance. To find the languages actually loaded use (*Tess).LoadedLanguages().
func (*Tess) BoxTextRaw ¶
BoxTextRaw returns the raw box text for given pagenumber
func (*Tess) Clear ¶
func (t *Tess) Clear()
Clear frees up recognition results and any stored image data, without actually freeing any recognition data that would be time-consuming to reload. Afterwards, you must call SetImagePix before doing any Recognize or Get* operation.
func (*Tess) DumpVariables ¶
func (t *Tess) DumpVariables()
DumpVariables dumps the variables set on a Tess to stdout
func (*Tess) InitializedLanguages ¶
InitializedLanguages returns the languages string used in the last valid initialization. If the last initialization specified "deu+hin" then that will be returned. If hin loaded eng automatically as well, then that will not be included in this list. To find the languages actually loaded use (*Tess).LoadedLanguages().
func (*Tess) LoadedLanguages ¶
LoadedLanguages returns the loaded languages in the vector of STRINGs. Includes all languages loaded for the given tesseract instance, including those loaded as dependencies of other loaded languages.
func (*Tess) SetImagePix ¶
func (t *Tess) SetImagePix(pix *leptonica.Pix)
SetImagePix sets the input image using a leptonica Pix
func (*Tess) SetInputName ¶
SetInputName sets the name of the input file. Needed only for training and loading a UNLV zone file. ++ TODO: drop this?
func (*Tess) SetPageSegMode ¶
func (tess *Tess) SetPageSegMode(psm PageSegMode)
void TessBaseAPISetPageSegMode(TessBaseAPI* handle, TessPageSegMode mode);
func (*Tess) SetRectangle ¶
void TessBaseAPISetRectangle(TessBaseAPI* handle, int left, int top, int width, int height);
func (*Tess) SetVariable ¶
BOOL TessBaseAPISetVariable(TessBaseAPI* handle, const char* name, const char* value);