Ejemplo n.º 1
0
def test_conv2():
    im = np.zeros((128, 128))
    Gx = 4
    Gy = 8
    hs = psf_grid_motion(Gx, Gy, 100)
    out = convolve_spatial2(im, hs)
    return im, out, hs
Ejemplo n.º 2
0
def test_conv2():
    im = np.zeros((128,128))
    Gx = 4
    Gy = 8
    hs = psf_grid_motion(Gx,Gy,100)
    out = convolve_spatial2(im, hs)
    return im, out, hs
Ejemplo n.º 3
0
def test_conv2_psfs():
    im = np.zeros((384, 512))
    im[::32, ::32] = 1.
    Gx = 8
    Gy = 4
    hs = psf_grid_motion(Gx, Gy, 30)
    out = convolve_spatial2(im, hs)
    return im, out, hs
Ejemplo n.º 4
0
def test_identity2():
    from scipy.misc import ascent
    from scipy.ndimage.interpolation import zoom

    im = zoom(ascent().astype(np.float32), (2, 2))

    Ng = 32
    Ny, Nx = im.shape

    h = np.zeros_like(im)
    h[Ny // Ng // 2::Ny // Ng, Nx // Ng // 2::Nx // Ng] = 1.

    out = convolve_spatial2(im, h, grid_dim=(Ng, Ng), pad_factor=3)

    #npt.assert_almost_equal(im, out, decimal = 3)
    return im, out, h
def conv(x, hs, transp = False):
    if transp:
        return convolve_spatial2(x,hs[...,::-1,::-1])
    else:
        return convolve_spatial2(x, hs)
def test_conv2_reflect():
    im = np.zeros((128, 128))
    Gx, Gy = 4, 8
    hs = psf_grid_motion(Gx, Gy, 100)
    out = convolve_spatial2(im, hs, mode='reflect')
    return im, out, hs