Function iathick

namespace:morph
page:iathick

Synopse

Image transformation by thickening.

  • y = iathick(f, Iab=ia_homothick(), n=-1, theta=45, DIRECTION="CLOCKWISE")
    • y: Image
    • f: Image
    • Iab: Interval
    • n: Double Number of iterations.
    • theta: Double Degrees of rotation: 45, 90, or 180.
    • DIRECTION: String Direction of rotation: 'CLOCKWISE' or ' ANTI-CLOCKWISE'
01. from numpy import *
02. from string import upper
03. 
04. def iathick(f, Iab=None, n=-1, theta=45, DIRECTION="CLOCKWISE"):
05.     from iaisbinary import iaisbinary
06.     from iaintersec import iaintersec
07.     from iasupgen import iasupgen
08.     from iainterot import iainterot
09.     from iaunion import iaunion
10.     from iaisequal import iaisequal
11.     from iahomothick import iahomothick
12.     if Iab is None:
13.         Iab = iahomothick()
14. 
15.     DIRECTION = upper(DIRECTION)
16.     assert iaisbinary(f),'f must be binary image'
17.     if n == -1: n = product(f.shape)
18.     y = f
19.     zero = iaintersec(f,0)
20.     for i in range(n):
21.         aux = zero
22.         for t in range(0,360,theta):
23.             sup = iasupgen( y, iainterot(Iab, t, DIRECTION))
24.             aux = iaunion( aux, sup)
25.             y = iaunion( y, sup)
26.         if iaisequal(aux,zero): break
27. 
28.     return y

Description

iathick creates the binary image y by performing a thickening of the binary image f. The number of iterations of the thickening is n and each iteration is performed by union of f with the points that are detected in f by the hit-miss operators characterized by rotations of theta degrees of the interval Iab.

Equation

Algorithm

function y = iathick_equ( f, Iab, n, theta, DIRECTION )
  y = f;
  for i=1:n
    for alpha=0:theta:360-theta
      Iab = iainterot(Iab, alpha, DIRECTION);
      y = iaunion(y,iasupgen(y,Iab));
    end;
  end;