diff data_generation/transformations/gimp_script.py @ 254:dd2df78fcf47

added option to pipeline and gimp_script to produce NIST-friendly data
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Wed, 17 Mar 2010 13:57:15 -0400
parents 39421555993f
children d5b2b6397a5a
line wrap: on
line diff
--- a/data_generation/transformations/gimp_script.py	Tue Mar 16 12:14:10 2010 -0400
+++ b/data_generation/transformations/gimp_script.py	Wed Mar 17 13:57:15 2010 -0400
@@ -38,7 +38,7 @@
         return ['mblur_length', 'mblur_angle', 'pinch']
     
     def regenerate_parameters(self, complexity):
-        if complexity and self.blur_bool:
+        if complexity:
            self.mblur_length = abs(int(round(numpy.random.normal(0, 3*complexity))))
         else:
             self.mblur_length = 0
@@ -50,7 +50,7 @@
     def transform_image(self, image):
         if self.mblur_length or self.pinch:
             setpix(image)
-            if self.mblur_length:
+            if self.mblur_length and self.blur_bool:
                 pdb.plug_in_mblur(img, layer1, 0, self.mblur_length, self.mblur_angle, 0, 0)
             if self.pinch:        
                 pdb.plug_in_whirl_pinch(img, layer1, 0.0, self.pinch, 1.0)