Earth Analysis Techniques > Eyes on Satellite Data > Course Materials > Week 2 > Getting to Know Measuring in ImageJ

Week 2: Analyzing Change Over Time

top of page

Getting to Know Measuring in ImageJ

Small Color Landsat Photo of Lake Mead May 2004 with scale bar

In the Intro to ImageJ section, you learned that a digital image is a string of numbers, displayed in a rectangular array, according to a lookup table. You also learned about the three dimensions of an image width, height, and bit depth. The power of image processing is its ability to make measurements in these dimensions:


Spatial measurements Measurements of distance, area, and volume. These involve the first two dimensions of the image, its width and height.


Density measurements Measurements involving the third dimension, the pixel values. Pixel values can represent temperature, elevation, salinity, population density, or virtually any phenomenon you can quantify.


Before you can make meaningful measurements, you need to calibrate the image that is, "tell" the software what a pixel represents in real-world terms of size or distance (spatial calibration), in terms of what the pixel values mean (density calibration), or both. In this section, you will learn how to spatially calibrate digital images.

This image is a Landsat view of Lake Mead, Nevada, taken in May 2004.

Spatially calibrating an image is commonly called setting the scale, and an image that has a scale set so that distances and areas are in units other than pixels is called a spatially calibrated image.

top of page

Select What You Want to Measure

ImageJ can collect a number of measurements for you. Before you begin setting a scale and making measurements you need to decide on your measurement options.

  1. Choose Analyze > Set Measurements....
  2. The Set Measurements window opens. Check Area and Perimeter (length) to collect those measurements. Then click OK.

    Analyse set measurements lgr

top of page

Find the Image Scale

If you measure distances or areas on a digital image, your results will be expressed in pixels and square pixels. ("Wait," you say, "Aren't all pixels square?" Actually, no. But that's a topic for another time...) If you want to measure image features in units like meters or square miles, you need to convert pixels to their equivalent "real world" units. You could do this yourself with a calculator, or you could have ImageJ do the work for you. ("Yesssssss!") Giving ImageJ the information it needs to convert from pixels to other units is called setting the scale.

To set the scale in ImageJ, you need to know what the scale is. Here are some ways you can find the scale of an image:

top of page

Set a Scale Using an Existing Scale Bar

Someone was kind enough to put a scale bar on this Lake Mead image, so we'll use it to set the scale.

Small Color Landsat Photo of Lake Mead May 2004 with scale bar
  1. Use the straight line selection tool Straight line selection tool to drag out a line across the scale bar. Select Analyze > Set Scale... The Set Scale window opens. The distance you measured in pixels will be displayed. Enter 45 for the Known Distance and km or kilometers for the Unit of Length. To redo your line, click on the arrow tool, then re-click on the line selection tool. This effectively resets the tool.
    • Using the straight line selection tool Straight line selection tool , click on one end of the scale bar, drag to the other end of the scale bar, and click again. (Tip: If you hold down the shift key while selecting with this tool, it forces your selection to be perfectly horizontal.)

      straight line selection cropped
    • Choose Analyze > Set Scale....

      analyse set scale drop down
    • The Set Scale window opens. The distance you measured in pixels will be displayed. In this case, we got 261 pixels. Your mileage, er pixelage will vary, but it should be close to this. Enter 45 for the Known Distance and km or kilometers for the Unit of Length. For reference, the scale (in this case, 5.8 pixels per kilometer) is displayed at the bottom of the window. Then click OK.

      set scale drop down
  2. To check the scale you set, use the straight line selection tool Straight line selection tool to drag out a line across the scale bar again. Choose Analyze > Measure. You should get something very close to 45 km in the Results window. If you don't, reset the scale.
    • Using the straight line selection tool Straight line selection tool , click on one end of the scale bar, drag to the other end of the scale bar, and click again. (Tip: If you hold down the shift key while selecting with this tool, it forces your selection to be perfectly horizontal or vertical.)

      straight line selection cropped
    • Choose Analyze > Measure.

      analyse measure drop down
    • The Results window opens. You should get something very close to 45 km. If you don't, reset the scale.

      results in km

    Movie Icon
    loading the player

  3. Measure the distance between two small islands in Lake Mead.
  4. These little islands.
    measure btw islands

    The distance between the islands is approximately 25.46 kilometers. Your distance may be slightly different, depending on exactly how you set the scale and where you clicked on the islands. If necessary, use the zoom and pan tools to get closer to the islands.

    Movie Icon
    loading the player

  5. Practice measuring distances and areas using the different selection tools on the ImageJ toolbar. The small red triangles on some of the tool buttons indicate that additional selection tools are available. Right-click (Win) or control-click (Mac) these buttons to access these "hidden" tools.
  6. freehand tool measure around lake
    The Freehand line tool allows you to trace along the shoreline of the lake.
  7. Close the lake_mead_2004_color.jpg image when you are finished.
top of page

Set a Scale Using a Known Distance

Some images don't have scale bars. However, if you know the distance between two landmarks that are easily visible in both images, then you can use that distance to set a scale. Good landmarks are clear, relatively small, as far apart as possible, and obvious. You can use any landmarks you want, but since we already know the distance, we'll use the two small islands we measured in the previous section.

  1. Download the image below by right-clicking (Win) or control-clicking (Mac) the link and saving the linked file to your Week 2 directory or folder.
    lake_mead_2004.tif (TIFF 2.9MB Jan27 10)
  2. Choose File > Open, navigate to your Week 2 folder, and open the lake_mead_2004.tif image.
    This satellite image is a larger version of the one you just worked with. It has a higher resolution which means that it contains more pixels, allowing us to see greater detail.
  3. Use the Straight Line selection tool Straight line selection tool to select the distance from one small island to the other.
  4. Choose Analyze > Set Scale....
  5. Enter 25.4 for the Known Distance and km for the Unit of Length. Compare the scale, in pixels per kilometer, to the scale of the smaller image.
  6. This image has nearly twice the number of pixels per kilometer (11.625), making it a higher (2X) resolution image.

    set scale 2004 tif image
  7. Now that you have a scale set on this image, zoom in to one of the small islands and measure across it. Being able to make this measurement demonstrates the value of high resolution images.
  8. Close the lake_mead_2004.tif image.
top of page

Set a Scale Using Image Resolution


Often you will have to learn more about an image so you can set the scale by directly entering the image resolution. You might find the resolution in a ReadMe file or in the image metadata. (Metadata is loosely defined as the data about the data). The resolution might be right there in the name of the file, or you might even get the resolution in a phone call to the person who provided the image to you. (As a last resort, of course!)

  1. Click the thumbnail image to the right to open the full size version of the lake_mead_250m.jpg image in a new window. Then right right-click (Win) or control-click (Mac) the full size image and choose File > Save Image As... and save it to your Week 2 directory or folder. Close the image window after you have downloaded its file.
    lake MEAD 250m
  2. Choose File > Open, navigate to your Week 2 folder, and open the lake_mead_250m.jpg image.
  3. Choose Analyze > Set Scale.... Enter the known resolution. In this case, the resolution is in the name of the image file 250m per pixel. Set the scale to 1 pixel equals 250 meters. Enter 1.0 for the Distance in pixels, 250 for the Known Distance, and meters for the Unit of Length. The reported scale is 0.004 pixels per meter, which is the same as 4 pixels per kilometer.
  4. Next, measure the distance between the same two islands. Compare your result with the result from the first image, the one with a scale bar.
  5. Your results should be about the same as the earlier measurements, 25400 m (25.4 km). However, since the resolution of this image is lower than the previous image, it's hard to tell exactly where the small islands are.
  6. measure on 250m image

    Your result should be about the same as the earlier measurements. However, since this image does not have the same resolution as the previous ones, it's hard to tell exactly where the small islands are.


top of page

Add a Scale Bar

With the scale set, ImageJ can now print a scale bar on the images for you.

  1. Choose Analyze > Tools > Scale Bar... and enter the settings for your scale bar. The scale bar on the image updates automatically to show you the results of your changes.
  2. This would be an appropriate scale bar for the image you just measured.
    25000 m scale bar

    loading the player

  3. Choose File > Save As and save the file, with scale set and scale bars added, to your Week 2 folder, in TIFF format. This is important because other image formats do not store the scale information with the image. Remember the name of the file - you will need to open it in the next activity.
TIFF (Tagged Image File Format) is the only file format used by ImageJ that supports spatially calibrated images. In other words, if an image is spatially calibrated, the TIFF format saves the scale with the image so the image is already calibrated any time you open it. (JPG, GIF, PNG, and other formats you are familiar with don't save this information in the file.)

What are the tags in a Tagged Image File anyway?

The tags are information fields in the file, in addition to the image data itself, that are used to store the image dimensions, bit depth, calibration information, lookup table, copyright information, latitude and longitude, etc. This makes TIFF a very flexible format, and one of the safest for preserving the full content of scientific images.


top of page

Explore Image Scale and Measurement

Visit one or more of the Image Data sources listed below and look for an interesting image - particularly one that might fit into your curriculum. Look for an image that has a scale bar printed on it, a feature or landmarks of known distance, or descriptive information that tells you the scale or size of the image. Download the image to your Week 2 folder and use the techniques you learned here to set a scale for the image. If the image does not already have a scale bar, add one. Save your image with your scale bar added, if it did not originally have one, to your Week 2 folder.

Gateway to Astronaut Photography
The Landsat Image Gallery
MODIS Image Gallery
ASTER Web Gallery (read descriptions for width and height of image in km)
NASA Earth Observatory Image of the Day Collection (scale bars are on the preview images only - not full resolution)
NASA Earth Observations (NEO)
Image pairs from Earth Obervatory
Earth Observatory: World of Change
EarthKam Images for Investigation

Post the image you chose with a scale bar added, if it did not already have one to your discussion group in JPEG format, with an explanation of why you chose the image and what you would have your students do with it or how you would use it in your classroom.

Key point: If an image has not been spatially calibrated, as long as you know the spatial resolution or the distance between two landmarks on the image, you can set a scale.

top of page

Resources

top of page

Movies on This Page

How to download movies

  1. Click the link to go to the SERC media library listing for the movie. The record will open in a new window.
  2. On the SERC media library page, right-click (Win) or control-click (Mac) the link (below the movie on the Flash version pages) to download the movie file to your hard drive.
  3. Look below the movie window for the file download link.

    Save Movie from CMS listing

top of page

Flash video versions

Download this version to play on your computer. You'll need an appropriate movie player to view the file, such as Flash Player, Real Player (Mac / Win), or Adobe Media Player.

Movie Icon Set Scale Small

Movie Icon Measure Landmarks

top of page

iPod versions

Download this version to play on your iPod or iPhone.

Movie Icon Set Scale Small

Movie Icon Measure Landmarks


« Previous Page      Next Page »