# Function iacdil

namespace: morph iacdil

# Synopse

Dilate an image conditionally.

• y = iacdil(f, g, b=iasecross(), n=1)
• y: Image
• f: Image
• g: Image Conditioning image.
• b: Structuring Element
• n: Double (number of iterations).
```01. from numpy import *
02. from iasecross import iasecross
03.
04. def iacdil(f, g, b=iasecross(), n=1):
05.     from iaintersec import iaintersec
07.     from iaisequal import iaisequal
08.
09.     y = iaintersec(f,g)
10.     for i in xrange(n):
11.         aux = y
13.         if iaisequal(y,aux): break
14.     return y```

# Description

iacdil creates the image y by dilating the image f by the structuring element b conditionally to the image g. This operator may be applied recursively n times.

# Examples

## Example 1

```01. from ia870 import iacdil, iabshow
02. from ia870 import iasecross
03.
04. f = array([[1, 0, 0, 0, 0, 0, 0],\
05.            [0, 0, 0, 0, 0, 0, 0],\
06.            [0, 0, 0, 0, 1, 0, 0,]],bool)
07. g = array([[1, 1, 1, 0, 0, 1, 1],
08.            [1, 0, 1, 1, 1, 0, 0],
09.            [0, 0, 0, 0, 1, 0, 0]], bool)
10. y1=iacdil(f,g)
11. y2=iacdil(f,g,iasecross(),3)

## Example 2

```01. f = array([\
02.     [   0,    0,   0,   80,   0,   0],\
03.     [   0,    0,   0,    0,   0,   0],\
04.     [  10,   10,   0,  255,   0,   0]],uint8)
05. g = array([\
06.     [   0,    1,   2,   50,   4,   5],\
07.     [   2,    3,   4,    0,   0,   0],\
08.     [  12,  255,  14,   15,  16,  17]],uint8)
09. y1=iacdil(f,g)
10. y2=iacdil(f,g,iasecross(),3)
11. print 'y1=\n',y1
12. print 'y2=\n',y2```
```y1=
[[ 0  0  2 50  4  0]
[ 2  3  0  0  0  0]
[10 10 14 15 15  0]]
y2=
[[ 0  1  2 50  4  4]
[ 2  3  4  0  0  0]
[12 14 14 15 15 15]]
```

## Example 3

```01. from ia870 import iaframe, iagshow
02.
04. f=iaframe(g,5,5)
05. y5=iacdil(f,g,iasecross(),5)
06. y25=iacdil(f,g,iasecross(),25)

## Example 4

```01. from ia870 import ianeg
02. from ia870 import iaintersec
03. from ia870 import iasebox
04.