How to Use 'COLLAGE' Software by Russ Ambroziak Documentation by Christine Cook U. S. Geological Survey Mail Stop 915 12201 Sunrise Valley Drive Reston VA 22092 tel: 703-648-6481 fax: 703-648-5464 August 12, 1993 Table of Contents Page Introduction and System quirements......................1 Anatomy of a .COL file..................................2 Program IMVIS...........................................6 Program SAMPLE..........................................7 Program MAKECOL.........................................8 Program COLLAGE........................................13 Program REGG...........................................14 COLLAGE Functions......................................20 Introduction and System Requirements COLLAGE allows the user to view earth-registered raster images and vector line-work overlays at the same time. It looks very much like Russ's program MAPPER, except it is not mouse driven. As with the other GIV (Geologic Information Visuali- zation) programs, COLLAGE is written for the IBM-PC and com- patible microcomputers. The minimum system requirements are: 640 kb RAM MS- or PC-DOS version 3.1 or later EGA/VGA graphics system with one of the following: TSENG 3000 or 4000 chip set (Orchid Card)* or PARADISE VGA Professional Board or ATI VGA XL Wonderboard or TRIDENT Graphics Card math coprocessor is strongly recommended * Any use of trade, product, or firm name is for descriptive purposes only and does not imply endorsement by the U.S. Government. The Anatomy of a .COL file COLLAGE requires an ASCII .COL control file in order to run. (Recall that MAPPER requires a .MAP file.) The user must create the .COL file with a text editor. Any editor will do, as long as the document can be saved as a DOS text file and not an editor file format (such as a Word Perfect 5.1 document). This .COL file is the heart of COLLAGE and has many similarities to a .MAP file, with a few exceptions. The following is a sample .COL file along with descriptive text. p 2.800 46.0 -83.86 10.0 < The first line has a character and four numbers. The > < character is the projection: > < p = plate carree or x-y projection (recommended) > < a = Albers Equal Area > < s = Polar Stereographic > < S = Sinusoidal > < m = Mercator > < The numbers are: > < 2.800 = pixel size of center pixel in kilometers > < 46.0 = latitude of center pixel > < -83.86 = longitude of center pixel > < 10.0 = of no obvious use, but must exist for > < COLLAGE to run properly > begin_color black = 0 0 0 d_grey = 46 46 46 l_grey = 128 128 128 white = 255 255 255 buff = 105 90 75 l_buff = 130 111 93 brown = 96 28 14 red = 255 0 0 orange = 255 128 0 yellow = 160 160 0 green = 0 200 0 blue = 0 0 200 d_blue = 0 20 60 cyan = 0 255 255 m_cyan = 0 120 120 d_cyan = 0 60 60 end_ color < You can define up to 16 VGA (or EGA) colors here for use in> < line work vector overlays. The format is a color name, =, > < then a red, green and blue color value. The 'end_color' > < statement must be located after the last color. It marks > < the end of this portion of the .COL file. > menu_background = d_grey < The menu can bemade any color, > text = l_grey < but something must be given for > highlight = white < each item. The blank screen > background = buff < color is 'buff' > graticule = l_buff lat/lon = d_grey black = black begin_vector < This line starts the vector > images = 1 ON < portion of COLLAGE. > image 100.0 0.0 d_blue begin_collage < This starts the image collage > color_lut = grey.lut < portion. All the information > assignment = grey.asn < that folows, until the 'end_ > missing = 127 < collage' line is created by the > minimum_pixel = 0.000700 < program MAKECOL which is > begin_image < described later. > ---------------------------------------------------------- name maxpix minpix row col N a0 a1 ------- -------- ---------- ----- ------- -- ---- ------* m1.ras 0.002100 0.000700 4450 7408 < 1st image, full res > 4 4.2101681e+001 -5.9127001e-006 0.0000000e+000 -2.5287999e-008 4 -8.6563377e+001 7.9396996e-006 0.0000000e+000 -6.4520997e-008 m1w.ras 0.006300 0.002100 1483 2469 < 2nd image 1/9th res > 4 4.2101681e+001 -1.7738100e-005 0.0000000e+000 -7.5863998e-008 4 -8.6563377e+001 2.3819099e-005 0.0000000e+000 -1.9356299e-007 m1x.ras 0.018900 0.006300 494 823 < 3rd image 1/18th res> 4 4.2101681e+001 -5.3214301e-005 0.0000000e+000 -2.2759199e-007 4 -8.6563377e+001 7.1457296e-005 0.0000000e+000 -5.8068897e-007 m1y.ras 0.056700 0.018900 164 274 < 4th image 1/27th res> 4 4.2101681e+001 -1.5964290e-004 0.0000000e+000 -6.8277598e-007 4 -8.6563377e+001 2.1437189e-004 0.0000000e+000 -1.7420669e-006 m1z.ras 100.000 0.056700 54 91 < 5th image 1/36th res> 4 4.2101681e+001 -4.7892871e-004 0.0000000e+000 -2.0483279e-006 4 -8.6563377e+001 6.4311567e-004 0.0000000e+000 -5.2262007e-006 < The above is a list of the images to be plotted. Maxpix and > < minpix refer to the pixel size of the screen for plotting the> < appropriate image file. Each file is 1/9th the size of the > < previous one. They are made by taking every third pixel of > < every third row with the program SAMPLE. For the smallest > < image, averaging is sometimes used. The coefficients a0, a1,> < etc. are for projecting the pixel from x/y to lat/lon. The > < order of the coefficients is: > < lat = a0 + a1*y + a2*y*y + a3*x + a4*x*x + a5*x*y > < lon = b0 + b1*x + b2*x*x + b3*y + b4*y*y + b5*x*y > end_image < These lines mark the end of the > end_collage < image and collage portions of > < the .COL file. > water = 3 ON < The rest of the file is > b_wtrb2b 100.0 0.0 D_BLUE < the vector linework. It > b_wtrb3b 100.0 0.0 D_BLUE < is set up exactly as line> b_wtrb4b 100.0 0.0 D_BLUE < work in a MAPPER .MAP > stream = 2 OFF < file. > b_strm1b 100.0 0.0 BLUE b_strm2b 100.0 0.0 BLUE shore = 4 ON b_wtrbcb 100.0 1.0 D_BLUE b_xwtrbc 100.0 1.0 D_BLUE mcoast 1.0 0.0 D_BLUE coast 0.10 0.00 YELLOW bathy = 2 OFF mbathy 100.0 0.25 D_CYAN bathycli .25 0.0 YELLOW detail_geo = 3 OFF m1 100.0 0.0 GREEN m2 100.0 0.0 GREEN m3 100.0 0.0 GREEN road = 4 OFF b_road4 100.0 0.0 L_BUFF b_road3 100.0 0.0 L_BUFF b_road2 100.0 0.0 L_BUFF b_road1 100.0 0.0 L_BUFF state = 1 ON b_statlb 100.0 0.0 RED county = 2 OFF b_cntylb 100.0 0.0 BROWN b_city1b 100.0 0.0 D_GREY end_vector < This marks the end of the vector> < linework and the end of the .COL> < file. > A lot of the information within the .COL file may look confusing, but it is all derived from related programs as described in the following sections. There is some basic information about the images to be plotted which the user must know before COLLAGE can work. These are: * the resolution of the image (pixels/Km) * the number of rows and columns in the image * specific points of the image in both lat/lon and x/y (usually corner points) * the number of sample bits for the image Program IMVIS The first step is to view the full resolution image. As the vast majority of images used with COLLAGE have been gray-scale (side-scan sonar has been the main type of image used thus far), I will assume that your image of interest is also gray-scale. If your image is color, you will need to have a color palette file for the image. To view the full resolution image, you need to create a .LBL file using a text editor. The following example is 'm1.lbl': FILE_TYPE = IMAGE IMAGE_LINES = 4450 LINE_SAMPLE = 7408 SAMPLE_BITS = 8 IMAGE_POINTER = 'm1.ras' END The first line describes what type of information this file is used for, namely, an image file. The next two lines are the number of lines (rows) and number of samples (columns) of the image. This is information you must know about your data. The next line is the number of sample bits for the image. The sample bits can be 8, 16, 24, or 32 depending on how the image was created. Next, the name of the image file to be plotted is located within the ' '. Here, the image is 'm1.ras' which is a raw raster image of some side-scan sonar information. The last line marks the end of the file. To view the image to make sure everything is correct, type IMVIS. In the upper right corner of the screen, you should see the .LBL file. Move the highlight bar over the filename and hit (or the left mouse button). The image should appear on the screen. A box in the upper left of the image is the 'zoom' box. It can be moved with your keyboard arrow keys only. Move the box somewhere on the image and hit . A zoomed section of the image should appear. If you zoom below full resolution, you will begin to see pixel replication. To exit IMVIS, move the bar to 'Quit' and hit or the left mouse button. Hit a couple of times to return to the DOS prompt. For more information on IMVIS see the documentation which deals with that program. If the image does not appear, check to see that 'imvis.exe' and the image are in the same path. Or, type: imvis drive_letter:\sub_directory. For example, prompt> imvis d:\images Where the .LBL file is located on the D-drive in the 'images' sub-directory. IMVIS will check that directory along with the directory in which IMVIS is located for all .LBL files. This way, the image can reside on a CD-ROM while you run IMVIS from your hard drive. IMVIS creates a .XMG file for the image you are viewing which is simply a screen save of the image. This enables IMVIS to run faster the next time you view that same image. The .XMG file has the same filename as the .LBL file. Program SAMPLE SAMPLE creates the data files 'filew', 'filex', 'filey', and 'filez' from the original full resolution file. The command line for SAMPLE is: sample image_file #lines #samples headers /s For example, sample m1.ras 4450 7408 0 0 0 /s Each file created by SAMPLE is 1/9th the size of the proceeding file. From the above 'm1.lbl' example, 'm1.ras' is 4450x7408, 'm1w.ras' is 1483x2469. 'm1w.ras' is created by taking every third pixel from every third row of 'm1.ras' (4450/3=1483, and 7408/3=2469). The final result of running SAMPLE on 'm1.ras' is: filename lines samples -------- ----- ------- m1.ras 4450 7408 m1w.ras 1483 2469 m1x.ras 494 823 m1y.ras 164 274 m1z.ras 54 91 The reason for creating these smaller raster files is to enable COLLAGE to run more efficiently. On a large scale zoom, it is better to have the lower resolution images plot. If the full resolution image were to plot, COLLAGE would be slowed down immensely because the pixels would be overwriting each other. As you zoom into the image for more detail, different resolution images are plotted. The pixel range for when the images should be plotted is calculated by MAKECOL. Program MAKECOL This program does all the number-crunching necessary for the .COL file. Recall from the sample .COL file above, the numbers located within the 'begin_collage' section. These numbers are created by MAKECOL. In order for MAKECOL to run, you must create a .MCL (short for MakeCoL) file using a text editor. The format for the .MCL file is as follows: image filename pixel resolution in Km # lines # samples number of latitude coefficients to follow a0 a1 a2 a3 a4 a5 number of longitude coefficients to follow b0 b1 b2 b3 b4 b5 The tricky part here is to determine the correct coefficients from the two equations: lat = a0 + a1*y + a2*y*y + a3*x + a4*x*x + a5*x*y lon = b0 + b1*x + b2*x*x + b3*y + b4*y*y + b5*x*y For the first time through, it is easiest to use the following: a0 = latitude of upper left corner of image a1 = dlat/dy a2 = a3 = a4 = a5 = 0 b0 = longitude of upper left corner of image b1 = dlon/dx b2 = b3 = b4 = b5 = 0 Going back to the 'm1.ras' example, we were given the following: x y lat lon ----- ----- ------- -------- upper left corner 0 0 42.1028 -86.5667 upper right corner 0 4450 42.1028 -86.5042 lower left corner 7408 0 42.0750 -86.5667 lower right corner 7408 4450 42.0750 -86.5042 Therefore, a0 = 42.1028 a1 = (42.0750 - 42.1028) / 4450 = -6.2472e-006 b0 = -86.5667 b1 = (-86.5042 - (-86.5667)) / 7408 = 8.43683e-006 So, the final 'm1.mcl' file is as follows: m1.ras 0.0007 4450 7408 2 42.1028 -6.2472e-006 2 -86.5667 8.43683e-006 Since the other coefficients are all zeros, you can leave them out of the file. The next step is to run MAKECOL on this file. After typing MAKECOL at the DOS prompt, you will see a list of all .MCL files appear in the upper right of the screen. Move the highlight bar over the file you want and hit . MAKECOL will create the file 'filename.COL'. For our example, MAKECOL created 'm1.col': begin_vector begin_collage color_lut = grey.lut assignment = grey.asn missing = 0 minimum_pixel = 0.000700 begin_image ------------------------------------------------------- name maxpix minpix row col N a0 a1 --------- ------ ------ ---- ---- - ------ ------------* m1.ras 0.002100 0.000700 4450 7408 2 4.2102798e+001 -6.2472000e-006 2 -8.6566704e+001 8.4368303e-006 m1w.ras 0.006300 0.002100 1483 2469 2 4.2102798e+001 -1.8741600e-005 2 -8.6566704e+001 2.5310491e-005 m1x.ras 0.018900 0.006300 494 823 2 4.2102798e+001 -5.6224800e-005 2 -8.6566704e+001 7.5931473e-005 m1y.ras 0.056700 0.018900 164 274 2 4.2102798e+001 -1.6867440e-004 2 -8.6566704e+001 2.2779442e-004 m1z.ras 100.000 0.056700 54 91 2 4.2102798e+001 -5.0602320e-004 2 -8.6566704e+001 6.8338325e-004 end_image end_collage Notice the third and fourth lines of the .COL file. You must have 'grey.lut' and 'grey.asn' in your directory. 'grey.lut' is an ASCII grey-scale look-up-table. It is set up as folows: 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 . . . . . . . . . . . . 253 253 253 253 254 254 254 254 255 255 255 255 The first column is the color number, the second column is red, the next is green, and the last is blue color. By making all the red, green and blue values the same, you create 255 shades of gray. The ASCII 'grey.asn' file re-assigns the 255 shades of gray to 240 shades. This reserves 16 colors which can be plotted as overlay colors (since Super VGA can only display 255 colors at a time). The following is part of 'grey.asn': 0 0 1 4 2 8 3 11 4 15 5 19 6 23 . . . . . . 252 236 253 237 254 238 255 239 Notice the differences from the sample .COL file in 'Anatome of a .COL File', and the 'm1.col' file listed above. In a text editor, add the following lines to the .COL file made by MAKECOL and rename the file, do not keep the same file name as it may get over-written in following steps. p 2.800 46.0 -83.86 10.0 begin_color black = 0 0 0 d_grey = 46 46 46 l_grey = 128 128 128 white = 255 255 255 buff = 105 90 75 l_buff = 130 111 93 brown = 96 28 14 red = 255 0 0 orange = 255 128 0 yellow = 160 160 0 green = 0 200 0 blue = 0 0 200 d_blue = 0 20 60 cyan = 0 255 255 m_cyan = 0 120 120 d_cyan = 0 60 60 end_color menu_background = d_grey text = l_grey highlight = white background = buff graticule = l_buff lat/lon = d_grey black = black Note: the first line will be different for your image. '2.800 46.0 -83.86' is the center pixel size (in km), and the latitude and longitude for the center pixel of the image. Your image will undoubtedly have different values for these variables. To find what these values are, the easiest method is to create a .MAP file which does not contain the 'begin_image' and 'begin_collage' sections of the .COL file. Initially, put in general numbers for the first line variables. For the 'm1.map' example, the "rough estimate" values for the first line may be: p 10.0 45.0 -84.0 10.0 Then run MAPPER on the new .MAP file. While in MAPPER, move the highlight bar over the 'zoom' function and hit the left mouse button. Zoom into the area where your image should be by making the zoom box smaller or larger as necessary. Before hitting 'exit & plot', move the highlight bar over to 'status'. In the lower left corner of the screen, you will see the center pixel size, latitude and longitude (note, the size may be given in meters, the .MAP and .COL file require kilometers). Write these values down on a piece of paper and exit MAPPER. In a text editor, change the first line of the .MAP and .COL files with the values given by MAPPER. For more information on MAPPER, see the documentation for that program. If you have vector overlays for the image, such as bathymetry or geology, add these files to your .COL file following the format given in the sample above. After the 'end_collage' statement, a list of vector names must be given along with group names. For example: end_collage bathy = 2 OFF mbathy 100.0 0.25 D_CYAN bathycli .25 0.0 YELLOW detail_geo = 3 OFF m1 100.0 0.0 GREEN m2 100.0 0.0 GREEN m3 100.0 0.0 GREEN end_vector Where 'bathy' is the group name with 2 vector files, 'mbathy' and 'bathycli', belonging to that group. The 'OFF' tells COLLAGE not to plot that linework until the user tells it to while running the program. The '100.0 0.25' is the pixel range, in kilometers, that the 'mbathy' vector file will plot. And the 'D_CYAN' is the color, from the 'begin_color' section of the .COL file, that the lines within the file 'mbathy' will plot. You can have up to 25 groups and up to 25 vectors within a group in a .COL and .MAP file. For more information on creating linework, and porting linework into the GIV format, see the MAPPER and IMVIS documents. For ArcInfo files, it is easiest to create ASCII ungenerate file (usually longitude/latitude files) and then running Russ's program UN2RAW on that file. This will create an ASCII .RAW vector file which can then be run through REORDER to create the binary .BIN, .HDR, and .ATR files. It is these last three files that both COLLAGE and MAPPER require. Program COLLAGE You are now ready to take a look at your image and vector overlays with COLLAGE. After you type 'collage' at the DOS prompt, you will see a list of all .COL files in the upper right corner of the screen. Make sure that COLLAGE and the data files are path linked. Move the highlight bar over the full .COL file you just created (the one containing the 'begin_color' and menu sections) and hit . Note: COLLAGE is not mouse driven. You will see the image plot after the graticule has plotted. It is helpful to determine if the image registration is correct by plotting the vector linework on top of the image. If everything matches up correctly, then you can go on to adding more images in the same manner as before. That is, 1. create a .LBL file for the next full resolution image and look at it with IMVIS 2. run SAMPLE on the next image to create the sub-sampled images 3. make an .MCL file for the next image and run MAKECOL. 4. move everything in the individual image .COL file after the last line of '-----' but before the 'end_image' statement into the combined image .COL file. The combined .COL file is the one to which you added the 'begin_color' section etc. If the image and linework are not properly registered, read the next sections. Program REGG If the image and the linework do not match, the next step is to perform a regression analysis on the data. First, find the latitude and longitude of a number of distinctive points on the linework. Usually, the best points to use are corners and edges of features. To determine the latitude and longitude, run MAPPER. After the linework has plotted, move the highlight bar to 'analyze' and then to 'locate'. Move the cursor over a corner or some other obvious feature and hit the left mouse button. The latitude and longitude will appear in the lower left of the screen. Write these values down on a piece of paper. Try to have as many points as possible. Nine is a good number. Next, find the image x/y for the same points you found the latitude and longitude from the linework. To do this, run IMVIS and select the full resolution image. Move the bar to 'analyze' and down to 'pixel info'. A cursor appears on the screen which can be moved with the keyboard arrow keys. Move the cursor to the first point for which you have a latitude and longitude and hit . In the lower left corner you will see two sets of x/y. The top set is the screen coordinates, which you do not want, the bottom set is the image coordinates, which you do want. Write down the image x/y on a piece of paper. After you have accumulated the point information, go into a text editor and create a .REG file (short for REGression). The following is the format of the file: lat lon x y * lat lon x y lat lon x y lat lon x y lat lon x y The program REGG requires a .REG file like the one above. (REGG takes a number of different .REG files containing all types of data, but the above is the format we need for out task.) The first four lines are the column identifiers and the '*' separates this section from the data section. For the above 'm1.ras' example, the following is the information collected and the resulting 'm1.reg' file created: lat lon x y * 42.10040 -86.55814 665 211 42.10009 -86.55987 446 265 42.09852 -86.56079 326 532 42.09506 -86.56005 429 1122 42.09350 -86.56133 270 1384 42.08471 -86.50802 6996 2838 42.08383 -86.50726 7092 2991 42.08216 -86.50779 7028 3275 42.07860 -86.51065 6674 3874 42.07923 -86.51597 6003 3765 The next step is to run program REGG. This program is a complex statistical package and many of it's functions are beyond the scope of this document. For the time, we are only concerned about doing a 'multiple regression'. To run REGG, use the following command line: prompt>regg filename for example: prompt>regg m1 REGG creates the file 'filename.out' where filename is the same as the .REG file. The following is 'm1.out'. How it was created is explained below. input file --> m1 1 -- lat < These lines are a re-iteration > 2 -- lon < of the column descriptors as > 3 -- x < given in 'm1.reg' > 4 -- y No problems found in data file there are 10 rows and 4 columns in file !**** column name maximum minimum range ---------------- -------- --------- -------------- lat 42.100 42.079 0.022 [1] lon -86.507 -86.561 0.054 [2] x 7092.000 270.000 6822.000 [3] y 3874.000 211.000 3663.000 [4] !**** Y -- lat: column#1 < These next three lines recap the> < you chose while running REGG. > < Description of how and why to > X 1 -- y: column#4 < select these options follows. > X 2 -- x: column#3 Correlation coefficients < What follows is the statistical > < analysis of the data. > Y X[ 1] X[ 2] Y 1.00 -1.00 -0.93 X[ 1] -1.00 1.00 0.93 X[ 2] -0.93 0.93 1.00 there are 10 rows and 4 columns in file !!!!! WARNING -- HIGH AUTOCORRELATION !!!!! s.d. mean ------- -------------- -------------- Y 0.0083 42.0896 X[ 1] 1394.5091 2025.7000 X[ 2] 3180.0409 3592.9000 number of data points used N = 10 mean error = 0.000000 root mean square error = 0.000018 explained variance r**2 = 0.999995 adjusted = 0.999994 correlation coefficient r = 0.999998 adjusted = 0.999997 Regression Coefficients < the numbers of interest are the > < beta coefficients > Beta Coefficient error t-value B[ 0] = 42.10168 0.00001 3958099.18244 B[ 1] =-5.9127e-006 -0.99104 0.00000 -543.61470 y B[ 2] =-2.5288e-008 -0.00967 0.00000 -5.30181 x < What follows is the same as above, but this is for longitude,> < not latitude. > !**** column name maximum minimum range ---------------- -------- --------- -------------- lat 42.100 42.079 0.022 [1] lon -86.507 -86.561 0.054 [2] x 7092.000 270.000 6822.000 [3] y 3874.000 211.000 3663.000 [4] !**** Y -- lon: column#2 X 1 -- x: column#3 X 2 -- y: column#4 Correlation coefficients Y X[ 1] X[ 2] Y 1.00 1.00 0.93 X[ 1] 1.00 1.00 0.93 X[ 2] 0.93 0.93 1.00 there are 10 rows and 4 columns in file !!!!! WARNING -- HIGH AUTOCORRELATION !!!!! s.d. mean ------- -------------- -------------- Y 0.0252 -86.5350 X[ 1] 3180.0409 3592.9000 X[ 2] 1394.5091 2025.7000 number of data points used N = 10 mean error = -0.000000 root mean square error = 0.000015 explained variance r**2 = 1.000000 adjusted = 1.000000 correlation coefficient r = 1.000000 adjusted = 1.000000 Regression Coefficients Beta Coefficient error t-value B[ 0] = -86.56338 0.00001 -9588089.40817 B[ 1] = 7.9397e-006 1.00331 0.00000 1961.26179 x B[ 2] =-6.4521e-008 -0.00358 0.00000 -6.98902 y The above file 'm1.out' summarizes the information you selected while running REGG. The first section deals with the latitude regression fit. Recall the following equation for latitude: lat = a0 + a1*y + a2*y*y + a3*x + a4*x*x + a5*x*y For the first time through the regression analysis, try a linear fit using the following changes to the above equation: lat = a0 + a1*y + 0*y*y + a3*x + 0*x*x + 0*x*y After you have chosen option 1 'multiple regression' you see the following and are asked to give your choice for 'y': 1 -- []lat 2 -- []lon 3 -- []x 4 -- []y For latitude, y = lat; enter the number 1. You then see the same list and asked to enter the choice for x[1] (which is a1 in the above equation). Since latitude varies most with 'y', the enter the number 4 which is 'y'. Then you are asked if there are any powers. Since we are first doing a linear fit, the answer is 'no' (do NOT hit after hitting 'n'). Had we been doing a polynomial fit, you would have answered 'y' and then entered the power to raise that variable. Next, you are asked if there are more variables. Since you still need to enter the a3 coefficient, hit 'y' (again., do NOT hit ). You are then asked to enter x[2] which is now a3 in the above equation since a2 = 0. Enter number 3 which is 'x'. Again, you do not want to raise 'x' to a power so type 'n'. You also do not wish any more variables (since x*x and x*y are both zero). Next, you will see the variables you chose along with the question "is this what you want?' If it is, type 'y', or else type 'n' and redo the above process. After you type 'y' a lot of statistical information scrolls on the screen. All this information is placed into the .OUT file. What is of interest to us are the 'Beta Coefficients' which are a0, a1, and a3. These are the numbers that you put into your .MCL file. Either you can write the numbers down now, or take them from the .OUT file. From 'm1.out' above, the latitude coefficients are: a0 = 42.10168 a1 = -5.9127e-006 a2 = 0 a3 = -2.25288e-008 a4 = 0 a5 = 0 The longitude coefficients are fount much the same way as the latitude coefficients. Recall the equation for longitude: lon = b0 + b1*x + b2*x*x + b3*y + b4*y*y + b5*x*y For the linear regression, the equation is changed to: lon = b0 + b1*x + 0*x*x + b3*y + 0*y*y + 0*x*y After choosing 'multiple regression' you see the following list along with the prompt 'give your choice for y': 1 -- []lat 2 -- []lon 3 -- []x 4 -- []y Now, 'y' is longitude, so type number 2. The next prompt asks for x[1] which is now b1 for longitude. Type number 3 since longitude varies most with 'x'. Again, do not raise this to a power. y[1] is b3 in our longitude equation, so type the number 4. There are no powers, and no more variables. After the statistical information scrolls, you see another list of 'beta coefficients' which you will need to put into the .MCL file. From the 'm1.out' example, the longitude coefficients are: b0 = -86.56338 b1 = 7.79397e-006 b2 = 0 b3 = -6.4521e-008 b4 = 0 b5 = 0 A quick summary of the steps: 1 -- []lat 2 -- []lon 3 -- []x 4 -- []y latitude longitude y = []lat number 1 y = []lon number 2 x[1] = []y number 4 x[1] = []x number 3 no powers no powers more variables more variables x[2] = []x number 3 x[2] = []y number 4 no powers no powers Now, after you have collected the beta coefficients, you have to re-create the .MCL file. The reason why you went through the regression analysis routine is because the image did not look right in COLLAGE. That was because the information in the image .MCL file (originally the latitude and longitude of the upper left corner of the image and dlat/dy and dlon/dx) was not accurate. The beta coefficients from REGG are more accurate and should help the image plot better. Once again, going back to the 'm1' example, the 'm1.mcl' file is changed to the following after REGG has been run: m1.ras 0.0007 4450 7408 4 42.10168 -5.9127e-006 0 -2.5288e-008 4 -86.56338 7.9397e-006 0 -6.4251e-008 After the .MCL file has been changed, the next step is to run MAKECOL on it. This is done in the same manner as described in the 'Program MAKECOL' section of this text. Remember to change the total image .COL file to include the new image information given by MAKECOL. The sample .COL given in the section 'Anatomy of a .COL file' is our example 'm1' file after the regression analysis was run on the data. Run COLLAGE again. The image and the linework should look better if all goes well. If not, you may want to try a polynomial fit in REGG which simply means: 1. creating a new column which would be x*y (REGG steps you through this step) 2. answering 'y' to the powers question, and raising x[1] and y[1] to the power of 2 3. making x[5] the 5th column which is x*y And then running through the re-creation of the .MCL file etc. This may seem like a lot of work, but images often require extra fiddling with them to get them to look just right. A common error with all this number crunching is to have typed the numbers incorrectly, make sure you have entered everything correctly. COLLAGE Functions This section of the document describes COLLAGE from the user's point of view. There are a number of functions COLLAGE performs. The following is the main menu seen in the upper right portion of the screen after the image and linework are finished drawing: Zoom Overlays ON/OFF Reset Change Projection Save Collage Recall Collage Pixel Information Vector Plot Annotate Draw Lines Exit 1. Zoom --------- After hitting on this function, a white box, 1/4th the screen size, appears in the middle of the screen. This box is moved with the keyboard arrow keys and the following commands: s = makes the box smaller l = makes the box larger + = makes the box move faster, also makes the size increments larger - = makes the box move slower, also makes the size increments smaller When you have the zoom box positioned over the area you chose, hit . The image and linework will be redrawn. Usually a greater resolution of the image will be drawn. 2. Overlays ON/OFF ------------------- The groups found within the .COL file 'begin_vector' section will appear along with ON or OFF next to the name. You are able to toggle the ON or OFF of these groups to tell COLLAGE whether to plot those lines the first time through, or whether the lines have to be called by the user in order to plot. 3. Reset --------- This resets and redraws the screen erasing any changes that might have been made to the original image by the 'annotate', 'draw lines', or 'plot vectors' functions. 4. Change Projection --------------------- COLLAGE can plot the linework and the image in a number of projections. The available options are: l = Lambert a = Albers m = Mercator s = Polar stereographic p = plate carre S = sinusoidal 5. Save Collage ---------------- Usually, the images take quite a long time to plot due to the mathematics COLLAGE performs on the image. Therefore, it is a good idea to plot the image and linework, then save the information as a screen save. The screen save files from COLLAGE are .XCL (X for eXtended VGA, V for VGA, E for EGA etc.) and plot in a matter of seconds. COLLAGE saves the files as 'colage00.XCL', 'colage01.XCL' etc. These can be renamed in DOS to more meaningful names. The next time you enter COLLAGE, you will first see a listing of all .XCL files, by hitting you will see a list of all .COL files. If you continue to hit you will return to DOS. 6. Recall Collage ------------------ This allows you to access the list of all .XCL files and to view them while running COLLAGE 7. Pixel Information --------------------- A cursor will appear on the screen. It is moved with the arrow keys, and '+' makes it move faster while '-' makes it move slower. In the lower left hand corner of the screen you will see the latitude and longitude of the cursor, along with the image 'dn' value. returns you to the main menu. 8. Vector Plot --------------- A list of all the groups of vectors as defined in the .COL file is listed. Move the highlight bar over the vector group you wish to plot and hit . You will see the lines appear on the screen. Once the lines have drawn, they cannot be undrawn. In order to 'erase' the lines, you have to either recall the .XCL file or redraw the collage from the .COL file. 9. Annotate ------------ This allows you to add text to the collage before saving it as an .XCL file. After hitting 'annotate', you can begin entering text in the lower left corner of the screen. The up and down arrow keys changes the color of the text, and the left and right arrow keys changes the size of the text. After you have entered in the line, hit . You will see a rectangle the size of the string of text appear. This rectangle can be moved anywhere on the screen by the arrow keys. Hit when you have the rectangle positioned correctly. returns you to the main menu. 10. Draw Lines --------------- This is similar to 'annotate' in that it allows you to draw lines on the screen, linking text to the feature it is describing, for example. A cursor will appear on the screen. Move the cursor to the position of the beginning of the line and hit enter. Then move the cursor to the end of the line (or a mid point if the line is to contain a bend) and hit enter. When you are through, hit to return to the main menu. 11. Exit --------- This returns you to the DOS prompt.