Function iainpos

namespace:morph
page:iainpos

Synopse

Minima imposition.

  • y = iainpos(f, g, bc=ia_secross(NULL))
    • y: Image
    • f: Image Marker image.
    • g: Image input image.
    • bc: Structuring Element (connectivity).
01. from numpy import *
02. 
03. from iasecross import iasecross
04. def iainpos(f, g, bc=iasecross()):
05.     from iaisbinary import iaisbinary
06.     from iagray import iagray
07.     from ianeg import ianeg
08.     from iadatatype import iadatatype
09.     from ialimits import ialimits
10.     from iasuprec import iasuprec
11.     from iaintersec import iaintersec
12.     from iaunion import iaunion
13. 
14.     assert iaisbinary(f),'First parameter must be binary image'
15.     fg = iagray( ianeg(f), iadatatype(g))
16.     k1 = ialimits(g)[1] - 1
17.     y = iasuprec(fg, iaintersec( iaunion(g, 1), k1, fg), bc)
18. 
19.     return y

Description

Minima imposition on g based on the marker f. iainpos creates an image y by filing the valleys of g that does not cover the connect components of f. A remarkable property of y is that its regional minima are exactly the connect components of g.

Equation