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
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
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))
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
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))
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
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)
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
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)
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
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
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
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
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
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))
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
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
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
def iacloserecth(f, bdil=iasecross(), bc=iasecross()): from iasubm import iasubm from iacloserec import iacloserec y = iasubm(iacloserec(f, bdil, bc), f) return y
def iasymdif(f1, f2): from iaunion import iaunion from iasubm import iasubm y = iaunion( iasubm(f1,f2),iasubm(f2,f1)) return y