Information Technology Reference
In-Depth Information
Figure 6.6.
The sketch map interpretation
sketch.pl
solution(R1,R2,R3,R4,R5) :-
region(R1), region(R2), region(R3), region(R4), region(R5),
% Size constraints
\+ small(R1), \+ small(R2), \+ small(R3),
\+ small(R4), small(R5),
% Regularity constraints (none for R4)
regular(R3), regular(R5), \+ regular(R2), \+ regular(R1),
% Border constraints
border(R1,R2), border(R2,R4),
% Containment constraints
inside(R3,R2), inside(R5,R4).
% The definitions of region, small, border, etc. are elsewhere.
?- solution(R1,R2,R3,R4,R5).
R1 = water,
R2 = grass,
R3 = house,
R4 = pavement,
R5 = vehicle
This is the only visual interpretation that satisfies all the constraints. Note how the
interpretations for some regions help to disambiguate others. For example,
R4
is large,
so it cannot be a vehicle. But it is not clear whether it should be seen as regular or
irregular. However, it clearly surrounds region
R5
, and once it is determined that
R5
is
a vehicle, background knowledge leads to the conclusion that
R4
must be pavement.
On a much smaller scale, this is precisely the sort of thinking that took place to
interpret the blob as a car in figure 6.2!
Also note that the constraints work together to identify the regions and that there
can be redundancy. For example, if the
\+ small(R3)
constraint is eliminated from
the solution predicate, one still gets a unique interpretation of the image as before.
This is why it was not necessary to specify whether region
R4
was regular or irregular
in the image. On the other hand, if the
small(R5)
constraint were eliminated instead,
there would be two interpretations: the previous one and a second one where
R5
is
a house. Of course, if the constraint
\+ small(R1)
were replaced by
small(R1)
, the
image would have no interpretation at all.
6.3 Polyhedral objects
Figure 6.7 shows a very different type of image, a three-dimensional, L-shaped, block-
like object (or
polyhedron
). At first, it is not clear that any interpretation is needed here.