본문으로 바로가기

Pytesser OCR

category Coding/Python 2016. 1. 27. 22:11
반응형

import PIL

from PIL import Image

from pytesser import *

import urllib


# Download

urllib.urlretrieve(주소, "codedown.png")


# Resizing

basewidth = 300

img = Image.open('codedown.png')

wpercent = (basewidth/float(img.size[0]))

hsize = int((float(img.size[1])*float(wpercent)))

img = img.resize((basewidth,hsize), PIL.Image.ANTIALIAS)

img.save('resize.png')


# Read

im = Image.open ('resize.png')

text = image_to_string (im)

print text

반응형

'Coding > Python' 카테고리의 다른 글

Python Proxy check  (0) 2016.01.30
BeautifulSoup 웹파싱  (0) 2016.01.29
소켓 통신할때 Response 못받아오는 문제  (0) 2016.01.08
Selenium 경로설정  (0) 2016.01.08
DB Parser  (0) 2015.12.25