Title: how to remove the lines in captcha
Tags: ocr;captcha
Question: I have a simple captcha,I want to recognize the picture.
the picture is like:


I want to use the tesseract.  http://code.google.com/p/tesseract-ocr/

but the tesseract only can use on the clear picture.

so I should preprocess the pic.

the preprocess code is:

```im = Image.open('test.png')
# text = image_to_string(im)
enhancer = ImageEnhance.Contrast(im)
im = enhancer.enhance(4)
img = img.convert("RGBA")
width,height = im.size
# pixdata = img.load()
for y in xrange(img.size[1]):
    for x in xrange(img.size[0]):
        if im.getpixel((x,y)) != (0,0,0):
            im.putpixel((x,y),(255,255,255) )

for y in xrange(img.size[1]):
    for x in xrange(img.size[0]):
        if y<2 or y&gt;(img.size[1]-3):
            continue
        if im.getpixel((x, y))[0]==255 and im.getpixel((x, y+2))[0]==0 and im.getpixel((x, y-1))[0]==0:
            im.putpixel((x, y),(0,0,0))
     #    else:
     #      continue
list(im.getdata())
im.show()
```

after the process,the pic is like:


so I failed. can anyone give me some tips?
I know how to remove the line if the line is a pixel width,but the line here is not consistent.




{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:07/17/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ocr><captcha>', 'Title': 'how to remove the lines in captcha', 'ViewCount': 1061, 'id': 17690697, 'user_AboutMe': '', 'user_AccountId': 1558084.0, 'user_DisplayName': 'kuafu', 'user_Reputation': 1436.0, 'user_Views': 91.0, 'user_id': 1448607.0}}