Skip to content

Commit

Permalink
introduce set_debug_file() in the raw Tesseract API
Browse files Browse the repository at this point in the history
Tesseract produces a lot of debug messages which can be redirected
to a debug file using this (corresponds to debug_file command-line
parameter)
  • Loading branch information
Ashish Kulkarni committed May 31, 2017
1 parent 85a011c commit bba15f7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/pyocr/libtesseract/tesseract_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,20 @@ def set_is_numeric(handle, mode):
)


def set_debug_file(handle, filename):
global g_libtesseract
assert(g_libtesseract)

if not isinstance(filename, bytes):
filename = filename.encode('utf-8')

g_libtesseract.TessBaseAPISetVariable(
ctypes.c_void_p(handle),
b"debug_file",
filename
)


def set_page_seg_mode(handle, mode):
global g_libtesseract
assert(g_libtesseract)
Expand Down

0 comments on commit bba15f7

Please sign in to comment.