.he'PICPLAY''Page %'
.fo'Max Clowes'- % -'October, 1977'
.ce2
The PICPLAY Package
===================
.pg
Steve wrote this package as a teaching aid for use in Mental Schemata I;
it is concerned with demonstrating two kinds of processing applied here to
an image of a simple blocks scene.
.pg
The package is accessed by
 	: LIB PICPLAY;
.br
which lists the commands available.
.pg
The blocks scene can be inspected by
 	: BASIC();
.br
This image is an idealised grey-level picture in which each surface is
portrayed as a picture region of uniform brightness. It is a little hard to
see in this form
so a printout of it is available through
 	: REPAINT();
.br
Two edge detectors have been preprogrammed:
 	: HORIZ();
.br
and	: VERT();
.br
Their operation is essentially to look at a 2x2 'window` adding and subtracting
the picture values at the specified window locations in accordance with the
sense + or - specified in the operator. This window is translated step-by-step
across the image and at each new situation the same calculation is carried out:
the result is recorded
in the appropriate location in the 'edged` picture. It is this 'edged` picture
that is displayed.
.pg
The DISPLAY function prints out only those points where the
computed value exceeds THRESHOLD.
The value of THRESHOLD can be inspected
 	: THRESHOLD =>
.br
and changed
 	: 2 -> THRESHOLD;
.pg
Applying two operations to the picture in succession causes the results to be
'added` that is the 'edged` picture resulting from VERT(); If you want to look
at them separately, or to start again you may erase the 'edged` picture
by
 	: RESET();
.br
If you now
 	: DISPLAY();
.br
you should have a blank picture.
.pg
The edge operators provided may not be to your taste - for example they
both 'see` diagonal lines and you may think you can improve on them.
A function
 	: READ();
.br
is provided which enables you to state your own operator. The package will
reply to READ(); with
 	** 'WHAT SIZE TEMPLATE WOULD YOU LIKE?`
.br
and the reply of say
 	: 3	will set up a format for you to specify a 3x3 operator.
(Operators are restricted to square format). The package will respond
with a further prompt to read in your operator. Remember that you can use
+, - or space. These 'edge` operations are modelled on the known Physiology -
see relevant section of Uhr. 
.sp
.ce
--------------
.pg
The second kind of process relevant to a blocks image is one that can be
performed on the 'edged` picture, by SEEPICTURE. Steve has used SEEPICTURE in
two functions in the package - called PROCESS and DESCRIBE.
.pg
When you have an 'edged` picture to your liking i.e. one that contains all and only
the edge points you`d like to see, issue the command
 	: PROCESS();
.br
This will produce a picture in which the lines have been distinctively
labelled \\, /, !, - according to their orientation and the junctions between
the lines labelled according to their category, i.e. an ELL (L), FORK (F),
TEE (T), ARROW (A). (See Guzman, Huffman, Clowes (1971, 1976) for an account
of these categories).
.pg
If the edged picture you`re PROCESSing contain too many points, SEEPICTURE
may be unable to get enough workspace in the machine to hold the data
structures built up (and later pruned) in the early phase of its analysis. In
that event you will get an error message:
 	** 'PICTURE TOO COMPLICATED -- TRY A HIGHER THRESHOLD'
.br
and no labelled picture!
.pg
You may retrieve the situation by reducing the number of points offered to
PROCESS: inspect your 'edged` picture and choose a new value for threshold which
would exclude some of the picture points. e.g.
 	: 4 -> THRESHOLD;
.br
and then try
 	: PROCESS();  again.
.br
Thus the value of THRESHOLD is used to determine what points are included in
the 'edged` picture at the time of its production. (e.g. by VERT();), what
points are DISPLAYed, and what points are PROCESSed.
.pg
The functions DESCRIBE and PERFECT are included to give you some idea of
how well SEEPICTURE can perform if the 'edged` picture is perfect. You may by
now have views about the perfectability or otherwise of edging operators, based
upon your experiments with PICPLAY. If you want to make your own PICPLAY package
see the PICTURES demo.
.pg
For economy of workspace, PROCESS and DESCRIBE do not retain the DATABASE that
SEEPICTURE creates.
If you want to see this datastructure try the following:
 	: SEEPICTURE();
 	: DATABASE ==>
