?fo 'Max Clowes'- % -'February 78'
.ce2
Notes for Lab Session - Mental Schemata I - Monday 20th February.
----------------------------------------------------------------

.ce2
Pattern Recognition : a simple template system
----------------------------------------------
.pg
Find a vacant teletype and respond to the 'LOGIN' prompt by typing
'POP11' and a 'newline'.
(The 'newline' key may be marked 'carriage return', 'CR', 'line feed' or 'LF' depending
on the particular terminal you choose to use.)
The computer will respond by printing out a message and a further prompt (a ":").
Now type:
.br
.tp 5
 	LIB RECOGNISER;
.br
After a short delay the recognition system will be ready for use.
.br
NB:
don't forget the ";" and newline at the end of each POP11 command and always wait
for a prompt before typing a command.
If you make a typing mistake press the buttons marked CTRL and X simultaneously, wait
for the ":" prompt and then retype the command.
.pg
There is a set of simple patterns (of more or less familiar shapes)
which you can try out on the recogniser. You can inspect the
samples by typing:
.br
.tp 5
 	SAMPLES();
.br
The recogniser has four templates one for each of the capital letters
A, C, E and F.
You can try out its performance by selecting a sample,
say the first, by typing:
.br
.tp 5
 	SAMPLE(ONE);
.br
and after the computer has responded, typing:
.br
.tp 5
 	RECOGNISE();
.br
The computer will print out a table, showing how the sample
'correlated' with each
template. There are three numbers,
SAME, MISSING
and
EXTRA
for each template. 
SAME
is the number of
inked sample points in common with the points of the
template, MISSING is the number of template points where there
is no ink in the sample and EXTRA is the number of inked pattern
points where there is no corresponding template point.
Which of these three measures seems best for
deciding the identity of the sample you tried? Why?
.pg
Try out your conjecture by trying some more samples, for example:
.br
.tp 5
 	SAMPLE(TWO);
.br
followed by:
.br
.tp 5
 	RECOGNISE();
.br
You can inspect the pattern of correlation between a sample and
a particular template by setting up a sample, for example:
.br
.tp 5
 	SAMPLE(TWO);
.br
and requesting correlation with a specific template:
.br
.tp 5
 	CORRELATE(A);
.br
The template will now be on the 'retina' of the system and
we can inspect it by typing:
.br
.tp 5
 	EXHIBIT(RETINA);
.br
Its correlation with the template will be on the 'cortex' of the
system and can be displayed by:
.br
.tp 5
 	EXHIBIT(CORTEX);
.br
The cortex 
pattern has an "S" everywhere that template and pattern are both
inked, "M" where there is ink missing from the pattern and
"E" where there is an extra pattern point that has no point
in the template to match it. The numbers in the table
generated by 
RECOGNISE
should match the aggregate scores of these three kinds of correlate. Do they?
You can check all the templates like this in turn if you wish, just repeat the
correlate command with the different template names, C, E, F.  
.pg
The recognition table for sample ONE is not the same as that for
sample TWO, although ONE and TWO are alike. Why do
you think that is? Use
CORRELATE
to check out your guess. What other changes to pattern ONE
could we make that would disrupt 
RECOGNISER
without compromising our ability to recognize it?
What happens when a piece of text, for example, sample SIX is presented
to the system? 
.sp2
.ce2
Description or Recognition?
--------------------------
.pg
A program written by Steve Hardy analyses images like
sample ONE in terms of three kinds of 
.ul
lines
.br
.tp 5
 	ROWS, COLUMNS and DIAGONALS
.br
and the types of junctions between them:
.br
.tp 5
 	TEE, ELL, CROSS
.br
amongst others. It builds a
.ul
description
of an image as a
.ul
database.
You can try out Steve's program:
.br
.tp 5
 	LIB SEEPICTURE;
.br
(SEEPICTURE is the name of Steve's program.)
To use SEEPICTURE on, say, sample ONE, type:
.br
.tp 5
 	SAMPLE(ONE);
.br
.tp 5
 	IMAGE -> PICTURE;
.br
N.B. -> is two characters not one: the - sign followed by the > sign.
The second command here transfers the image to SEELINE's picture space.
After setting up ready for SEEPICTURE give the command:
.br
.tp 5
 	SEEPICTURE();
.br
This starts the program running.
This command takes a long time to run so be patient.
When you get the ":" prompt type:
.br
.tp 5
 	DATABASE ==>
.br
which prints out the description built up by SEEPICTURE.
.pg
Mark all the lines you can see in sample ONE (by writing A, B etc
on its printed image)
and then find and mark the descriptions of these lines produced by SEEPICTURE.
.pg
Repeat the whole process for sample THREE and sample SIX.
.pg
When you have finished using the computer type CTRL-X (by pressing the buttons
marked CTRL and X simultaneously) and then, when you get the ":" prompt,
type CTRL-D (by pressing the buttons marked CTRL and D simultaneously).
.pg
Please bring this handout and your computer printout to your
seminar on Tuesday or Wednesday. 
