hozarares Posted July 24, 2010 Report Posted July 24, 2010 (edited) 01 from PIL import Image 02 03 img = Image.open('input.gif') 04 img = img.convert("RGBA") 05 06 pixdata = img.load() 07 08 # Clean the background noise, if color != black, then set to white. 09 for y in xrange(img.size[1]): 10 for x in xrange(img.size[0]): 11 if pixdata[x, y] != (0, 0, 0, 255): 12 pixdata[x, y] = (255, 255, 255, 255) 13 14 img.save("input-black.gif", "GIF") 15 16 # Make the image bigger (needed for OCR) 17 im_orig = Image.open('input-black.gif') 18 big = im_orig.resize((116, 56), Image.NEAREST) 19 20 ext = ".tif" 21 big.save("input-NEAREST" + ext) 22 23 # Perform OCR using pytesser library 24 from pytesser import * 25 image = Image.open('input-NEAREST.tif') 26 print image_to_string(image) Sursa http://www.bonsai-sec.com Edited July 24, 2010 by hozarares lio Quote
linux_terminal Posted July 24, 2010 Report Posted July 24, 2010 pai si la testat careva sa vada daca merge, ca as avea nevoie de el un pik Quote
hozarares Posted July 24, 2010 Author Report Posted July 24, 2010 Tu ce astepti ? Sa testeze cineva pt tine ? Baga mare ...linuxule.... Quote
linux_terminal Posted July 25, 2010 Report Posted July 25, 2010 (edited) Nu sunt bun in python am incercat cat am putut si mia dat aceasta eroare:root@bt:~# python captha.pyTraceback (most recent call last): File "captha.py", line 25, in <module> from pytesser import *ImportError: No module named pytesserFolosesc BackTrack4. daca aveti vreo solutie postati aici, am incercat sal definesc separat pe pytesser , dar stiam de la inceput ca nu o sa reusesc. Multumesc Edited July 25, 2010 by linux_terminal Quote
Flubber Posted July 25, 2010 Report Posted July 25, 2010 Nu sunt bun in python am incercat cat am putut si mia dat aceasta eroare:root@bt:~# python captha.pyTraceback (most recent call last): File "captha.py", line 25, in <module> from pytesser import *ImportError: No module named pytesserFolosesc BackTrack4. daca aveti vreo solutie postati aici, am incercat sal definesc separat pe pytesser , dar stiam de la inceput ca nu o sa reusesc. Multumescpytesser este un modul care trebuie importat, comanda aceea importa tot din modulul respectiv (pytesser), in ordine sa-ti functioneze, trebuie:1: sa cauti daca exista modulul in folderele respective (extrase din arhiva -- daca asa s-a intamplat), daca nu vezi 2 ->-> 2: o cauti pe net sau dai e-mail celui care a facut proiectul, il poti intreba ce s-a intamplat cu libraria respectiva, daca este privata, iar daca nu si este sub gpl si open source... roaga-l frumos sa o impartaseasca cu tinesau.. 3: o faci tu de la 0// Le: arunca un ochi pe:http://github.com/srobertson/pytesser/blob/144e57a70bc46d4fd08fd067b6fb8d18a78661af/pytesser.pysi pe: http://code.google.com/p/pytesser/downloads/detail?name=pytesser_v0.0.1.zipsper sa te fi ajutat, salut Quote