# Figure 4.6 - Sequential thinning using compass templates

## Description

The figure 4.6 shows the effect of thinning when cycling through these eight pairs.

We use to denote the output of the th compass template on the th cycle, where:

(a.) , (b) , (c) , (d) (e) , (f) , (g) , (h) , (i) , (j) , (k) and (l)

## Demo Script

``` 1 import ia870 as MT
2 import ia636 as ia
3
4 S = MT.iabinary([
5     [0,0,0,0,0,0,0,0,0,0,0,0,0],
6     [0,1,1,1,1,1,1,1,1,1,1,1,0],
7     [0,1,1,1,1,1,1,1,1,1,1,1,0],
8     [0,0,1,1,1,1,1,1,1,1,0,0,0],
9     [0,0,0,1,1,1,1,1,1,1,0,0,0],
10     [0,0,0,0,1,1,1,1,1,1,0,0,0],
11     [0,0,0,0,0,1,1,1,1,1,0,0,0],
12     [0,0,0,0,0,0,0,0,0,0,0,0,0]])
13
14 I0 = MT.iahomothin()
15 I1 = MT.iainterot(I0,45)
16 I2 = MT.iainterot(I0,90)
17 I3 = MT.iainterot(I0,135)
18 I4 = MT.iainterot(I0,180)
19 I5 = MT.iainterot(I0,225)
20 I6 = MT.iainterot(I0,270)
21 I7 = MT.iainterot(I0,315)
22
23 s0 = MT.iasupgen(S, I0)
24 S1 = MT.iasubm(S,s0)
25 s1 = MT.iasupgen(S1,I2)
26 S2 = MT.iasubm(S1,s1)
27 s2 = MT.iasupgen(S2,I3)
28 S3 = MT.iasubm(S2,s2)
29 s3 = MT.iasupgen(S3,I4)
30 S4 = MT.iasubm(S3,s3)
31 s4 = MT.iasupgen(S4,I5)
32 S5 = MT.iasubm(S4,s4)
33 s5 = MT.iasupgen(S5,I0)
34 S6 = MT.iasubm(S5,s5)
35 s6 = MT.iasupgen(S6,I2)
36 S7 = MT.iasubm(S6,s6)
37 s7 = MT.iasupgen(S7,I4)
38 S8 = MT.iasubm(S7,s7)
39 s8 = MT.iasupgen(S8,I5)
40 S9 = MT.iasubm(S8,s8)
41 s9 = MT.iasupgen(S9,I0)
42 S10 = MT.iasubm(S9,s9)
43
44 fig_a = MT.iabshow(S,S)
45 fig_b = MT.iabshow(S,S1)
46 fig_c = MT.iabshow(S1,S2)
47 fig_d = MT.iabshow(S2,S3)
48 fig_e = MT.iabshow(S3,S4)
49 fig_f = MT.iabshow(S4,S5)
50 fig_g = MT.iabshow(S5,S6)
51 fig_h = MT.iabshow(S6,S7)
52 fig_i = MT.iabshow(S7,S8)
53 fig_j = MT.iabshow(S8,S9)
54 fig_k = MT.iabshow(S9,S10)
55 fig_l = MT.iabshow(S10,S10)
56