Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Splitter solution in Clear category for Mono Captcha by nickie
FONT = ("--X--XXX-XXX-X-X-XXX--XX-XXX-XXX--XX-XX--",
"-XX----X---X-X-X-X---X-----X-X-X-X-X-X-X-",
"--X---XX--X--XXX-XX--XXX--X--XXX-XXX-X-X-",
"--X--X-----X---X---X-X-X-X---X-X---X-X-X-",
"--X--XXX-XXX---X-XX---XX-X---XXX-XX---XX-")
def splitter(image):
for i in range(0, len(image[0])-1, 4):
yield [row[i:i+4] for row in image]
def recognize(x, y):
CORRECT = [(0,'-'), (1,'X')]
return sum(1 for p in zip(x, y) for c in zip(*p) if c not in CORRECT) <= 1
def checkio(image):
patterns = [(str((i+1)%10), y) for i, y in enumerate(splitter(FONT))]
return int("".join(next(v for v, y in patterns if recognize(x, y))
for x in splitter(image)))
Feb. 15, 2014