Zhang-Suen thinning algorithm: Difference between revisions

Updated D entry according to the changes in the Python entry
(=={{header|Racket}}== implementation added)
(Updated D entry according to the changes in the Python entry)
Line 128:
static void neighbours(in Img I, in size_t x, in size_t y,
ref Neighbours n) pure nothrow {
n = [I[x,y+-1], I[x+1,y+-1], I[x+1,y], I[x+1,y-+1], // P2,P3,P4,P5
I[x,y-+1], I[x-1,y-+1], I[x-1,y], I[x-1,y+-1], // P6,P7,P8,P9
I[x,y+-1]]; // P2
}
 
Line 257:
##..###
#.....#
#....#.#
#...#.##
#...#..
#...#..
Line 284:
To thinned:
................................
...#####..##.........####.##........
..#.....#........##....##.........
..#......#.......#..............
..#.....#........#..............
..####.#.#........#..............
..#...#..##........#..............
..#......#.....#...##....##......#...
.........#....#....##.####....#.....
................................
 
Line 317:
...........................................................
...........................................................
......#.##########...............................#######.............
.....##........#...................###########.......#............
.....#..........#.................##.......................
.....#..........#................#.........................
Line 328:
.....#..........#................#.........................
.....#..........#................#.........................
.....#...........#.................##.......................
.....#.............................####.......########............
....#...................###.............#######.............###....
...........................................................
...........................................................</pre>