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

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

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

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

    edge = iaframe(f)
    return iasubm( f, iainfrec(edge, f, Bc))
예제 #4
0
def iaregmax(f, Bc=iasecross()):
    from ia870.iasubm import iasubm
    from ia870.iahmax import iahmax
    from ia870.iabinary import iabinary
    from ia870.iaregmin import iaregmin
    from ia870.ianeg import ianeg

    y = iasubm(f, iahmax(f, 1, Bc))
    return iabinary(y)
예제 #5
0
def iacloseth(f, b=None):
    from ia870.iasubm import iasubm
    from ia870.iaclose import iaclose
    from ia870.iasecross import iasecross
    if b is None:
        b = iasecross()

    y = iasubm(iaclose(f, b), f)
    return y
예제 #6
0
def iaopenrecth(f, bero=None, bc=None):
    from ia870.iasubm import iasubm
    from ia870.iaopenrec import iaopenrec
    from ia870.iasecross import iasecross
    if bero is None:
        bero = iasecross()
    if bc is None:
        bc = iasecross()

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

    return y
예제 #7
0
def iaregmin(f, Bc=iasecross(), option="binary"):
    from ia870.iahmin import iahmin
    from ia870.iaaddm import iaaddm
    from ia870.iasubm import iasubm
    from ia870.iabinary import iabinary
    from ia870.iasuprec import iasuprec
    from ia870.iaunion import iaunion
    from ia870.iathreshad import iathreshad

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

    return iabinary(iasubm(iahmin(f,1,Bc), f))
예제 #8
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
예제 #9
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
예제 #10
0
def iacloserecth(f, bdil=iasecross(), bc=iasecross()):
    from ia870.iasubm import iasubm
    from ia870.iacloserec import iacloserec

    y = iasubm( iacloserec(f,bdil,bc), f)
    return y
예제 #11
0
def iasymdif(f1, f2):
    from ia870.iaunion import iaunion
    from ia870.iasubm import iasubm
    y = iaunion(iasubm(f1, f2), iasubm(f2, f1))
    return y