Click here to Skip to main content
15,867,834 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Python
from PIL import Image
from operator import itemgetter
import os, hashlib, time, sys, subprocess, platform

class CIntruderOCR(object):
    """
    Class to apply OCR techniques into captchas
    """
    def __init__(self, captcha):
        # initialize main CIntruder
        try:
            im = Image.open(captcha)
            im2 = Image.new("P", im.size, 255)
            im = im.convert("P")
           
            im.show()
        except:
            print "Error during OCR process!. is that captcha supported?\n"
            return

if __name__ == "__main__":
    if sys.argv[1:]:
        ocr = CIntruderOCR(sys.argv[1:])
        print ("Data correctly extracted!")
    else:
        print ("You must set a captcha to learn. ex: test.gif")
Posted
Comments
Sunasara Imdadhusen 23-May-14 6:09am    
Are you getting any error using this code?
[no name] 23-May-14 10:58am    
when i run in command
python test.py "image.gif"

i get this error:
Error during OCR process! is that captcha supported?

Data correctly extracted!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900