amazon-archives / tesserpy

ARCHIVED: A Python API for Tesseract
https://github.com/rigorgt/tesserpy
GNU Lesser General Public License v2.1
20 stars 10 forks source link

Is it possible to set PSM mode? #3

Closed danvk closed 9 years ago

danvk commented 9 years ago

I noticed that tesserpy exposes PSM-related constants like tess.PSM_SINGLE_CHAR. It's less clear to me how to use this. How do I tell tesseract to recognize only a single character using this constant?

squidpickles commented 9 years ago

You can set that by calling tess.tessedit_pageseg_mode = tesserpy.PSM_SINGLE_CHAR. From the API documentation: "The mode is stored as an IntParam so it can also be modified by ReadConfigFile or SetVariable("tessedit_pageseg_mode", mode as string)."