tesserocr
tesserocr copied to clipboard
Setting variable "tessedit_write_images" has no effect
I expected to get the tessinput.tif file from tesseract when I set tessedit_write_images through the tesserocr API, but it's not written.
Sample IPython session that doesn't give me the expected output file:
In [1]: from tesserocr import PyTessBaseAPI
In [2]: import tesserocr; tesserocr.tesseract_version()
Out[2]: u'tesseract 3.05.01\n leptonica-1.75.3\n libjpeg 9c : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.8\n'
In [3]: api = PyTessBaseAPI()
In [4]: api.GetBoolVariable("tessedit_write_images")
Out[4]: False
In [5]: api.SetVariable("tessedit_write_images", "1")
Out[5]: True
In [6]: api.GetBoolVariable("tessedit_write_images")
Out[6]: True
In [7]: api.SetImageFile("test-input.png")
In [8]: print api.GetUTF8Text()
....
Same issue here. Does anyone know how to solve this problem?
This parameter is only effective when using ProcessPage or ProcessPages, as the CLI does.