Annotating Images
Use Annotation to add text, symbols, polygons, lines, polylines, shapes, map information, and grayscale or color bars to images and plots. For classification images, add class keys. Annotation options are similar for images, plots or surface views. Annotations can be saved to files and included in output options.
Annotation can be placed in the Image window, the Scroll window, the Zoom window, or the virtual borders of an image.
Tip
Use ENVI's QuickMap feature to quickly overlay grid lines, titles, declination diagrams, North arrows, and borders on georeferenced images. For details, see Creating QuickMaps. |
Figure 4-3: Example Annotation in an ENVI Display Group
Figure 4-3: Example Annotation in an ENVI Display Group
|
|
- Select one of the following options:
- From the Image window menu bar select Overlay
Annotation.
- In any plot, including surface plots and X, Y, or Z profiles, select Options
Annotation.
- In the Annotation dialog, select Object
desired annotation type.
Note
Text annotation is the default mode. |
The function of each annotation type is described in the following sections.
Positioning Annotations
- In the Annotation dialog, select the Main, Scroll, or Zoom window toggle button.
Note
Normal mouse operations in the selected window are disabled. However, normal mouse operations still apply in the other windows. To temporarily suspended annotation, select the Off toggle button. All normal mouse operations are again possible in all windows. |
- Position annotation objects by left-clicking at the desired site on the image. Refer to the following table for specific mouse button and positioning functions.
- Use the colored diamond-shaped handle to place the annotation at the desired location. (The handle appears on all annotation types.)
- After the annotation is positioned, click the right mouse button to fix the object at that location on the image. The diamond-shaped handle disappears after the annotation is fixed.
Table 4-1: Mouse Button Assignments for Annotation
Table 4-1: Mouse Button Assignments for Annotation
|
Action
|
Mouse Button
|
Interaction
|
Where
|
|
Position current annotation
|
Left
|
Click and release
|
At desired location
|
|
Move current annotation
|
Left
|
Click, hold, and drag handle
|
Throughout image
|
|
Delete current annotation
|
Middle
|
Click and release
|
Anywhere in image
|
|
Fix current annotation and proceed to the next annotation operation
|
Right
|
Click and release
|
Anywhere in image
|
|
Prepare to reselect fixed annotation
|
Left
|
Click and pull down menu
|
Object Selection/Edit
|
|
Reselect annotation
|
Left
|
Click and drag to draw box
|
Around annotation object corners
|
|
Suspend annotation (all normal functions are returned)
|
Left
|
Click
|
Off toggle button
|
|
Resume annotation (normal functions suspended)
|
Left
|
Click
|
Image, Scroll, or Zoom toggle button
|
Setting Virtual Display Borders
Use Set Display Borders to append a virtual border to an image. You can place any type of annotation object in the border.
- Select Options
Display Borders.
- When the Display Borders dialog appears, enter the desired border width (in pixels) for the left, top, right, and bottom image border in the text boxes with the same relative position.
The image is re-displayed with the designated virtual border.
Changing Snap Factors
In the Annotation dialog, set the snap factor to use for placing your annotations. The snap factor causes any annotation located within the specified snap distance (in pixels) to snap to the same pixel location. A snap factor of 1 (the default) specifies placing the causes annotation exactly at the selected location.
- In the Annotation dialog, select Options
Set Snap Value.
- In the Set Snap Value dialog, use the increment arrows to select a value or enter the value in the Snap text box.
- Click OK.
Burning Annotation into Images
To burn the annotation into an image when it has been placed:
- In the Annotation dialog, select the Off toggle button.
Selecting Annotation Object Types
In the Annotation dialog, use the Object pull-down menu to select from the various annotation object types. Text, symbols, shapes, map information, and color ramps are available as annotation objects. Each object has its own annotation options and are described in more detail below.
Working with Text Annotation
- In the Annotation dialog, select Object
Text.
- Enter text by typing it in the text box at the bottom of the window.
More than one line of text may be entered at once.
- Select from the following specific options to change the text characteristics.
Note
The text characteristics do not change in the dialog. To see the changes, click in the Image window, but do not fix the annotation in place until you are satisfied with the appearance of the text. |
- To change text color, click on the Color drop-down button and select the desired color.
- To place the text on a solid colored background, use the Back drop-down button to select a color; to place the text directly on the image without a background (this is the default), select Off.
- To adjust the thickness of the text, enter a new thickness value in the Thick textbox or use the increment arrows to change the value in the Thick parameter box.
- To change the size of the text (in pixels), change the value or use the arrow increment buttons in the Size parameter box.
- To change the orientation of the text on the screen (the angle at which it is written), enter the value of the angle in degrees (counterclockwise, with respect to the horizontal [0 degrees]) in the Orien parameter box or toggle the arrow increment buttons.
- To center the text or justify it left or right, choose the appropriate option under the Align drop-down button.
Working with Symbol Annotation
- In the Annotation dialog, select Object
Symbol. The available symbols display in the selected font in the window at the bottom of the dialog. Individual characters in text fonts can also be selected using the Symbol option.
- Select the desired font or symbol set from the Font menu.
Note
The fonts labeled Misc, Special, and Math show some of the standard symbols available in IDL. |
- Click the left mouse button on the desired symbol. When selected, the symbol is highlighted in red.
Working with Polygon Annotation
- In the Annotation dialog, select Object
Polygon.
- Choose from the methods below to draw the polygon.
- Use the left mouse button (see the following table) to set the vertices of the polygon. Line segments (polygon sides) are drawn between the selected points. Or, draw the polygon by holding down the left mouse button while drawing.
- To delete the last segment drawn, press the middle mouse button.
- To close the polygon, press the right mouse button. A handle (a small diamond) appears.
Table 4-2: Polygon Annotation
Table 4-2: Polygon Annotation
|
Action
|
Mouse Button
|
Interaction
|
Where
|
|
Choose Polygon vertices
|
Left
|
Click and release
|
At desired location
|
|
Delete Polygon vertices (while drawing)
|
Middle
|
Click and release
|
Anywhere in image
|
|
Close Polygon
|
Right
|
Click and release
|
Anywhere in image
|
|
Position completed polygon
|
Left
|
Click and drag
|
On the handle
|
|
Move polygon vertices
|
Left
|
Click and drag
|
Near or on vertex
|
|
Delete polygon
|
Middle
|
Click and release
|
Anywhere in image
|
|
Fix current annotation
|
Right
|
Click and release
|
Anywhere in image
|
- Select from the following options to change or adjust the polygon attributes.
- To change the polygon color, select from the Color menu.
- To change the thickness of the polygon border (and fill if line-fill is chosen), enter a value in the Thick parameter box.
- To change the outline line style (solid, dashed, dotted, etc.), click the Line Style menu and select the desired style.
- To change the orientation of the polygon on the screen, enter the angle in degrees (counterclockwise) at which to display the polygon with respect to horizontal (0 degrees) in the Rotation parameter box. The Rotation value is always reset to 0 after it has been changed.
- Use the Fill drop-down button to set the fill attributes.
- To leave the polygon unfilled, select None.
- To fill the polygon with the polygon color, select Solid.
- To fill the polygon with equally spaced lines, select line, dashed, dotted, etc.
- To change the orientation of the fill lines, enter the value of the angle in degrees (counterclockwise, with respect to the horizontal [0 degrees]), in the Orien parameter box.
- To change the spacing of the lines, enter a value in the Spc parameter box.
Working with Polyline Annotation
- In the Annotation dialog, select Object
Polyline.
Note
The right mouse button is used complete a line, but does not close line segments into a polygon. |
- Select from the options described in Working with Polygon Annotation to change polyline attributes. The options color, line style, thickness, and rotation are available.
Working with Shape Annotation
Use Rectangle or Ellipse to annotate with geometric shapes.
- From within the Annotation dialog, select Object
Rectangle or Ellipse.
- Click and drag with the left mouse button to draw the shape.
- To draw a circle, hold down the control key while drawing an ellipse, or draw the circle using the middle mouse button.
- To draw a square, hold down the control key on the keyboard while drawing a rectangle, or draw the square using the middle mouse button.
- To set or change the size of the shape, grab a corner, an edge, or an axis end point (ellipse) and press and hold down the left mouse button while dragging to the desired size. The size can also be explicitly changed by entering the desired X and Y sizes (in pixels) in the text boxes labeled xsize: and ysize:.
- To delete the shape, press the middle button.
- To fix the object, press the right button as described in Table 4-2.
Working with Arrow Annotation
- In the Annotation dialog, select Object
Arrow.
- Select from the following steps to draw the arrow.
- To draw an arrow, click and drag with the left mouse button.
- To change the size and orientation, grab an end and press and hold down the left mouse button while dragging to the desired size. The size of the arrow head can also be changed by entering a new value into the Head Size parameter box.
- To delete the arrow, press the middle mouse button.
- To control the angle of the lines (in degrees) defining the arrow head, enter a value in the Head Angle parameter box.
Note
Entering smaller angles makes a narrower arrow head and larger angles makes a wider head. |
- Press the right button to fix the location and characteristics of the arrow when it has been formatted.
Working with Scale Bar Annotation
- From within the Annotation dialog, select Object
Scale Bar.
Note
If the data is not georeferenced, enter a value when the Image Pixel Size dialog prompts you for the image pixel size in meters. |
- Select from the following steps and options to position and change the scale bar.
- To position a scale bar in the image, press the left mouse button.
- To delete a scale bar, press the middle mouse button.
- To select which units of the scale bar to draw, set the arrow toggle button to On when the desired units are shown in the Scale drop-down list. A scale bar can be drawn in any combination kilometers, miles, meters, and feet.
- To change the spelling of the scale bar titles, click Change Scale Bar Titles and edit the spelling of the titles.
Note
You can permanently change the spelling of the titles used for scale bar annotation by editing the envi.cfg file (see The ENVI Configuration File). |
Note
When more than one of the unit types is set to On, multiple scale bars are drawn. |
- To set the height of a scale bar, in pixels, enter the desired value in the Height parameter box.
- To change the scale bar length, enter the desired length, in scale bar units, in the Length parameter box.
- To change the number of increments shown on the scale bar, enter the number in the Inc parameter box and the number of sub-increments within the first main increment in the Sub Inc parameter box. The length, increment, and sub-increment parameters are formatted for each type of scale bar individually.
- Press the right mouse button to fix the scale bar position and characteristics.
Figure 4-4: Scale Bar Annotation
Figure 4-4: Scale Bar Annotation
|
|
Working with Color Ramp and Grayscale Ramp Annotation
Use Color Ramp to place a wedge or color table on the image. The color table or wedge represents the currently applied ENVI color table. For a grayscale image the color ramp is a grayscale wedge from the minimum grayscale value to the maximum grayscale value. For a color image, the color ramp shows the distribution of the selected color palette.
Figure 4-5: A Grayscale Ramp Annotation.
Figure 4-5: A Grayscale Ramp Annotation.
|
|
- In the Annotation dialog, select Object
Color Ramp.
- Select from the following steps and options to position the ramp.
- To position the color ramp, click the left mouse button at the desired location.
- To delete the ramp, press the middle mouse button.
- To orient the ramp either horizontally or vertically, select from one of the following (A or B) by clicking on the pull-down menu initially labeled Horz
:
- For horizontal orientation, select Horz
(horizontal from low values to high values left to right) or Horz
(horizontal from high to low left to right).
- For vertical options select Vert
(vertical from high to low bottom to top) or Vert
(vertical from low to high bottom to top).
- Select from the following options to change the color ramp characteristics.
- To define the ramp width and length, enter the desired value in the parameter boxes labeled Width and Len.
- To place labels on the ramp, enter the minimum and maximum values in the Min and Max parameter boxes.
- To automatically enter minimum and maximum values calculated from the data into the Min and Max parameter boxes, click on the Calculate Min/Max button, then select the band from which to calculate the values. The minimum and maximum values are entered into the parameter boxes and can be edited, if desired.
- To define the increment (number) of labels to place on the ramp, enter the value in the Inc parameter box.
- To set the label precision (the number of significant figures), enter the number in the Precision parameter box. For example, 0.25 is a precision of 2, and .03 is a precision of 1. Labels are placed at the bottom of horizontal ramps and placed to the right of vertical ramps. Set Label attributes by selecting from the options described in Working with Text Annotation.
- Press the right mouse button to fix the color ramp when it has been positioned and formatted.
Working with Map Key, Class Key, and Vector Key Annotation
A map key consists of colored squares and corresponding labels for each map item or class in a classification image. Map keys can be defined interactively and are automatically created as class keys for classification images. Vector keys are automatically created for vector layers in the appropriate colors with the layer names as labels. Vector keys show the vector symbol used for points, a line for polylines, and a square outline for polygons.
- In the Annotation dialog, select Object
Map Key.
- Click the left mouse button at the desired location to position the map key.
Note
To delete the map key, press the middle mouse button. |
- Click Edit Map Key Items to define or change items in the map key.
- When the Map Key Object Definition dialog appears, select from the list of Key items.
- To add additional items to the list, click Add Item.
- To delete an item, highlight it in the list and click Delete Item.
- To change the name of the item, enter the new name in the Object Name text box.
- To define the color of the box, select the desired color using the Color menu.
- To add additional colors, enter the DN values in the R, G, and B, text boxes for red, green, and blue respectively. The newly defined color appears as black in the image but is correct upon output.
- To change the fill type in the box, use the Fill menu.
- To control the fill type, use the Orien and Spc parameter boxes.
- For vector keys, an Object Type drop-down button is included and has polygon, polyline, and point selections.
- For a vector polygon item, use the Fill drop-down button and Orien and Space parameter boxes to select the polygon fill type.
- For a vector polyline item, use the Line Style drop-down button to select different line styles.
- For a vector point item, use the Symbol menu to select the symbol type to show in the key.
- Follow these steps to change other parameters within the Annotation dialog.
- To set a background color select the desired color from the Back pull-down menu in the Annotation dialog.
- To change the text font for the key, the size, and the thickness of the letters, select from the options described in Working with Text Annotation.
Figure 4-6: Vector Key Annotation
Figure 4-6: Vector Key Annotation
|
|
Saving Map Key Annotation
- In the Map Key Object Definition dialog, click Save.
- At the prompt, enter an output filename.
ENVI writes the key to a file. Map key files should be saved with the file extension .key for consistency, but may be saved using other extensions at your discretion.
Restoring Saved Map Key Files
- In the Map Key Object Definition dialog, click Restore.
- Select the desired input file.
Working with Declination Diagram Annotation
Use the Declination option to place a declination diagram on the image. The declination diagram includes any combination of arrows pointing to true north (shown with a star), grid north (GN), and magnetic north (MN).
- In the Annotation dialog, select Object
Declination.
- Click the left mouse button at the desired location to position the declination diagram.
Note
To delete the declination diagram, press the middle mouse button. |
- Select from the following steps to change the attributes of the declination diagram.
- To set the angle of the north arrows, enter the values in degrees in the True North, Grid North, and Magnetic North text boxes.
The angles are not drawn to scale so that the arrows appear separated.
- To set the arrow length in pixels, use the Length parameter box.
- To change the color of the declination diagram, select from the Color drop-down button.
- To set the background color, select from the Back menu.
- To change the text font for the key, the size, and the thickness of the letters, select from the options described in Working with Text Annotation.
- To change the line and text thickness, enter a value in the Thick parameter box.
- Press the right mouse button to fix the position and characteristics of the declination diagram when it has been formatted.
Figure 4-7: A Declination Diagram Annotation
Figure 4-7: A Declination Diagram Annotation
|
|
Working with Image Annotation
Use Image to place other images, such as imported logos or subsampled images, inside the current image. Do not confuse this option with mosaicking (see Image Mosaicking).
Tip
Annotation needs to keep a copy of the image in memory so it is not advised to use large images. |
- In the Annotation dialog, select Object
Image.
- Click Select New Image.
- When the Annotation Image Input Bands dialog appears, select an RGB or grayscale file from the Available Bands List within the dialog. The R, G, and B text boxes are filled.
- To select a grayscale image, click on the same filename for all three bands.
- To perform spatial resampling of the data, enter a resize factor into the Resize Factor text box.
- To clear the filenames in the R, G, and B text boxes, click Reset.
- Click OK to return to the Annotation dialog and position the image inset.
- Left-click at the desired location to position the image.
To delete the image, click the middle mouse button.
- Right-click to fix the image at that location.
Working with Plot Annotation
Use Plot to overlay an ENVI plot on your image.
- Select Object
Plot.
- Click Select New Plot.
Note
If only one plot window is open, that plot is automatically selected. |
- When the Select Plot window appears, select the name of a plot by clicking on it. If you have multiple plot windows opened with the same name, they appear listed in the order in which they were opened.
- Enter or select the xsize and ysize in the Select Plot window, if desired.
- Click OK.
- Place the plot on the image by clicking with the left mouse button, dragging to the desired location, and clicking the right mouse button to fix the annotation in place.
The annotation appears in the image as a red box of the correct size entitled Plot as shown in the following figure, but the plot annotation appears correctly in the output file.
The plots remain as vectors when burned in to the image if you output it to postscript or a printer.
Figure 4-8: Plot Annotation
Figure 4-8: Plot Annotation
|
|
Note
Plot objects do not appear in the image if output to an image file. |
Annotating Multiple Plots
Use a test image to annotate and output multiple plots on a single page.
- From the ENVI main menu bar, select File
Generate Test Data and create a blank white image (see Generating Test Data for further details).
- Place the plot annotation on the blank image using standard annotation procedures.
The plot colors are automatically reversed to black on white for output.
Working in Selection Mode
Use Selection to move and change the attributes of annotation objects that are fixed in the image.
- Select Object
Selection/Edit.
- Select Options
Show Object Corners.
- Click and drag with the left mouse button to draw a box around the corner of the object in order to select it.
- Click the left mouse button on the handle and drag the object to a new location.
- Change the object's attributes by entering the new parameters in the Annotation dialog.
Selection options are:
- To select multiple objects at once, press and drag a box around the objects with the left mouse button.
- When more than one object is selected the previously selected objects remain active.
- When many objects are selected, using a handle to move one moves them all; changing attributes change all the selected objects' attributes.
- To edit selected vector objects (rectangle, ellipse, polygon, polyline, arrow), click the left mouse button on a vertex and drag it to the desired location.
- To deselect an object, click the middle mouse button on the handle of the object.
- To deselect multiple objects, press and drag with the middle mouse button to draw a box around the objects.
- To deselect all of the annotation objects within an image, click the right mouse button within the image.
- To select only those objects and deselect any previously active objects, press and drag with the right mouse button to draw a box around objects.
Additional options are available for selected annotation objects under the Selected menu (see Annotation Options).
Annotation Options
In the Annotation dialog, use the Selected or the Options menu to access annotation options. Options available when working with annotation objects include undoing the last action, joining polygons, swapping the positions of overlapping objects, duplicating or deleting annotation objects, adding virtual borders to an image, turning annotation mirroring on and off, and showing or hiding annotation object corners.
Selecting All Annotation Objects
To select all annotation objects, select Selected
Select All.
Joining Polygons
Use the Join option to join the overlapping parts of two polygons.
- Select two polygons to join.
- In the Annotation dialog, choose Selected.
- Next choose Join.
The underlying polygon's vertices are changed to match those of the overlying polygon.
Tip
Better results are obtained for polygons that have many vertices (for example, those drawn while holding down the left mouse button). Use the Swap option (see the next section) to bring a polygon to the top. |
Swapping Annotation Objects
Use Swap to bring an underlying object to the top.
- Select the objects to swap.
- Select Selected
Swap.
Duplicating Annotation Objects
Use Duplicate to duplicate existing Annotation objects instead of re-creating them.
- Select the objects to duplicate.
- Select Selected
Duplicate.
- Position the duplicate objects by dragging the handle to the desired location with the left mouse button.
Deleting Annotation Objects
To delete selected objects, select Selected
Delete.
To delete all of the annotation objects within the image, select Selected
Delete All.
Undoing Annotation Changes
To undo the changes made to a selected objects, select Selected
Undo.
The undo applies only to the last change made. After a new change is applied, selecting Undo applies to the latest change, etc.
Mirroring Annotation
Use mirroring with rectangles, ellipses, polygons, and polylines only. It is primarily designed for you to build custom filters for FFT filtering (see Defining FFT Filters).
To mirror shapes and polygons around the center of the image, select Options
Turn Mirror On.
To turn off the mirroring, select Options
Turn Mirror Off.
Showing Object Corners
Use object corners to make it easier to include corners in the selection box while in Selection mode. Object corners can be shown around all annotation objects except the vectors (rectangle, ellipse, polygon, polyline, and arrow). The corners are plotted as small asterisks around the annotation object.
To show object corners, select Options
Show Object Corners.
To hide object corners, select Options
Hide Object Corners.
Managing Annotation Files
Use the File menu in the Annotation dialog to save and restore annotation files.
Saving Annotations to Files
- In the Annotation dialog, select File
Save Annotation.
- When the new dialog appears, enter the output filename in the text box, or click Choose and enter or select a filename.
- Select OK to save the annotation to an output file.
Annotation files are saved with the file extension .ann for consistency, unless changed to other extensions at your discretion.
Restoring Saved Annotation Files
- Select File
Restore Annotation.
- When the file selection window appears with all
.ann files listed by default, select the appropriate annotation file for ENVI to load and display.
Hiding the Annotation Dialog
To hide or show the Annotation dialog without erasing your annotations, see Showing and Hiding Overlay Dialogs and Layers.
Closing the Annotation Dialog
To close the annotation dialog and remove all the annotation objects from the display, select File
Cancel.
If the annotations in the display have not been saved, an ENVI question dialog appears asking you if you want to save the file.
ENVI Online Help (August 12, 2005)