问题
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