comparison transformations/PoivreSel.py @ 101:553acf4beffb

Valeur d'entree des methodes 'determines_by_complexity' harmonisees avec local_elastic_distortion.py
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Fri, 12 Feb 2010 10:13:50 -0500
parents 67e655fc1d0b
children fe6f96951ed1
comparison
equal deleted inserted replaced
100:67e655fc1d0b 101:553acf4beffb
28 self.effectuer=1 #Vaut 1 si on effectue et 0 sinon. 28 self.effectuer=1 #Vaut 1 si on effectue et 0 sinon.
29 29
30 def get_settings_names(self): 30 def get_settings_names(self):
31 return ['effectuer'] 31 return ['effectuer']
32 32
33 def get_settings_name_determined_by_complexity(self): 33 def get_settings_name_determined_by_complexity(self,complexity):
34 return ['proportion_bruit'] 34 return ['proportion_bruit']
35 35
36 def regenerate_parameters(self, complexity): 36 def regenerate_parameters(self, complexity):
37 self.proportion_bruit = float(complexity)/5 37 self.proportion_bruit = float(complexity)/5
38 self.nb_chng=int(1024*self.proportion_bruit) 38 self.nb_chng=int(1024*self.proportion_bruit)
42 42
43 def _get_current_parameters(self): 43 def _get_current_parameters(self):
44 return [self.effectuer] 44 return [self.effectuer]
45 45
46 def get_parameters_determined_by_complexity(self, complexity): 46 def get_parameters_determined_by_complexity(self, complexity):
47 return [self.proportion_bruit] 47 return [float(complexity)/5]
48 48
49 def transform_image(self, image): 49 def transform_image(self, image):
50 if self.effectuer == 0: 50 if self.effectuer == 0:
51 return image 51 return image
52 52