|
Image Processing Procedures Note: These procedures are for use with NIH Image on Macintosh computers. If you are unfamiliar with NIH Image, you may wish to try the image processing training activities, "Strangers in Paradise," "Mars Landing," or "Weather or Not," listed on the main ETE Module page. If you do not have a Macintosh computer, see your teacher for some alternate images to work with. Stack & Animate Load images Brazil 1-2 and Brazil 2-2 from your hard drive into NIH Image. Select Stacks/Windows to Stack. The images will become a "stack" that you can manipulate. Select Stacks/Animate and the computer quickly cycles through the two images so you can compare them easily. Control the speed using the number keys at the top or to the right of your keyboard: 1 is slow, 10 is fast. Or, use the < and > keys to flip back and forth at your own speed. The latter technique is perhaps the best way to study detailed differences in small areas. Image Arithmetic A very different way of seeing the changes is to create a new image by dividing or subtracting the two images. Load Brazil 1-2 and Brazil 2-2, select Process/Image Math... and release. A dialog box will appear showing your options. The default option is to subtract the first image loaded from the second image loaded, multiply the result by 0.5 and add 128 to get an image named "Result." Just click OK and see what you get. If you look carefully, you will see the lighter areas in the first image in one shade of gray, and the lighter areas in the second image in another shade. By using this technique, you can show the "before" and "after" at the same time. Try a few color lookup tables to see if you can bring out the differences even more strongly. If you wish, you can reselect Process/Image Math and change the variables in the dialog box using the pull-down menus. Just name the output image something different so it doesn't overwrite your first image. (As it happens, the default settings are about as good as you can get for this particular pair of images.) Now, try stacking and animating all three images to see just how features in the two original images are treated in the composite. Creating Color Composites Color composites in NIH Image are made by combining three 8-bit brightness or gray-scale images into a single image. Just as your eye combines brightness images from the red-, green-, and blue-sensitive cones in your retina, your computer monitor makes color images by combining one brightness image colored red (called the red "slice") with a second brightness image colored green (the green "slice") and a third brightness image colored blue (the blue "slice"). You can put any three brightness images into the red, green and blue "slices" and let NIH Image combine them into a single color image. Of course, to get a good color image of a particular area or scene, all three gray-scale images need to be the same size, show the same area or scene, be co-registered (matched pixel to pixel so that they overlay one another properly), and each needs to be originally recorded in a different color or "band." (You can put the same image in all three color slices, but you will only get a gray-scale image as a result.) To create a color composite open the image you want for the red slice, then open the image to go in the green slice, and finally open the image to go in the blue slice. (Note: you can choose to open the images in any order you want, but NIH Image will consider the first as the red slice, the second as the green, and the third as the blue.) Select Stacks/Windows to Stack, and then Stacks/RGB to 8-bit color. A dialog box will appear. For the Brazil images, choose the Custom palette, put an "X" in the Dither box (if there isn't one there already), and click OK. The color image will appear as a new window in a few seconds. (You can experiment with different choices in the Dialog box and see what you get.) If you wish to enhance the color image, save or close the color image and select Stacks/Stack to Windows. This will separate the three slices so you can work on them individually. Use the Windows menu to select the image you wish to work on. NIH Image will keep track of which image belongs in which color slice. To make an image like "Rainforest 4-5-7," load Bands 7, 5, and then 4. Stretch each image individually until the agricultural areas are nearly all white and the rainforest shows the greatest detail. Then select Process/Apply LUT. After you have stretched each image, restack and reconvert to 8-bit color. Sizing Images to a Specific Scale To compare or overlay images of different scales, choose which image you wish to scale the other images to. Then determine the scale factor by which the other images need to be multiplied to make them the right size. For example, assume you have a map image 400 pixels wide and that the width of the map area on the ground is 200 kilometers. Now assume that the image you want to paste or overlay is also 400 pixels wide, but that this width on the ground is only 100 kilometers. Thus the 100 kilometer width of the image will only be 200 pixels wide in the map. So you need to shrink the image from 400 pixels to 200 pixels, or scale by a factor of 0.5. To do this, select the image (click on it), and select Edit/Scale and Rotate.... A dialog box will appear. For this example, you would type 0.5 into the Horizontal Scale box (0.5 will automatically appear in the Vertical Scale box), choose Nearest Neighbor as the Interpolation Method, put an "X" in the New Window box, and click OK. A new image window will appear with the properly scaled (in this case, shrunken) image. Since the linear scales in both the map and the new (shrunken) image are the same, the two may now be compared or combined by cutting and pasting. (You might want to try some of the other options in the "Scale and Rotate" dialog box to see what you get. By typing in different ratios for the vertical and horizontal scales, and different numbers for the Angle, you can distort the original image in an almost infinite number of ways.) Cut and Paste To combine or overlay images, use the cut and paste commands. Select the image you wish to paste or overlay by clicking on it. Use a selection tool (square, oval, polygon or free-hand) to select the area you wish to transfer. (Double clicking on the square selection tool will select the whole image.) Select Edit/Copy Selection. Your selection, whether it is all or part of the image, will be copied to an internal memory file called the clip board. (Note: the Edit/Copy command will leave your original image untouched; the Edit/Cut command will remove the selected piece and leave a blank space.) Now click on, or use the Window menu to select, the "target" image you wish to transfer the copied (cut) piece onto. (Note: if the target image is anything but a new or blank image file, you ought to save a copy of it somewhere.) Now select Edit/Paste. A copy of the selected piece will appear in the target image. You can click on the selected piece to move it around for placement as long as you do not click on the map outside of the overlay or select another tool. When you have the pasted piece where you want it, click outside of the piece or select another tool to "fix" the pasted piece. It is now a permanent part of the image. If you made a mistake or don't want the pasted piece, select Edit/Undo Paste before you fix the pasted piece. If you have inadvertently already fixed the piece you want to get rid of, the only thing you can do is select File/Revert to Saved to bring back the original image. There are several different ways to combine a selected piece with a target image. Once you have pasted the selected piece but before you have fixed it, select Windows/Show Paste Control. A small dialog box will appear with the paste options. The options can be found in a small pull-down menu on the left side of the dialog box. The default Copy transfer mode simply replaces the pixel values in the target map by the pixel values of the selected piece. The other Transfer Mode options allow different types of "transparent" pastes, where the original image may be seen in different forms under the selected piece. To see the effect of the different paste modes, simply select a mode and release; the selected piece will change in appearance. You can change the transfer mode as many times as you like as long as you haven't fixed the selected piece. The mode you select will depend on the type of images being combined and the "look" you want for the final combined image. Creating a Map Overlay First, open the image file you want to paste and the map file you want to paste onto. Use the dimensions of the map and the image to find the shrink- or enlarge-factor to make the image the same scale as the map. Select the image. Select Edit/Invert and use the brightness and contrast buttons on the Map box at lower left to make the rainforest nearly all white and the agricultural areas nearly all black. Double-click on the square selection tool to select the whole image. Select Edit/Scale and Rotate and enter the appropriate shrink (enlarge) factor and click OK. A shrunk (enlarged) copy of the image will appear as the active window. Select Process/Apply LUT to fix the pixel values in the scaled copy and double click on the square selection tool to select the whole copy. Select Edit/Copy Selection to copy the shrunk (enlarged) image. Now select the map by clicking on it or by using the Window menu. Select Edit/Paste to paste the shrunk (enlarged) copy onto the map and use the Paste Control to choose a transfer mode ("or" is a good one). Move the pasted copy to an appropriate location on the map and click outside it to "fix" it. Now you can close the original and intermediate images. Remember: Never Save Changes when closing a saved image, or you will ruin your saved image! To save a stack, composite, or overlay that you have created, select Save As and give it a new name. Measuring with Density Slice Open the image file on which you wish to make your measurements. Set scale for the image and select Area and Include Interior Holes in the dialog box under Analyze/Options. Select Options/Density Slice, and a red band will appear in the LUT and some pixels in your image will also turn red. Use the LUT tool (horizontal bar with vertical arrow through it) to move the red bar to highlight the areas you wish to measure. Click-and-drag the LUT tool on either the upper or lower boundary of the red bar in the LUT to move the boundary; click-and-drag on the center of the bar to move the whole bar. As you move a boundary or the whole bar, pixels in the image with the same DN values as those colored red in the LUT will also be colored red. The red pixels are the selected ones. Measure the area of the red pixels by outlining any area in the image using a selection tool. Now select Analyze/Measure and Analyze/Show Results to get the area of the red pixels (only) in the units you selected under Analyze/Options. (The area of the red pixels should be less than the area of the selection square unless your selected area is solid red. You might want to try highlighting different groups of pixels in red or selecting different areas of the image and then measuring the highlighted area to get a feel for how this procedure works. Once you have learned the procedure for this image, it will work for any image.) For the Rainforest activity, the square selection tool is convenient. Since you want to measure the agricultural areas in two different images, you ought to write down the X,Y position of the start of your square and watch the width and height of your square in the Info box at lower left to make sure that you (1) start in the same place in both images, (2) make the same size selection square in both images, and (3) use the dimensions of the square to calculate its area.
[ Amazon Rain Forest: View from Space ] [
Seeing Environmental Change ] [ Home ] [ Teacher Pages ] [ Modules & Activities ] |
Page created by Chris Kreger
Maintained by ETE Team
Last updated November 10, 2004
Some images © 2004 www.clipart.com
Privacy Statement and Copyright © 1997-2004 by Wheeling Jesuit University/NASA-supported Classroom of the Future. All rights reserved.
Center for Educational Technologies, Circuit Board/Apple graphic logo, and COTF Classroom of the Future logo are registered trademarks of Wheeling Jesuit University.