Figure 9 The left side shows edges (1's) around the triangle and rectangle and then several stray edges. The right side shows the result of eroding or removing any 1 that has seven 0 neighbors

00000000000000000000  00000000000000000000
01000000000000111000  00000000000000010000
00000001000000000000  00000001000000000000
01100010100000000010  00000010100000000000
00000100010000000010  00000100010000000010
00001000001000000010  00001000001000000000
00010000000100000000  00010000000100000000
00111111111110000000  00111111111110000000
00000000000000000110  00000000000000000000
00100000000000000000  00000000000000000000
01000111111111111000  00000111111111111000
00000100000000001000  00000100000000001000
00000100000000001000  00000100000000001000
00000100000000001000  00000100000000001000
00100100000000001000  00000100000000001000
00100100000000001000  00000100000000001000
00000111111111111000  00000111111111111000
00000000000000000000  00000000000000000000
00011000000000000000  00001000000000000000
00000100000000000000  00000000000000000000