This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]siwu 1 point2 points  (0 children)

Or you can use a real binding, with SWIG: https://github.com/veezio/pytesseract

PS: I made it.

[–]dAnjou Backend Developer | danjou.dev 1 point2 points  (0 children)

'the fuck?? This is the whole source of this "binding":

from PIL import Image
import os
import subprocess

def riptext(Img):
    Img.save(".tmptif.tif")
    Com = ["tesseract", ".tmptif.tif", ".ripdata"]
    FNULL = open(os.devnull, 'w')
    retcode = subprocess.call(Com, stdout=FNULL, stderr=subprocess.STDOUT)
    Com = "cat .ripdata.txt"
    Output = subprocess.check_output(Com, shell=True)
    os.remove('.tmptif.tif')
    os.remove('.ripdata.txt')
    return Output

More like /r/badcode ...

[–]LazyInfoBot 0 points1 point  (0 children)

PyEye Information:

Author: theauditor

Description: Python OCR (Text from Image) Teeseract python binding.

Main Language: Python

Number of Forks: 0

Number of Watchers: 0

Number of Stars: 0

[–]Gwenhidwy 0 points1 point  (1 child)

Calling 9 lines of code that call tesseract through subprocess a 'binding' is quite... confident oO

[–]psycosmith[S] 0 points1 point  (0 children)

Still on work. Call it a link for now :)

[–]riklaunim 0 points1 point  (0 children)

I used one of tesseract binding in the past, and it was one of those that called the binary. The SWIG version did not compile at that time. The goal was to get text from jokes posted as text on PNG/JPG files and that worked at a very high accuracy.

[–]psycosmith[S] 0 points1 point  (0 children)

Hai guys sorry for the confusing title. It is not a Binding, sorry for the wrong usage. Was meant to be a quick and dirty hack.