TEACH POPVISION Aaron Sloman Nov 1995 How to use David Young's Popvision library At Birmingham there is now a saved image that can be used to start up with the core vision libraries pre-compiled. Type pop11 +vis Otherwise do the following 1. load lib popvision to ensure that all the search paths are set up correctly uses popvision This adds various directories in $poplocal/local/popvision to Ved's and Pop-11's search paths. 2. Then try TEACH * VISION1 For a short cut, do the following, extracted from that file, just to check that things work OK.  uses popvision ;;; search popvision libraries  uses rci_show ;;; image display utility  uses showarray ;;; array printing utility  uses arrayfile ;;; array storage utility  uses sunrasterfile ;;; alternative image storage  vars image; ;;; declare a permanent variable  arrayfile(popvision_data dir_>< 'stereo1.pic') -> image;  rci_show(image) -> ; Click on the image to make it go away, then do that last command again to make it come back.  image =>  true -> sa_print_axes; ;;; make showarray show row and col nos  showarray(image, [80 96 64 70], false, "nums", '');  10 -> rci_show_scale; ;;; increase the scale  rci_show(arraysample(image, [80 96 64 70], false, false, "nearest"))-> ;  1 -> rci_show_scale; ;;; put the scale back as it was  255 ->> image(90,66) ->> image(90,67) ->> image(90,68)  ->> image(91,66) ->> image(91,68)  ->> image(92,66) ->> image(92,67) ->> image(92,68);  10 -> rci_show_scale; ;;; increase the scale  rci_show(arraysample(image, [80 96 64 70], false, false, "nearest"))->;  1 -> rci_show_scale; rci_show(image)->;  3 -> rci_show_scale; rci_show(image)->;  20 -> rci_show_scale; ;;; increase the scale  rci_show(arraysample(image, [80 96 64 70], false, false, "nearest"))->;  1 -> rci_show_scale; ;;; put the scale back as it was ;;;`differentiate' image:  vars newimage;  newarray([81 176 64 191]) -> newimage;  vars row, column; ;;; loop variables  for row from 64 to 191 do  for column from 81 to 176 do  image(column, row) - image(column-1, row)  -> newimage(column, row)  endfor  endfor;  2 -> rci_show_scale; ;;; double the scale  rci_show(image) -> ; ;;; redisplay the original image ;;;Move the picture to one side then do:  rci_show(newimage) -> ; ;;; display the processed image ;;; Put that in a procedure define hordiffs(image) -> newimage; ;;; Returns a new array. Each pixel of the result holds a ;;; horizontal difference between two neighbouring pixels ;;; of the input array. lvars procedure (image, newimage); lvars row, column, colstart, (col0, col1, row0, row1) = explode(boundslist(image));  ;;; Cannot calculate output for LH column  col0 + 1 -> colstart;  newarray([% colstart, col1, row0, row1 %]) -> newimage;  for row from row0 to row1 do for column from colstart to col1 do image(column, row) - image(column-1, row)  -> newimage(column, row)  endfor  endfor enddefine;  rci_show(hordiffs(image)) -> ;  1 -> rci_show_scale; ;;; double the scale vars image2;  sunrasterfile(popvision_data dir_>< 'mtg_ho.ras') -> image2; rci_show(image2) ->; ;;; This may take some time  rci_show(hordiffs(image2)) -> ; For full details on what's going on see TEACH VISION, VISION1, VISION2, VISION3 ... VISION7 VISION8 is in preparation. --- $poplocal/local/teach/popvision --- The University of Birmingham 1995. --------------------------------