Part 2: Scale and Crop Images3
Scaling and Cropping Images and Stacks
What if these images were too large to work with, either for you or for your students? What could you do? Two common solutions are scaling the images down and cropping them to a smaller size.
Scaling, Interpolation, and Spatial Calibration
Scaling is the process of making an image larger (scale > 1.0) or smaller (scale interpolation.
Without going into the detailed mathematics of the different interpolation methods, you do need to know that the Interpolation method (bilinear, bicubic, or none) is most important if you're scaling images up to a larger size (scale > 1), but usually won't make much difference when you're scaling down, especially at "even" scales like 25% or 50%. Bilinear interpolation is generally faster, while bicubic interpolation is more complex and takes a bit longer. This is not an issue with today's powerful computers.
To compare interpolation methods, you will crop out a small image of the crater, then scale it up by a factor of 10 using each method.
- Stack the seven Landsat band images. If necessary, set the spatial scale of the image to 30m/pixel.
- Activate the stack window, locate the crater, and zoom in until the crater fills most of the window.
- Use the rectangular selection tool to select a 60 x 60 pixel square centered on the crater. The selection size appears in the image status bar as you make the selection. Since the scale is set at 30m per pixel, 60 pixels equals 60 x 30 = 1800 meters. (Tip: To select a perfect square centered on the crater, hold down Command-Shift (Mac) or Control-Shift (PC), click at the center of the crater, and drag outward.)
- Create a new image of just the selected pixels by choosing Image > Duplicate. Since you're working on a stack, you have the option to duplicate the entire stack or just the current slice. Go ahead and duplicate the whole stack. You should now have a small window containing a 60 x 60 pixel stack.
- Activate the small stack window. Choose Image > Scale and scale the stack by a factor of 10 but without interpolation using the following settings:
- Activate the small stack again, choose Image > Scale and scale the stack by a factor of 10 using bilinear interpolation using the following settings:
- Activate the small stack again, choose Image > Scale and scale the stack by a factor of 10 using bilinear interpolation using the following settings:
- Compare the three scaled images. Which one looks like giant pixels? Which one looks smoothest?
- How did the spatial calibration (scale) handle the scaling process? Using any of the three 10x scaled images you made, measure the east-west distance across the crater. What diameter do you get, in meters? How does this compare to the original image?
- The moral of this story? When you scale images up or down in ImageJ, the spatial calibration is NOT preserved! However, as long as you know how you scaled the image, you can use that information to modify the spatial calibration. In this case, we scaled the image UP by a factor of 10. To get the new spatial calibration, divide the old spatial scale (30 meters/pixel) by the scaling factor you used (10.0). What is the new image scale?