Exemplo n.º 1
0
def supWhiteTopHat(imIn, imOut, n, grid=mamba.DEFAULT_GRID):
    """
    Performs a white Top Hat operation with the supremum of directional openings
    on 'imIn' and puts the result in 'imOut'.
    This operator partly extracts from 'imIn' the bright objects whose extension
    in at least one direction of 'grid' is smaller than 'n'.
    """
    
    imWrk = mamba.imageMb(imIn)
    mamba.supOpen(imIn, imWrk, n, grid=grid)
    mamba.sub(imIn, imWrk, imOut)
Exemplo n.º 2
0
def linearAlternateFilter(imIn, imOut, n, openFirst, grid=mamba.DEFAULT_GRID):
    """
    Performs an alternate filter operation on image 'imIn' with openings and
    closings by segments of size 'n' (supremum of openings and infimum of
    closings) and puts the result in 'imOut'. If 'openFirst' is True, the filter
    begins with an opening, a closing otherwise.
    """
    
    if openFirst:
        mamba.supOpen(imIn, imOut, n, grid=grid)
        mamba.infClose(imOut, imOut, n, grid=grid)
    else:
        mamba.infClose(imIn, imOut, n, grid=grid)
        mamba.supOpen(imOut, imOut, n, grid=grid)