comparison data_generation/transformations/BruitGauss.py @ 442:d5b2b6397a5a

added permut pixel
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Mon, 03 May 2010 18:38:27 -0400
parents 1f5937e9e530
children
comparison
equal deleted inserted replaced
431:bfa349f567e8 442:d5b2b6397a5a
49 49
50 if self.effectuer and complexity > 0: 50 if self.effectuer and complexity > 0:
51 self.nb_chng=3+int(numpy.random.rand()*self.nb_chngmax*complexity) 51 self.nb_chng=3+int(numpy.random.rand()*self.nb_chngmax*complexity)
52 self.sigma_gauss=2.0 + numpy.random.rand()*self.sigmamax*complexity 52 self.sigma_gauss=2.0 + numpy.random.rand()*self.sigmamax*complexity
53 self.grandeur=12+int(numpy.random.rand()*self.grandeurmax*complexity) 53 self.grandeur=12+int(numpy.random.rand()*self.grandeurmax*complexity)
54 #creation du noyau gaussien 54 #creation du noyau gaussien
55 self.gauss=numpy.zeros((self.grandeur,self.grandeur)) 55 self.gauss=numpy.zeros((self.grandeur,self.grandeur))
56 x0 = y0 = self.grandeur/2.0 56 x0 = y0 = self.grandeur/2.0
57 for i in xrange(self.grandeur): 57 for i in xrange(self.grandeur):
58 for j in xrange(self.grandeur): 58 for j in xrange(self.grandeur):
59 self.gauss[i,j]=numpy.exp(-((i-x0)**2 + (j-y0)**2) / self.sigma_gauss**2) 59 self.gauss[i,j]=numpy.exp(-((i-x0)**2 + (j-y0)**2) / self.sigma_gauss**2)