The PillarFinder and PillarReader programs 0. Introduction 1. PillarFinder 2. PillarReader ------------------------------------------------------ 0. Introduction These two programs are designed to provide a solution to search the pillars at a given area and to find out the words on the pillar plaque. The first program, PillarFinder, replaces the Scanner program. It works in the same way with the Scanner program, but it produces better result by searching for a rectangular area instead of a list of points. The second program, PillarReader, can be used to find out the text on the pillars. It accepts pillar areas produced by the PillarFinder as input parameters and tries to find out the text and print it as ascii art. To use these programs, copy them into the src folder with the Surface programs. The build.xml must be copied into the java-programs folder if Ant script is to be used. (The old build.xml file can be replaced.) 1. PillarFinder - the Pillar scanning program PillarFinder is the client program to search pillars by scanning a given area chunk by chunk. It works in the same way of the Scanner tool. It accepts a central point, a radius and a step to search the area in a spiral way. When a flat rectangle is found, it is added into a cache and after all chunks are searched, the cached areas are compared and those adjacent to each other will be merged into one larger rectangle which is regarded as a pillar candidate. Finally, the coordinates of these pillars are displayed. To run the PillarFinder program with Ant script: Ant scan-pillars ¨CDcx= -Dcy= -Dstep= [-Dsamples=] The samples parameter is optional, the default value is 10000. To run it without Ant: java -cp ./build/classes uk.ac.nesc.training.sfk.PillarFinder [] The threshold parameter is optional, its default value is 0.00001 specifying the height difference between two points below which they are regarded as on the same plane. 2. PillarReader - the plaque reading program PillarReader is the client program to display words on pillars from a specific area given by the surface provider. It is assumed that the pillar is an axis-aligned cubic that always floats on and above the background surface level. The background terrain is noisy but the pillar can be identified as it has a flat surface. A plaque is attached on the pillar, and a word is printed on the plaque. The plaque is a bit higher than the pillar surface and the print is either a bit higher(embossed) or lower(engraved) than the plaque surface. If the given area is a pillar with a flat surface, the word on the plaque will be printed in the specified text file, otherwise it reports "no plaque found" message. Running PillarReader with Ant script: Ant read-pillars ¨CDx1= -Dy1= -Dx2= -Dy2= -Dstep= -Dthreshold= -Dout= X1, y1, x2, y2 are parameters that determine the sample rectangle to search; Step gives the distance between two sample points, the smaller this number is, the more samples will be collected; Threshold is the value of height which can be regarded as flat. If the difference between the height of two points is no greater than threshold, they are regarded as on a flat plane. Result file name is the file to save the found pillar and the plaque picture. Running PillarReader directly: Java ¨Ccp ./build/classes uk.ac.nesc.training.sfk.PillarReader Sample Output for globus: ##### ## ## ## ## ## ## ## ## ## ###### ## ### ## # ##### ## ## # # #### ## ## # ## ## ## ###### ## # # ## ## ## # ## ## ## ## # # ## ## ## # ##### ## ## ## # # ## ## ## # ## ## ## ## # # #### ## ## ### ## ## ##### ## ###### ## ### #### # ##### Sample Output for Ischia: ####################################################### ####################################################### # ######################### ########## ############# # ######################### ######################### # ######################### ######################### # ##### ####### ##### ## ##### ##### ### # ### ##### ### ### ### ### ### ### ##### # # ### ########## ######## ##### ### ########## # # ### ########## ######## ##### ### ########## # # ##### ##### ######## ##### ### ##### # # ########## ### ######## ##### ### ### ##### # # ### ##### ### ### ### ##### ### ### ### # # ### ##### ### ### ### ##### ### ### ### # # ##### ####### ##### ##### ### ##### ## # ####################################################### ####################################################### From the result, we can see that the plaque word Globus is embossed while Ischia is engraved on the plaque. Tips of using PillarReader: This version of PillarReader is changed to treat the given area as the pillar surface. That means it no longer searches the given area for pillar boundary. Instead, if it finds anywhere in the area not on a flat plane, it reports an error and exits. Otherwise, it's able to print out the word in the output file. If the given area is too large or the step size is too small, then the PillarReader program will load too much data into memory and causes a out-of-memory fault. In this case it is better to increase the step size (distance between the sample points). It also helps narrowing down the area, but keep in mind that the plaque may occupy only a small portion of the pillar surface and may be placed anywhere, so a narrowed area may still find nothing. If the step size is too big, the PillarReader may fail to find anything although a pillar exists inside the given area.