tesserocr icon indicating copy to clipboard operation
tesserocr copied to clipboard

Setting variable "tessedit_write_images" has no effect

Open johlo opened this issue 7 years ago • 2 comments

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()
....

johlo avatar Feb 27 '18 10:02 johlo

Same issue here. Does anyone know how to solve this problem?

aspenlin avatar Jun 28 '19 16:06 aspenlin

This parameter is only effective when using ProcessPage or ProcessPages, as the CLI does.

bertsky avatar Dec 18 '19 02:12 bertsky