Caliper Edit ControlCognex VisionPro

Cognex Caliper Reference Caliper Control Whole Control

The Caliper edit control provides a graphical user interface to the CogCaliperTool and its components. The Caliper tool searches for edges or edge pairs within a projection region. The Caliper edit control has two modes: Single Edge or Edge Pair, which you can set up in the Settings tab. Single Edge mode locates edges, whereas Edge Pair mode locates edge pairs. Edge Pair mode can also measure the distance between edge pairs.

  • A row of control buttons at the top left.
  • A tool display window that can display the Caliper edit control image buffers: Current.InputImage, LastRun.InputImage, and LastRun.TransformedRegion. These buffers contain the input image that the Caliper tool examines; the same image after Caliper has run that includes the edges that the tool finds; and the edges themselves overlaid with a pair of graphs for GetProjectionValues and GetFilteredValues. Right click the tool display to bring up menu options that include zooming in or out of the image or showing a pixel or subpixel grid.
  • A set of tabs organized by function. These functions include settings for Single Edge or Edge Pair mode, desired scoring functions while running Caliper, display result settings, and the results themselves. Pressing the Control + Tab keys scrolls through the set of tabs.
  • A status bar at the bottom left of the control. A green circle indicates that the tool ran successfully; red means the tool ran unsuccessfully. The status bar also displays the time to run the tool and any error codes or messages. The first time that the status bar displays is the raw tool execution time. The second includes the time needed to update the edit control. Controls only update when they are visible.
Control Buttons

Cognex Caliper Reference Caliper Control Buttons

The following table describes the buttons at the top left of the edit control.

Table 1. Control buttons
ButtonDescription

Cognex Caliper Reference Caliper Control Run

Runs the Caliper tool. You must have an image available in the Current.InputImage buffer (equivalent to the ICogCaliperTool.InputImage). The default settings of the Caliper edit control cause the tool to search the entire image for a series of single edges. This button invokes the Run method.

Cognex Caliper Reference Caliper Control Electric

Toggles electric mode. When selected, the Caliper tool runs automatically if certain parameters have changed. When the edit control is in electric mode, these parameters are indicated by electric bolt icons.

Cognex Caliper Reference Caliper Control Local

Opens or closes the local tool display window. This window has a selection box that you use to specify the image buffer you want to view.

Cognex Caliper Reference Caliper Control Float

Opens one or more floating tool display windows, providing an additional tool display window. As with the local tool display window, you can specify the Caliper image buffer to view.

Cognex Caliper Reference Caliper Control Open

Loads a VisionPro persistence (.vpp) file, which contains a set of saved properties for this vision tool object type. Loading a persistence file for another object type throws an error and the load is unsuccessful.

For more information about VisionPro persistence features, see the topic Persistence in VisionPro.

Cognex Caliper Reference Caliper Control Save

Saves the current properties of the underlying tool to a VisionPro persistence file. You have the option to save either the entire tool or the tool without its images or results.

Cognex Caliper Reference Caliper Control Save As

Saves the current properties of the underlying tool to a new VisionPro persistence file.

Cognex Caliper Reference Caliper Control Reset

Resets the underlying tool to a default state.

Cognex Caliper Reference Caliper Control Grid Results

Opens a new, separate results window, allowing you to view run results without turning to the Results tab.

Cognex Caliper Reference Caliper Control Tool Tips

Enables or disables the display of tooltips for individual items in this edit control.

Cognex Caliper Reference Caliper Control Help

Opens the VisionPro online help.

Caliper Edit Control Image Buffers

The Caliper edit control has the following image buffers, all of which can be displayed in edit control's tool display window:

  • The InputImage buffer contains the current input image to the Caliper tool. When you run the tool, it examines the projection region in the InputImage and determines the number of edges or edge pairs based on the criteria defined in the Settings tab. The results of this search can be viewed on the Results tab.

  • The LastRun.InputImage buffer displays the last image on which the tool ran. With this buffer you can use the Graphics tab to specify the tool results to display, such as the edges found during the search.
  • The LastRun.TransformedRegion buffer displays a close-up of the projection region and can overlay it with two graphs. One graph displays GetProjectionValues and the other displays GetFilteredValues. .

Settings Tab

Cognex Caliper Reference Caliper Control Settings

Use the Settings tab to define the execute mode for the Caliper tool. You can set the Caliper either to Single Edge or Edge Pair mode. When the edit control is in electric mode, electric bolt icons indicate parameters whose changes cause the tool to run automatically.

Table 2. Features on the Settings Tab
FeatureDescription
EdgeModeDetermines whether the Caliper tool searches for a single edge or an edge pair for each result.
Edge0Polarity, Edge1Polarity

If you select Single Edge, only Edge 0 Polarity values are available. This is the desired polarity of the first (only) edge.

Edge 1 Polarity values are available if you select Edge Pair mode. This is the desired polarity of the second edge.

Edge Pair WidthIf you select Edge Pair scoring, you must set the Edge Pair Width, the distance (in units of the selected space) between each edge of the pair. Derived from the Edge0Position and Edge1Position properties.
ContrastThresholdThe minimum contrast required for an edge to be considered during the scoring phase.
MaxResultsThe maximum number of results to find.
FilterHalfSizeInPixelsSpecifies the half-width of the filter.

Region Tab

Cognex Caliper Reference Caliper Control Region

Use the Region tab to define the Region that will be applied to the Current.InputImage buffer. You can also define the projection region graphically in the Current.InputImage buffer. It may be easier to first specify the projection region graphically, then use this tab to fine tune the projection region parameters. The edit control updates the projection region values so that the values on this tab always match the shape of the projection region in the Current.InputImage buffer.

You can specify the rotation and skew in either degrees (the default) or radians. The underlying tool keeps the values in radians but the edit control performs the conversion to degrees when appropriate.

Table 3. Projection Region Features
FeatureDescription
RegionThe shape of the projection region. Selecting "None=Use entire image" means that the entire Current.InputImage is used.
SelectedSpaceNameThe coordinate space in which the region is interpreted. For more information, see Coordinate Space Names.
Select ModeSelects the set of parameters that define the rectangle. 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 search region within Current.InputImage.

Scoring Tab

Cognex Caliper Reference Caliper Control Scoring

Use the Scoring tab to create a collection of scoring functions to use when running the tool. The scoring functions that are available depend on the Edge Mode selection. Equivalent to SingleEdgeScorers and TwoEdgeScorers collections.

The list at the bottom of the tab displays the functions that you have added to the collection. When you highlight a scoring function, the tab displays a graph of the scoring function that labels the function parameters that you specify.

If the Edge Mode is Single Edge, then these scoring functions are available:

If the Edge Mode is Edge Pair, then these scoring functions are available:

Function Buttons

Cognex Caliper Reference Caliper Control Function Buttons

Use the function buttons on this tab to manage the scoring functions. They are described in the following table.

Table 4. Function Buttons
ButtonDescription

Cognex Caliper Reference Caliper Control Add Function

Add a new scoring function. When you click this button, a menu appears with a list of scoring functions appropriate to the current edge mode. Highlight the function that you want and a new line appears in the list of functions at the bottom of the tab. You can add more than one function of the same type.

Cognex Caliper Reference Caliper Control Delete Button

RemoveAt the currently highlighted function in the list of functions at the bottom of the tab. When you delete a function, a verification message appears asking you to confirm deletion.

Cognex Caliper Reference Caliper Control Move Up

Move the currently highlighted function up in the list, and updates the function's index in the function collection.

Cognex Caliper Reference Caliper Control Move Down

Move the currently highlighted function up in the list, and updates the function's index in the function collection.

Function List Features

The function list displays all the scoring functions you have added, and also allows you to specify each function's parameters. To enter a value in a cell, left click the cell. An entry box appears and you can enter the value you want. Press the Enter key for the value to take effect.

The following table describes the columns of the scoring function list.

Table 5. Scoring Tab Features
ColumnDescription
NThe index of the scoring function within the function collection, which is either SingleEdgeScorers or TwoEdgeScorers.
Function NameThe name of the function. You can add more than one of the same type of scoring function; the Results tab tracks the functions with both the function name and the index into the function collection.
EnabledCheck this box if you want this scoring function to be applied when the tool runs the next time. Disabling a scoring function eliminates the impact of the Scoring function.
X0 > XcRepresents the orientation of the graph. For the function to be valid, X1 must be between or equal to X0 and Xc. This column allows you to swap X0 and Xc, if necessary.
X0, X1, Xc, Y0, Y1 The parameter values for a one-sided function, or the first set of values for a two-sided function. See each scoring function class for information about these values.
X0h > XchRepresents the orientation of the graph. Applies only to two-sided functions (the SizeDiffNormAsym function). To be valid, X1h must be between or equal to X0h and Xch. This column allows you to swap X0h and Xch, if necessary.
SetXYParametersThe second set of parameter values for a two-sided function. See each scoring function class for information about these values.

Graphics Tab

Cognex Caliper Reference Caliper Control Graphics

Use the Graphics tab to control what is displayed in the tool displays. When the control is in electric mode, electric bolt icons display parameters that cause the tool to run automatically if the parameter values change.

Table 6. Graphics Tab Features
FeatureDescription

Results

You can display the following results graphics.

  • Show Edges Found displays the found edges in LastRun.InputImage
  • Show Projection Graph displays the GetProjectionValues graph in the LastRun.RegionData
  • Show Filtered Graph displays the GetFilteredValues. graph in the LastRun.RegionData
  • Show Edge Pair Width displays the found edges in the LastRun.RegionData (and hence can be overlaid with the Projection Data and Filtered Projection Data graphs).

Diagnostics

You can display the following results graphics.

  • Show Region overlays the projection region in the LastRun.InputImage.
  • Show Affine Transformed Image displays the projection region within LastRun.RegionData. This selection transforms the projection region to account for any skewing or rotation, so that the region and the graph data line up.

The Show Input Image option buttons let you specify whether a reference to the input image or a deep copy of the input image is displayed for the LastRun.InputImage. You can also specify that no image be displayed.

Results Tab

The Results tab displays the results of the Caliper tool's execution. This is a collection of results which compare to the CogCaliperResult interface. Use the slider control below the results grid to scroll through each set of results.

Cognex Caliper Reference Caliper Control Results

Table 7. Results Tab Features
FeatureDescription
IDUnique ID for this result in collection.
ScoreOverall score for this result.
Edge0The index of the first edge that contributed to this result.
Edge1In Edge Pair mode, the index of second edge that contributed to this result.
Measured WidthIn Edge Pair mode, the width of the two edge pairs. Derived from the Edge0Position and Edge1Position properties.
PositionOne-dimensional measurement along the search direction relative to the center of the input region.
PositionXYCoordinate values for the location of this result.
GetContributingScoresThe rest of the columns list the individual results of the enabled scoring functions within the list created on the Scoring tab. Note that the functions are identified by their index in the collection of scoring functions as Scoring Function n.