Function iacbisector

namespace:morph
page:iacbisector

Synopse

N-Conditional bisector.

  • y = iacbisector(f, B, n)
    • y: Image
    • f: Image
    • B: Structuring Element
    • n: Double positive integer ( filtering rate)
01. from numpy import *
02. 
03. def iacbisector(f, B, n):
04.     from iaintersec import iaintersec
05.     from iasesum import iasesum
06.     from iaero import iaero
07.     from iacdil import iacdil
08.     from iasubm import iasubm
09.     from iaunion import iaunion
10. 
11.     y = iaintersec(f,0)
12.     for i in range(n):
13.         nb = iasesum(B,i)
14.         nbp = iasesum(B,i+1)
15.         f1 = iaero(f,nbp)
16.         f2 = iacdil(f1,f,B,n)
17.         f3 = iasubm( iaero(f,nb),f2)
18.         y  = iaunion(y,f3)
19.     return y

Description

iacbisector creates the binary image y by performing a filtering of the morphological skeleton of the binary image f, relative to the structuring element B. The strength of this filtering is controlled by the parameter n. Particularly, if n=0, y is the morphological skeleton of f itself.

Examples

Example 1

01. from ia870 import iacbisector
02. from ia870 import iasebox
03. 
04. 
05. a=mmreadgray('blob2.tif')
06. b=iacbisector(a,iasebox(),1)
07. c=iacbisector(a,iasebox(),3)
08. d=iacbisector(a,iasebox(),10)
09. mmshow(a,b)
10. mmshow(a,c)
11. mmshow(a,d)

Equation

Algorithm

function y=iacbisector_equ(f, B, n)
  y = iabinary(zeros(size(f)));
  for i=0:length(f)
    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);
  end;