6.8   Graphics Window

This window displays iconic data: images, regions, and XLDs. You may open several graphics windows. The active graphics window is shown by in the window's tool bar.

Figure 6.77 (1) shows an example graphics window which is displaying a color image of a pizza overlaid with region data (the segmented salami slices). One of the displayed regions is selected (illustrated by the dashed border). The variable name and index of the selected region is displayed in the title bar.

Figure 6.77: Graphics window displaying a tasty pizza: (1) full view, (2) zoomed in with pixel information.

The origin of the image coordinate system is the upper left image corner with the coordinates (0,0). The x values (column) increase from left to right, the y values (row) increase from top to bottom. When the mouse cursor is placed inside a graphics window, the coordinates (row, column) and the gray value (or in this case: the RGB values) at that position are displayed in the status bar (see page 106). Sometimes, it is desirable to display this information close to the mouse cursor. This can be achieved by holding down the Ctrl key (note: this does not work when the zoom in and out tool is selected since pressing Ctrl inverts the corresponding zoom action). Figure 6.77 (2) shows the coordinate/color value display after zooming in with the mouse wheel.

Normally, the visible part in the graphics window is based on the most recently displayed image, which is automatically zoomed so that every pixel of the image is visible. The coordinate system can be changed interactively using the menu Visualization ▹ Set Parameters ▹ Zoom (see section “Menu Visualization” on page 207) or the operator dev_set_part (see section “Develop” on page 265). Every time an image with another size is displayed, the coordinate system is adapted automatically.

Every HDevelop graphics window has its own visualization parameters. Thus, modifying the parameters (see section “Menu Visualization” on page 207) applies to the currently active graphics window only, i.e., the parameter settings of all other open graphics windows remain unchanged.

Each window has a history that contains all

that have been displayed or changed since the most recent clearing or display of an image. This history is used for redrawing the contents of the window. The history is limited to a maximum number of 30 “redraw actions”, where one redraw action contains all objects of one displayed variable.

Other output like text or general graphics like disp_line or disp_circle or iconic data that is displayed using HALCON operators like disp_image or disp_region are not part of the history, and are not redrawn. Only the object classes image, region, and XLD that are displayed with the HDevelop operator dev_display or by double-clicking on an icon are part of the history.

Tool Bar

Clear the graphics window and its history.

Switch to select mode. In this mode, you can select regions or XLDs that are displayed in the graphics window. A selected item is highlighted with a dashed border. If multiple layers of region/XLD data are displayed in the graphics window, the first click selects the uppermost region/XLD under the mouse cursor. Each subsequent click at the same position selects the region/XLD below the currently selected item. The variable name of the selected item is displayed in the title bar of the graphics window for reference.

You can use the select mode to inspect gray value histograms and features of individual regions or XLDs.

In the example image illustrated in figure 6.77, the displayed image of a pizza is overlaid with region data. A single region is selected.

Combined move/zoom tool. Drag the displayed image with the left mouse button to alter the displayed portion.

Magnifying glass. Click into the graphics window to magnify the area at the mouse cursor.

Zoom in. Click the small arrow next to the icon to switch to zoom out.

Zoom out. Click the small arrow next to the icon to switch to zoom in.

Set image size. Clicking this icon sets the image size to the shown value. The value can be selected from the menu attached to the small arrow. Additionally, the resizing behavior can be selected. See section “Image Size” on page 214 for additional information.

Set window size. (Only available for floating windows.) Clicking this icon sets the window size to the shown value. The value can be selected from the menu attached to the small arrow. See section “Window Size” on page 213 for additional information.

Draw ROIs and XLDs interactively. See section “ROI Window” on page 416.

Toggle 3D plot mode (see below).

Active graphics window.

Non-active graphics window. Click the icon to activate the corresponding graphics window. Only one graphics window may be active any given time.

If you want to specify display parameters for a window, you may select the menu item Visualization in the menu. Here you can set the appropriate parameters by clicking the desired item (see section “Menu Visualization” on page 207). The parameters you have set this way are used for the active window. The effects of the new parameters will be applied directly to the last object of the window history and alter its parameters only.

Context Menu

The context menu may be enabled/disabled from the preferences.

The entries of the context menu are a subset of the menu Visualization.

3D Plot Mode

Clicking activates an interactive 3D plot mode. It displays meaningful information for height field images, i.e., images that encode height information as gray values. The greater the gray value, the higher the corresponding image point. Figure 6.78 shows a height field image of a solder ball (1) and the corresponding 3D plot (2).

The 3D plot mode uses OpenGL and benefits from hardware acceleration.

Figure 6.78: (1) Default image display, (2) 3D plot mode.

Using the mouse you can alter the view of the 3D image (select mode must be active for this to work, click in the tool bar):

There are four different rendering methods (texture, shaded, hidden_lines, and contour_lines) which can be selected from the drop-down menu in the tool bar. See set_paint for detailed information about the different methods. The display quality may be fine-tuned in the tool bar of the graphics window or in the visualization parameters of the graphics window (right-click into the graphics window, select Set Parameters, and open the tab card Paint).

Figure 6.79: 3D plot mode settings: (1) visualization parameters, (2) tool bar, (3) mode, (4) quality, (5) step, (6) axes, (7) grid.

Mode
sets the rendering mode just like the drop-down menu in the graphics window.

Plot Quality
allows setting the rendering quality in four steps. On systems without proper display hardware acceleration a lower quality should be selected to speed up the display.

Step
sets the level of detail. In general, the lower the step value, the higher the level of detail. However, if the rendering mode is set to contour_lines, increasing the step value increases the level of detail.

Display Axes
If this is enabled, the axes of the 3D coordinate system are displayed in the 3D view.

Display Grid
If this is enabled, the “floor” of the 3D plot is painted as a grid.

See also section “Paint settings” on page 232 for the other paint modes that may be selected in this window.

Special Keyboard Shortcuts in the Graphics Window

Left, Right, Up, Down move mouse cursor 1 pixel
Alt+Left, Right, Up, Down move mouse cursor 10 pixels
Ctrl+Left, Right, Up, Down pan image 1 pixel
Ctrl+Alt+Left, Right, Up, Down pan image 10 pixels

If there is at least one docked graphics window, all floating graphics windows are closed with F2. This shortcut also works in the main window.

More keyboard functions of the graphics window are listed in appendix “Graphics Window”.