Exemple #1
0
def _lapGauss3(y,sigma):
    N = int(4*sigma+1)
    x = N*np.linspace(-1,1.,N)
    h = np.exp(-x**2/2./sigma**2)
    h*= 1./np.sum(h)
    hx = (x**2/sigma**2-1.)/sigma**2*h
    outx = imgtools.convolve_sep3(y,hx,h,h)
    outy = imgtools.convolve_sep3(y,h,hx,h)
    outz = imgtools.convolve_sep3(y,h,h,hx)
    return outx+outy+outz
def _lapGauss3(y, sigma):
    N = int(4 * sigma + 1)
    x = N * np.linspace(-1, 1., N)
    h = np.exp(-x**2 / 2. / sigma**2)
    h *= 1. / np.sum(h)
    hx = (x**2 / sigma**2 - 1.) / sigma**2 * h
    outx = imgtools.convolve_sep3(y, hx, h, h)
    outy = imgtools.convolve_sep3(y, h, hx, h)
    outz = imgtools.convolve_sep3(y, h, h, hx)
    return outx + outy + outz
 def apply(self,data):
     x = np.linspace(-1.,1.,self.size)
     h = np.exp(-4.*x**2)
     h *= 1./sum(h)
     print "datatype: ",data.dtype
     return imgtools.convolve_sep3(data, h, h, h)