Exemple #1
0
def iatoggle(f, f1, f2, OPTION="GRAY"):
    from iabinary import iabinary
    from iasubm import iasubm
    from iagray import iagray
    from iaunion import iaunion
    from iaintersec import iaintersec
    from ianeg import ianeg

    y = iabinary(iasubm(f, f1), iasubm(f2, f))
    if upper(OPTION) == 'GRAY':
        t = iagray(y)
        y = iaunion(iaintersec(ianeg(t), f1), iaintersec(t, f2))

    return y
Exemple #2
0
def iahmax(f, h=1, Bc=iasecross()):
    from iasubm import iasubm
    from iainfrec import iainfrec

    g = iasubm(f, h)
    y = iainfrec(g, f, Bc)
    return y
Exemple #3
0
def iaedgeoff(f, Bc=iasecross()):
    from iaframe import iaframe
    from iasubm import iasubm
    from iainfrec import iainfrec

    edge = iaframe(f)
    return iasubm( f, iainfrec(edge, f, Bc))
Exemple #4
0
def iahmax(f, h=1, Bc=iasecross()):
    from iasubm import iasubm
    from iainfrec import iainfrec

    g = iasubm(f,h)
    y = iainfrec(g,f,Bc);
    return y
Exemple #5
0
def iaedgeoff(f, Bc=iasecross()):
    from iaframe import iaframe
    from iasubm import iasubm
    from iainfrec import iainfrec

    edge = iaframe(f)
    return iasubm(f, iainfrec(edge, f, Bc))
Exemple #6
0
def iatoggle(f, f1, f2, OPTION="GRAY"):
    from iabinary import iabinary
    from iasubm import iasubm
    from iagray import iagray
    from iaunion import iaunion
    from iaintersec import iaintersec
    from ianeg import ianeg


    y=iabinary( iasubm(f,f1),iasubm(f2,f))
    if upper(OPTION) == 'GRAY':
        t=iagray(y)
        y=iaunion( iaintersec( ianeg(t),f1),iaintersec(t,f2))


    return y
Exemple #7
0
def iaregmax(f, Bc=iasecross()):
    from iasubm import iasubm
    from iahmax import iahmax
    from iabinary import iabinary
    from iaregmin import iaregmin
    from ianeg import ianeg

    y = iasubm(f, iahmax(f,1,Bc))
    return iabinary(y)
Exemple #8
0
def iacloseth(f, b=None):
    from iasubm import iasubm
    from iaclose import iaclose
    from iasecross import iasecross
    if b is None:
        b = iasecross()

    y = iasubm(iaclose(f, b), f)
    return y
Exemple #9
0
def iaregmax(f, Bc=iasecross()):
    from iasubm import iasubm
    from iahmax import iahmax
    from iabinary import iabinary
    from iaregmin import iaregmin
    from ianeg import ianeg

    y = iasubm(f, iahmax(f, 1, Bc))
    return iabinary(y)
Exemple #10
0
def iacloseth(f, b=None):
    from iasubm import iasubm
    from iaclose import iaclose
    from iasecross import iasecross
    if b is None:
        b = iasecross()

    y = iasubm( iaclose(f,b), f)
    return y
Exemple #11
0
def iagradm(f, Bdil=None, Bero=None):
    from iasubm import iasubm
    from iadil import iadil
    from iaero import iaero
    from iasecross import iasecross
    if Bdil is None: Bdil = iasecross()
    if Bero is None: Bero = iasecross()

    y = iasubm( iadil(f,Bdil),iaero(f,Bero))
    return y
Exemple #12
0
def iaopenth(f, b=None):
    from iasubm import iasubm
    from iaopen import iaopen
    from iasecross import iasecross
    if b is None:
        b = iasecross()

    y = iasubm(f, iaopen(f, b))

    return y
Exemple #13
0
def iaopenth(f, b=None):
    from iasubm import iasubm
    from iaopen import iaopen
    from iasecross import iasecross
    if b is None:
        b = iasecross()

    y = iasubm(f, iaopen(f,b))

    return y
Exemple #14
0
def iaopenrecth(f, bero=None, bc=None):
    from iasubm import iasubm
    from iaopenrec import iaopenrec
    from iasecross import iasecross
    if bero is None:
        bero = iasecross()
    if bc is None:
        bc = iasecross()

    y = iasubm(f, iaopenrec( f, bero, bc))

    return y
Exemple #15
0
def iaregmin(f, Bc=iasecross(), option="binary"):
    from iahmin import iahmin
    from iaaddm import iaaddm
    from iasubm import iasubm
    from iabinary import iabinary
    from iasuprec import iasuprec
    from iaunion import iaunion
    from iathreshad import iathreshad

    if option != "binary":
        raise Exception("iaregmin accepts only binary option")

    return iabinary(iasubm(iahmin(f,1,Bc), f))
Exemple #16
0
def iacbisector(f, B, n):
    from iaintersec import iaintersec
    from iasesum import iasesum
    from iaero import iaero
    from iacdil import iacdil
    from iasubm import iasubm
    from 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
Exemple #17
0
def iacbisector(f, B, n):
    from iaintersec import iaintersec
    from iasesum import iasesum
    from iaero import iaero
    from iacdil import iacdil
    from iasubm import iasubm
    from 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
Exemple #18
0
def iacthin(f, g, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
    from iaisbinary import iaisbinary
    from iasupgen import iasupgen
    from iainterot import iainterot
    from iaunion import iaunion
    from iasubm import iasubm
    from iaisequal import iaisequal
    from iahomothin import iahomothin
    if Iab is None:
        Iab = iahomothin()

    DIRECTION = upper(DIRECTION)
    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
Exemple #19
0
def iacloserecth(f, bdil=iasecross(), bc=iasecross()):
    from iasubm import iasubm
    from iacloserec import iacloserec

    y = iasubm(iacloserec(f, bdil, bc), f)
    return y
Exemple #20
0
def iacloserecth(f, bdil=iasecross(), bc=iasecross()):
    from iasubm import iasubm
    from iacloserec import iacloserec

    y = iasubm(iacloserec(f, bdil, bc), f)
    return y
Exemple #21
0
def iasymdif(f1, f2):
    from iaunion import iaunion
    from iasubm import iasubm
    y = iaunion( iasubm(f1,f2),iasubm(f2,f1))
    return y