How to set tessedit_write_images in python-tesseract?

徘徊边缘 提交于 2019-12-08 19:28:53

问题


I'm trying to set tessedit_write_images but can't seem to do it, i can't see the tessinput.tif anywhere

i'm doing:

import tesseract

api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_TESSERACT_ONLY)
api.SetPageSegMode(tesseract.PSM_AUTO_OSD)
api.SetVariable("tessedit_write_images", "T")

but i've tried with "True", "1", and some more variations, doesn't seem to work at all.

Any help?


回答1:


tessedit_write_images is checked only once in Tesseract's source code (by TessBaseAPI::ProcessPage(), see here).

So you could call api.GetThresholdedImage() and save the returned image or just call api.ProcessPage().



来源:https://stackoverflow.com/questions/31560883/how-to-set-tessedit-write-images-in-python-tesseract

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!