% The examples in this file all use the list of lists representation
% of images as defined in the file 'image.p'.
% They are each stored using the 'image/4' predicate in the form:
% image( Name, Width, Height, Image ).
% Figure 8.2 (page 166)
image('figure 8.2', 15, 12,
[ [ 0,0,0,0,0,1,2,2,0,0,0,0,0,0,0 ],
[ 0,0,0,0,0,4,6,6,5,1,0,0,0,0,0 ],
[ 0,0,0,0,5,5,6,6,6,6,8,8,8,5,0 ],
[ 0,0,0,0,5,5,6,6,6,6,8,9,9,6,0 ],
[ 0,0,1,1,6,6,6,6,6,6,8,9,9,6,0 ],
[ 0,0,1,1,5,6,6,6,6,5,2,9,9,6,0 ],
[ 0,0,1,1,1,3,6,5,4,1,1,9,9,6,0 ],
[ 0,0,1,1,1,1,1,1,1,1,1,9,9,6,0 ],
[ 0,0,1,1,1,1,1,1,1,1,1,8,8,5,0 ],
[ 0,0,1,1,1,1,1,1,1,1,1,1,6,6,0 ],
[ 0,0,1,1,0,0,0,1,1,1,0,1,0,0,0 ],
[ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ]
] ).
% Figure 8.5 (page 170)
image('figure 8.5', 6, 6,
[ [ 0,1,2,2,0,0 ],
[ 0,4,6,6,5,1 ],
[ 5,5,6,6,6,6 ],
[ 5,6,6,6,6,5 ],
[ 1,3,2,3,3,3 ],
[ 0,2,3,7,5,8 ]
] ).
% Figure 8.6 (page 171)
image('figure 8.6', 6, 6,
[ [ 7,7,8,0,0,0 ],
[ 8,1,7,1,0,1 ],
[ 8,7,7,1,5,0 ],
[ 7,8,7,0,1,1 ],
[ 3,7,8,1,0,0 ],
[ 7,8,7,0,1,1 ]
] ).
% Figure 8.7 (page 172)
image('gaussian', 5, 5,
[ [ 0, 1, 3, 1, 0 ],
[ 1,13,30,13, 1 ],
[ 3,30,64,30, 3 ],
[ 1,13,30,13, 1 ],
[ 0, 1, 3, 1, 0 ]
] ).
% Figure 8.9 (page 175)
image('figure 8.9', 8, 8,
[ [ 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,8,8,8,8,8 ],
[ 0,0,0,8,8,8,8,8 ],
[ 0,0,0,8,8,8,8,8 ],
[ 0,0,0,8,8,8,8,8 ],
[ 0,0,0,8,8,8,8,8 ]
] ).
% Figure 8.10 (page 175)
image('figure 8.10', 8, 8,
[ [ 9,9,9,9,9,9,9,9 ],
[ 0,9,9,9,9,9,9,9 ],
[ 0,0,9,9,9,9,9,9 ],
[ 0,0,0,9,9,9,9,9 ],
[ 0,0,0,0,9,9,9,9 ],
[ 0,0,0,0,0,9,9,9 ],
[ 0,0,0,0,0,0,9,9 ],
[ 0,0,0,0,0,0,0,9 ]
] ).
% Figure 8.16 (page 182) - smae as figure 8.2
image('figure 8.16', Wid, Ht, Image) :-
image('figure 8.2', Wid, Ht, Image).
% Figure 8.17 (page 184)
image('figure 8.17', 8, 8,
[ [ 0,0,0,0,0,0,0,0 ],
[ 0,0,0,0,0,0,0,0 ],
[ 1,1,0,0,0,0,0,0 ],
[ 1,1,1,0,0,0,0,0 ],
[ 1,1,1,1,0,0,0,0 ],
[ 1,1,1,1,1,0,0,0 ],
[ 1,1,1,1,1,1,0,0 ],
[ 1,1,1,1,1,1,0,0 ]
] ).