# Synopse

Morphological skeleton (Medial Axis Transform).

• y = iaskelm(f, B=iasecross(), option="binary")
• y: Image
• f: Image
• B: Structuring Element
• option: String Choose one of: binary: output a binary image (medial axis); value: output a grayscale image with values of the radius of the disk to reconstruct the original image (medial axis transform).

# Description

iaskelm creates the image y by computing the morphological skeleton by B of the image f, when option is BINARY. In this case, the pixels of value 1 in y are center of maximal balls (generated from B) included in f. This is also called Medial Axis. If option is VALUE, the non zeros pixels in y are the radius plus 1 of the maximal balls. This is called Medial Axis Transform or valued morphological skeleton. It is assumed that the pixels around the image have zero values.

# Examples

## Example 1

```01. from ia870 import iaskelm
02. from ia870 import ianeg
03. from ia870 import iaframe
04. from ia870 import iabinary
05. from ia870 import iasebox, iasecross
06. from ia870 import iabshow
07.
08.
09. a=ianeg( iaframe( iabinary(ones((7,9)))))
10. print 'a=\n', a * 1
13. print 'Morphological skeleton with radius of the maximal balls:\n'
```a=
[[0 0 0 0 0 0 0 0 0]
[0 1 1 1 1 1 1 1 0]
[0 1 1 1 1 1 1 1 0]
[0 1 1 1 1 1 1 1 0]
[0 1 1 1 1 1 1 1 0]
[0 1 1 1 1 1 1 1 0]
[0 0 0 0 0 0 0 0 0]]
[[False False False False False False False False False False False]
[False False False False False False False False False False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False False False False False False False False False False]
[False False False False False False False False False False False]]
[[0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 1 0]
[0 0 1 0 0 0 1 0 0]
[0 0 0 1 1 1 0 0 0]
[0 0 1 0 0 0 1 0 0]
[0 1 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0]]
[[False False False False False False False False False False False]
[False False False False False False False False False False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False False False False False False False False False False]
[False False False False False False False False False False False]]
[[0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0]
[0 0 0 1 1 1 0 0 0]
[0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0]]
Morphological skeleton with radius of the maximal balls:

[[False False False False False False False False False False False]
[False False False False False False False False False False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False  True  True  True  True  True  True  True False False]
[False False False False False False False False False False False]
[False False False False False False False False False False False]]
[[0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 1 0]
[0 0 2 0 0 0 2 0 0]
[0 0 0 3 3 3 0 0 0]
[0 0 2 0 0 0 2 0 0]
[0 1 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0]]
```

## Example 2

```1. a=mmreadgray('pcbholes.tif')
```[[False False False ..., False False False]
[False False False ..., False False False]
[False False False ..., False False False]
...,
[False False False ..., False False False]
[False False False ..., False False False]
[False False False ..., False False False]]
```

## Example 3

```1. from ia870 import iasecross
2. from ia636 import ianormalize
3.
```[[False False False ..., False False False]
[False False False ..., False False False]
[False False False ..., False False False]
...,
[False False False ..., False False False]
[False False False ..., False False False]
[False False False ..., False False False]]
```

## Example 4

```1. B=array([1,1,1,1,1],bool)
2. A=array([1,1,1],bool)
3. iashow(iabshow(B,B),title='B')
4. iashow(iabshow(A,A),title='A')
```iaskelm=