Image Average Tool Edit ControlCognex VisionPro

The Image Average tool edit control provides a graphical user interface to the CogImageAverageTool tool, which you use to accumulate a number of acquired images of the same scene and generate an average image. Generating an average image can be helpful for reducing image noise or for generating a reliable image where lighting can be erratic. In addition to the average image, the tool can also calculate a standard deviation image, where lighter pixels indicate a higher degree of variation between images. The following figure shows the Image Average tool edit control:

Cognex Image Processing Image Average Image Average Whole Control

The edit control offers the following features:

  • A row of control buttons at the top left provide access to the most common operations.
  • A set of function tabs allow you to choose whether to generate a standard deviation image, choose an input region, and determine what graphics the tool will use.
  • An image display window displays acquired images and the output images the Image Average tool generates.

You can experiment with the edit control by using QuickBuild to create a CogImageAverage tool. A new CogImageAverage tool appears with the input terminals for the input image and the average image, as shown in the following figure:

Cognex Image Processing Image Average Image Average Terminals

Control Buttons

Cognex Image Processing Image Average Image Average Tool Button Bar

The following table describes the function of each button:

Table 1. Control buttons
ButtonDescriptionFunction
Run Button
RunAdd the latest input image and generate the average image, and the standard deviation image if requested.
Electric Button
Electric modeToggle electric mode, where the Image Average tool executes automatically when particular configuration parameters change. In electric mode, a lightning bolt appears next to every electric property.

Local Display Button

Local image display

Open or close the local image display window. A Image Average tool supports the following image buffers:

  • The Current.InputImage buffer contains the next image the tool will analyze plus the graphic for the input region.
  • The LastRun.AverageImage buffer contains the last average image the tool generated.
  • The LastRun.StandardDeviationImage buffer contains the last standard deviation image the tool generated.
  • The LastRun.InputImage buffer contains the last image processed by the Image Average tool along with any graphics you enable from the Graphics tab.
  • The LastRun.TransformedRegionPixels contains the affine-transformed image, but only if you have specified Affine Transform for the Region Mode and you have supplied a CogRectangleAffine for the input region.
Floating Display Button
Floating image displayOpen a floating image window, which supports the same image buffers as the local image display window.
Open Button
OpenOpen a VisionPro persistence (.vpp) file that contains a set of saved properties for this vision tool object type. VisionPro reports an error if you try to open a .vpp file for another object type.
Save Button
SaveSave the current properties of the vision tool to a VisionPro persistence (.vpp) file. The edit control allows you to choose between saving the vision tool with or without its image buffers and tool results.
Save As Button
Save AsSave the current properties of the vision tool to a new VisionPro persistence (.vpp) file.

Reset Button

Reset

Reset the vision tool to its default state.

The tool gives you a choice between resetting to the default-constructed state, which is appropriate when you are using it in a Visual Studio.NET application, and its template-initialized state, which is appropriate for QuickBuild applications.

Tool Tips Button
Show ToolTipsEnable or disable the display of tooltips for individual items in the edit control.
Help Button
HelpOpen this VisionPro online help file.
Settings Tab

Use the Settings tab to determine whether the output image contains pixels from the input image or a constant grey value, and how the tool handles pixels outside the input region but within the borders of the region bounding box. The following figure shows the default Settings tab:

Cognex Image Processing Image Average Image Average Settings Tab

Use the Settings tab to configure the tool to generate a standard deviation image, view the number of images used to create the current average image, and reset the average image to a blank image.

The Settings tab offers the following controls:

Table 2. Settings Tab
ControlDescription
StandardDeviationEnabledDetermine whether or not the tool calculates the standard deviation image in addition to the average image. Changing the value of this property will clear the current average image.
NumImagesView the current number of images that have been used to calculate the average image.
ResetClear the current average image and standard deviation image, if requested.
Region Tab

Use the Region tab to select the shape of the input region. The following figure shows the Region tab:

Cognex Image Processing Image Average Image Average Region Tab

Use the following options to configure the input region:

Table 3. Region Tab Options
ControlDescription

RegionMode

Defines how the tool interprets the training region you specify. Choose either of the following options:

  • Pixel Aligned Bounding Box processes all of the input image within a bounding box surrounding the region shape you are currently using.
  • Affine Transform is valid only if you specify a CogRectangleAffine for the region shape, where the pixels within the affine rectangle undergo an affine transformation to remove the effect of any rotation and skew.

Region Shape

Select the shape of the input region. Selecting "None=Use entire image" means that the tool uses the entire input image. An Image Average tool supports the following input region shapes:

The set of region-defining parameters that appear depend on the region shape you use. For more information on using a polygon as an input region, see the topic Using Polygon Input Regions.

SelectedSpaceNameThe coordinate space in which the copy region is interpreted. For more information, see Coordinate Space Names.
Select ModeAvailable when Region Shape is cogRectangle or cogRectangleAffine. Selects the set of parameters that define the rectangle. If CogRectangleAffine is chosen, note that the angles of rotation and skew can be specified in degrees or radians, although the underlying tool keeps the measurements in radians.
FitToImageCenters the region within Current.InputImage.
Graphics Tab

Use the Graphics tab to specify the graphics that the tool generates and displays. The following figure shows the Graphics tab:

Cognex Image Processing Image Average Image Average Graphics Tab

Results

Cognex Image Processing Image Average Image Average Graphics Tab Results

Enable either of the following options:

Table 4. Results Options
OptionDescription
Show Average ImageYou can choose not to generate an image record for the LastRun.AverageImage.
Show Standard Deviation ImageYou can choose not to generate an image record for the LastRun.StandardDeviationImage.
Diagnostics

Cognex Image Processing Image Average Image Average Graphics Tab Diagnostics

Enable any of the following options:

Table 5. Graphic Options
OptionDescription
Show Input ImageDetermine whether or not the input image is recorded as part of the diagnostic record, and whether the image is copied to the record or saved in the record as a reference.
Show RegionEnable a graphic representing the input region for the LastRun.InputImage.
Show Transformed Region ImageDisplay the affine transformed image, but only if you have specified Affine Transform for the Region Mode and you have supplied a CogRectangleAffine for the input region.