Пример #1
0
def yDirSliceProjector(y, x, x1, x2, mask):
    a = np.repeat(np.arange(x), y).reshape((x, y))
    maskx = np.ones((x, y), dtype=bool)
    maskx[np.logical_not(mask)] = 0
    maskx[:, :x1] = 0
    maskx[:, x2:] = 0
    return labelstosparse(a, maskx, 1)
Пример #2
0
def yDirSliceProjector(y,x,x1,x2,mask):
    a=np.repeat(np.arange(x),y).reshape((x,y))
    maskx=np.ones((x,y),dtype=bool)
    maskx[np.logical_not(mask)]=0
    maskx[:,:x1]=0
    maskx[:,x2:]=0
    return labelstosparse(a, maskx,1)
Пример #3
0
def xDirSliceProjector(y, x, y1, y2, mask):
    a = np.tile(np.arange(y), x).reshape(x, y)
    masky = np.ones((x, y), dtype=bool)
    masky[np.logical_not(mask)] = 0
    masky[:y1] = 0
    masky[y2:] = 0
    return labelstosparse(a, masky, 1)
Пример #4
0
def xDirSliceProjector(y,x,y1,y2,mask):
    a=np.tile(np.arange(y),x).reshape(x,y)
    masky=np.ones((x,y),dtype=bool)
    masky[np.logical_not(mask)]=0
    masky[:(x-y2)]=0
    masky[(x-y1):]=0
    return labelstosparse(a, masky,1)