Exemplo n.º 1
0
def iasupgen(f, INTER):
    from ia870.iaintersec import iaintersec
    from ia870.iaero import iaero
    from ia870.ianeg import ianeg

    A, Bc = INTER
    y = iaintersec(iaero(f, A), iaero(ianeg(f), Bc))

    return y
Exemplo n.º 2
0
def iaskelm(f, B=iasecross(), option="binary"):
    from ia870.iaisbinary import iaisbinary
    from ia870.ialimits import ialimits
    from ia870.iagray import iagray
    from ia870.iaintersec import iaintersec
    from ia870.iasesum import iasesum
    from ia870.iaero import iaero
    from ia870.iaisequal import iaisequal
    from ia870.iaopenth import iaopenth
    from ia870.iasedil import iasedil
    from ia870.iaunion import iaunion
    from ia870.iabinary import iabinary
    from ia870.iapad import iapad
    from ia870.iaunpad import iaunpad

    assert iaisbinary(f),'Input binary image only'
    option = option.upper()
    f = iapad(f,B)
    print(f)
    k1,k2 = ialimits(f)
    y = iagray( iaintersec(f, k1),'uint16')
    iszero = asarray(y)
    nb = iasesum(B,0)
    for r in range(1,65535):
        ero = iaero( f, nb)
        if iaisequal(ero, iszero): break
        f1 = iaopenth( ero, B)
        nb = iasedil(nb, B)
        y = iaunion(y, iagray(f1,'uint16',r))
    if option == 'BINARY':
        y = iabinary(y)
    y = iaunpad(y,B)
    return y
Exemplo n.º 3
0
def iacbisector(f, B, n):
    from ia870.iaintersec import iaintersec
    from ia870.iasesum import iasesum
    from ia870.iaero import iaero
    from ia870.iacdil import iacdil
    from ia870.iasubm import iasubm
    from ia870.iaunion import iaunion

    y = iaintersec(f, 0)
    for i in range(n):
        nb = iasesum(B, i)
        nbp = iasesum(B, i + 1)
        f1 = iaero(f, nbp)
        f2 = iacdil(f1, f, B, n)
        f3 = iasubm(iaero(f, nb), f2)
        y = iaunion(y, f3)
    return y
Exemplo n.º 4
0
def iacero(f, g, b=iasecross(), n=1):
    from ia870.iaunion import iaunion
    from ia870.iaero import iaero
    from ia870.iaisequal import iaisequal

    y = iaunion(f, g)
    for i in range(n):
        aux = y
        y = iaunion(iaero(y, b), g)
        if iaisequal(y, aux): break
    return y
Exemplo n.º 5
0
def iaopenrec(f, bero=iasecross(), bc=iasecross()):
    from ia870.iainfrec import iainfrec
    from ia870.iaero import iaero

    return iainfrec(iaero(f, bero), f, bc)