/*  --- Copyright University of Sussex 1986.  All rights reserved. ---------
 *  File:           $usepop/master/C.all/lib/demo/vis.p
 *  Purpose:        Infinite demo of seepicture for openday - call demostart();
 *  Author:         Chris Mellish, ??? (see revisions)
 *  Documentation:
 *  Related Files:
 */

pr('\n\nStarting continuous Computer Vision demo.\n');
pr('Please wait while various programs are loaded.\^@');

uses active;
endactive;

define pause();
	rawcharout(0);
	charout(0);
	syssleep(500)
enddefine;

define pausepr(str);
	pr(str);
	pause();
enddefine;

define demostart();
vars cucharout;
	repeat
		vedscreenclear(); rawcharout(0);
		[] -> database;
		pr('This is a very slowed down demonstration of some of the processes\n');
		pr('that can be used in the analysis of visual images. To start with,\n');
		pr('the processes involved are illustrated with a very simple picture.\n\n');
		pause();
		Vout -> cucharout;
		compile('$usepop/pop/lib/demo/demopic.p');
		pausepr('\nA picture made out of stars - ');
		pausepr('\nfirst the computer must find lines');
		findlines();
		pause();
		pausepr('\nThis produces a "database" containing line information');
		charout -> cucharout;
		nl(2);
		database==>
		pausepr('\nNow this database is used to find line junctions');
		findjuncs();
		nl(1);
		database==>
		pr('\nThis can be used to re-draw the original picture');
		pausepr('\nwith the direction of lines and kinds of junction marked');
		sysdisplay();
		paintpicture();
		repeat 2 times pause() endrepeat;
		nl(1);
		vedscreenclear(); rawcharout(0);
		[] -> database;
		pr('Now the whole process will be gone through with a slightly more\n');
		pr('complicated picture (except that the database becomes much\n');
		pr('bigger and is not shown)\n');
		pause();
		compile('$usepop/pop/lib/turtle/edgepic.p');
		findlines();
		pause();
		findjuncs();
		paintpicture();
		repeat 3 times pause() endrepeat;
		nl(1);
	endrepeat
enddefine;

;;; tabified
