Exemplo n.º 1
0
def iathick(f, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
    from ia870.iaisbinary import iaisbinary
    from ia870.iaintersec import iaintersec
    from ia870.iasupgen import iasupgen
    from ia870.iainterot import iainterot
    from ia870.iaunion import iaunion
    from ia870.iaisequal import iaisequal
    from ia870.iahomothick import iahomothick
    if Iab is None:
        Iab = iahomothick()

    DIRECTION = DIRECTION.upper()
    assert iaisbinary(f), 'f must be binary image'
    if n == -1: n = product(f.shape)
    y = f
    zero = iaintersec(f, 0)
    for i in range(n):
        aux = zero
        for t in range(0, 360, theta):
            sup = iasupgen(y, iainterot(Iab, t, DIRECTION))
            aux = iaunion(aux, sup)
            y = iaunion(y, sup)
        if iaisequal(aux, zero): break

    return y
Exemplo n.º 2
0
def iasupcanon(f, Iab, theta=45, DIRECTION="CLOCKWISE"):
    from ia870.iaintersec import iaintersec
    from ia870.iainterot import iainterot
    from ia870.iaunion import iaunion
    from ia870.iasupgen import iasupgen

    DIRECTION = DIRECTION.upper()
    y = iaintersec(f, 0)
    for t in range(0, 360, theta):
        Irot = iainterot(Iab, t, DIRECTION)
        y = iaunion(y, iasupgen(f, Irot))

    return y
Exemplo n.º 3
0
def iacthin(f, g, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
    from ia870.iaisbinary import iaisbinary
    from ia870.iasupgen import iasupgen
    from ia870.iainterot import iainterot
    from ia870.iaunion import iaunion
    from ia870.iasubm import iasubm
    from ia870.iaisequal import iaisequal
    from ia870.iahomothin import iahomothin
    if Iab is None:
        Iab = iahomothin()

    DIRECTION = DIRECTION.upper()
    assert iaisbinary(f), 'f must be binary image'
    if n == -1: n = product(f.shape)
    y = f
    old = y
    for i in range(n):
        for t in range(0, 360, theta):
            sup = iasupgen(y, iainterot(Iab, t, DIRECTION))
            y = iaunion(iasubm(y, sup), g)
        if iaisequal(old, y): break
        old = y

    return y