annotate pycaptcha/Captcha/Visual/Pictures.py @ 115:b84a0d009af8

changes on pipeline mecanism: we now sample a different complexity for each transformations, this because when we use the same sampled complexity for all the modules 1/8 of the time we are close to 0 and we obtain an image very close to the source, we now save a complexity for each module in the parameters array
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Wed, 17 Feb 2010 16:20:15 -0500
parents 4775b4195b4b
children
rev   line source
87
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
1 """ Captcha.Visual.Pictures
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
2
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
3 Random collections of images
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
4 """
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
5 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
6 # PyCAPTCHA Package
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
7 # Copyright (C) 2004 Micah Dowty <micah@navi.cx>
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
8 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
9
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
10 from Captcha import File
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
11 import Image
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
12
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
13
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
14 class ImageFactory(File.RandomFileFactory):
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
15 """A factory that generates random images from a list"""
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
16 extensions = [".png", ".jpeg"]
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
17 basePath = "pictures"
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
18
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
19
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
20 abstract = ImageFactory("abstract")
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
21 nature = ImageFactory("nature")
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
22
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
23 ### The End ###