Skip to content

Instantly share code, notes, and snippets.

@mstfldmr
Created May 2, 2017 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstfldmr/3c812f9e0cb110e328ce7c56740a51bc to your computer and use it in GitHub Desktop.
Save mstfldmr/3c812f9e0cb110e328ce7c56740a51bc to your computer and use it in GitHub Desktop.
from captcha.image import ImageCaptcha
from scipy import misc
from matplotlib import pyplot as plt
import numpy as np
capgen = ImageCaptcha()
x = np.random.randint(0,99999)
im_bytes=capgen.generate(str(x))
img = misc.imread(im_bytes)
plt.imshow(np.mean(img,axis=2))
plt.title(str(x))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment