3 #from Image import ImageStat as imst
4 from numpy import linalg as LA
16 avx[i,j] = np.average([mat[ip,jp]
17 for ip in xrange(max(0,i-L),min(h,i+L))
18 for jp in xrange(max(0,j-L),min(h,j+L))])
23 s2[i,j] = np.average([(mat[ip,jp]- avx[ip,jp])**2
24 for ip in xrange(max(0,i-L),min(h,i+L))
25 for jp in xrange(max(0,j-L),min(h,j+L))])
38 N[i,j] = float(1)/(1+sigmax(i,j)**2)
42 return 10 * log10( (float(np.amax(mati))/(LA.norm(nvf(mato-mati))))**2)