Table of contents Previous: Image Command Examples - Interrogation Next: Graphics and the Cursor

5.1.3 Image Command Examples - Enhance/Colorize

Enhancements are used to improve image contrast and produce colored imagery. This allows you to emphasize the image features you are analyzing. For example, you can enhance thunderstorm cloud tops, low clouds, or fog.

The EB, EU and SU commands can be used to modify displays of imagery or create enhancement tables that can be used when displaying imagery. Additional information on enhancements can be found in the Enhancements section of the Unidata McIDAS Learning Guide.

Color Enhancements

A color enhancement is a table of colors that corresponds to brightness values. Color enhancements are useful for tracking cloud features. For example, to track the tops of thunderstorms overshooting the tropopause, you can color all brightness values between 180 and 250 red.
  1. Display a topography image in frame 1.

    This entry will load the global topography image into the current frame centered on intersection of the Equator and Prime Meridian, blown down by a factor of 7.

  2. List out the mappings of brightness to color for the displayed image.

    This entry will display the mapping for the current frame:

     Brightness  Blue      Green      Red
      min max   min max   min max   min max
      --- ---   --- ---   --- ---   --- ---
        0 255     0 255     0 255     0 255
    
    In this case, image value 0 is mapped to display value 0 0 0 (black) and image value 255 is mapped to display value 255 255 255 (white).

  3. Use the EU command to list all the enhancements available on your system.

    McIDAS enhancement tables are files with the suffix .ET.

  4. List out the mappings of brightness to color for the topography (TOPO) enhancement.

    Note that various levels of image brightnesses are mapped to various colors (combinations of RGB).

  5. Restore the TOPO enhancement to the image displayed in the current frame.

    This entry applies the mappings of brightness to color in the TOPO enhancement table to the current frame.

  6. Now load the image again, but use the EU keyword to load the enhancement automatically when the image is loaded.

    EU (Enhancement Utility) can also be used to create custom enhancements on the fly.

  7. Load in the latest GOES-East IR image centered over Birmingham, AL (KBHM) blown down by a factor of 2.

  8. Assign the color red to the brightness range 180 to 220 to color enhance the cloud tops.

  9. List the enhancement table. The brightness values between 180 and 220 are assigned to a red intensity range of 255 to 255.

           Brightness  Blue      Green      Red
            min max   min max   min max   min max
            --- ---   --- ---   --- ---   --- ---
              0 179     0 179     0 179     0 179
            180 220     0   0     0   0   255 255
            221 255   221 255   221 255   221 255
    
  10. Assign the brightness range 180 to 220 to the range of colors between yellow and red.

  11. Save the enhancements with the name STORM.

  12. List all the enhancements available on your system.

    Note that STORM.ET is now in the list.

  13. Restore the default enhancement to the frame.

  14. Restore the enhancement STORM to the frame.

  15. Delete the enhancement STORM.

Grayscale Enhancements

Normally, a pixel's digital value, stored in an area, correlates to a brightness value. Each brightness value appears as a different shade of gray when the image is displayed. When a grayscale enhancement is applied, the correlation between the digital values and the displayed grayshades changes. You can change the grayscale contrast of an image two ways: using image contrast stretching or using image data stretching.

Creating Image Contrast Stretching

Image contrast stretching changes the grayscale of the displayed image; it does not change the area data values. You can change the grayscale contrast of an image using the EB command. You can run the EB command two ways: using the command line and using the mouse. Using the command line, you specify the lower and upper brightness values to be enhanced. All pixels with brightness values below the lower input values and above the upper input value remain unchanged. The brightness values between the range are linearly interpolated. Using the mouse controlled version, you move the mouse to increase or decrease the brightness of the image. You can save grayscale enhancements and apply them to other images using the EU SAVE and EU REST commands.

  1. Display the first GOES-7 visible image from the BLIZZARD dataset (AKA GV4.1) centered on Kirksville, Missouri, and add a gray scale bar. Load it with the default enhancement (IMAGE) and erase any graphics in the frame.

  2. Initiate mouse-controlled grayscale stretching.

  3. Move the cursor to the image window.

  4. Move the mouse to the right to brighten the image. The range of pixels with a brightness near 255 (white) increases, as shown in the gray scale bar at the bottom of the frame.

  5. Move the cursor towards the top of the frame to decrease the image brightness. The range of pixels with a brightness near 0 (black) increases, as shown in the gray scale bar at the bottom of the frame.

  6. Find an enhancement that you like and press the right mouse button to end the enhancement.

  7. Save the grayscale enhancement as GRAY.

  8. Restore the original grayscale of the image.

    Now, you will manually input the brightness values with the EB command.

  9. Rescale the brightness values 71 to 141 to go from 0 to 255. Brightness value 71 will become 0 and value 141 will become 255. All values in between will be linearly stretched between 0 and 255.

    Since most of the brightness values are between 71 and 141, creating an enhancement for this range makes the image features more prominent. Note that all brightness values outside the range of 71 to 141 remain unchanged.

  10. Restore the original grayscale of the image.

Image Data Stretching

Image data stretching changes the grayscale of an image by stretching area data values to brightness values. To stretch the image data values, you must create a table that defines the values to stretch.

  1. Display the first GOES-7 4km Visible image of the BLIZZARD dataset on frame 1 centered on New Orleans. Decrease the resolution by a factor of 2 and add a high resolution map.

    Type: IMGDISP GV4.1 1 STA=KNEW MAG=-2 SF=YES REFRESH='EG;MAP H'

  2. Position the cursor at the center of the frame and list the brightness value.

    Type: PC C
    Press: Alt D

    The brightness value at the center is 82.

  3. Next, initialize a stretch table named LEARN to stretch brightness values. The VISR parameter specifies the data type as GOES 1-byte data.

    Type: SU INI LEARN VISR BRIT

  4. Define the brightness ranges to stretch. Assign the brightness value 0 to 255 and the value 255 to 0 to make light areas dark and dark areas light.

    Type: SU MAKE LEARN 0 255 255 0

  5. List the breakpoints in the stretch table.

    Type: SU TABLE LEARN

    The table lists the brightness values and the corresponding stretched values as shown below.

    SU TABLE LEARN                                                             
    BREAKPOINTS STORED IN TABLE : LEARN.ST                                     
    INPUT       OUTPUT                                                         
    -----       ------                                                         
     0             255                                                         
     255           0                                                           
    CALIBRATION TYPE  : VISR                                                   
    CALIBRATION UNITS : BRIT                                                   
    BAND NUMBER       : -1                                                     
    INTERPOLATION TYPE: LIN                                                    
    SU: DONE                                                                   
    

  6. Display the first GOES-7 4km Visible image on frame 2 centered at New Orleans. Decrease the resolution by a factor of 2, apply the stretch table LEARN, and add a high resolution map.

    Type: IMGDISP GV4.1 2 STA=KNEW MAG=-2 EU=IMAGE SU=LEARN SF=YES REFRESH='EG;MAP H'

  7. Set the loop bounds from 1 to 2 and compare the images.

    Type: LS 1-2
    Press: Alt A
    Press: Alt B

  8. Show frame 2 and list the areas values at the cursor's center.

    Type: SF 2;PC C;IMGPROBE

    Notice that there is a MODB/LEARN data type listed in the output of the D command, as shown below. This lists the value of the stretched data.

    Image Name: GV4.1                                                               
        File       Nominal  Image     RAW      BRIT     MODB                        
     Line/Element   Line/Element                        LEARN                       
      565/  680     3381/10305          82         82     173                       
    

    Since the values in the table are reversed (0 is now 255 and 255 is now 0), you can calculate the stretched value of a pixel by subtracting the pixel's original brightness value from the maximum value. For example, to calculate the stretched value of the center pixel, subtract the original brightness value (82) from the maximum brightness value (255); the stretched value of the center pixel is 173 (255-82).

  9. List the stretch tables on the workstation.

    Type: SU LIST

  10. Load the latest GOES-East IR image in frame 2, positioning the center at 32N 82W, blown down by a factor of 2. Add a data bar.

  11. List out the IRTEMP stretch table.

    This stretch table maps temperatures to output brightness values.

  12. Load the the same image using the IRTEMP stretch table and add a data bar.

  13. Compare the two images, one without a stretch table applied and the one with, as shown below.

    Note that although the images look the same, the data bar labels are listed in terms of the stretch table used. Without a stretch table, the raw brightness values are listed.


Table of contents Previous: Image Command Examples - Interrogation Next: Graphics and the Cursor