Example #1
0
def test_opentransf():
    f = np.array([[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0],
                  [0, 1, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0],
                  [1, 1, 0, 0, 0, 0, 0, 0]], bool)
    ot = pymorph.opentransf(f, 'city-block')
    for y in xrange(ot.shape[0]):
        for x in xrange(ot.shape[1]):
            r = ot[y, x]
            t = f.copy()
            for k in xrange(1, r + 1):
                assert t[y, x]
                t = pymorph.open(f, pymorph.sedisk(k, 2, 'city-block'))
            assert not t[y, x]
Example #2
0
def test_opentransf():
    f = np.array([
            [0,0,0,0,0,0,0,0],
            [0,0,1,1,1,1,0,0],
            [0,1,0,1,1,1,0,0],
            [0,0,1,1,1,1,0,0],
            [1,1,0,0,0,0,0,0]], bool)
    ot = pymorph.opentransf( f, 'city-block')
    for y in xrange(ot.shape[0]):
        for x in xrange(ot.shape[1]):
            r = ot[y,x]
            t = f.copy()
            for k in xrange(1, r+1):
                assert t[y,x]
                t = pymorph.open(f, pymorph.sedisk(k, 2, 'city-block'))
            assert not t[y,x]
Example #3
0
 def test_type(type, Buser):
     g = pymorph.opentransf(f, type, Buser=Buser)
Example #4
0
 def test_type(type, Buser):
     g = pymorph.opentransf(f, type, Buser=Buser)