diff transformations/add_background_image.py @ 85:8aadb0f59a64

changed contrast definition for add_background_image
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Wed, 10 Feb 2010 17:47:57 -0500
parents f75f5acad4eb
children
line wrap: on
line diff
--- a/transformations/add_background_image.py	Wed Feb 10 17:38:17 2010 -0500
+++ b/transformations/add_background_image.py	Wed Feb 10 17:47:57 2010 -0500
@@ -66,7 +66,7 @@
         image = self.load_image(self.bg_image_file + self.image_files[i])
         self.bg_image = self.rand_crop(image)
         maxbg = self.bg_image.max()
-        self.bg_image = self.bg_image / maxbg * ( max(maximage - self.contrast/2.0,0.1) ) 
+        self.bg_image = self.bg_image / maxbg * ( max(maximage - self.contrast,0.0) ) 
 
     # set "bg_image" as background to "image", based on a pixels threshold
     def set_bg(self,image):