问题
I had an image file, which contain some text separated by tabs (2 spaces). But when I extract text out of this image file, I always get a single space between two columns. A sample example:
IMAGE:
col-a col-b col-c
Desired output:
col-a col-b col-c
But I am getting the following:
col-a col-b col-c
I am using pytesseract.image_to_string (Python module) convert image to text
回答1:
Use it like this:
pytesseract.image_to_string(img, config='-c preserve_interword_spaces=1')
来源:https://stackoverflow.com/questions/51668339/preserving-spaces-in-tesseract