Sobel Edge Tool Edit ControlCognex VisionPro

This topic contains the following sections.

The Sobel Edge tool edit control provides a graphical user interface to the CogSobelEdgeTool tool, which you use to isolate and enhance the edge information in your images. The edit control allows you to specify a magnitude scaling factor, choose a post-processing operation, and view vision tool results.

Note: The output images' coordinate space trees are adjusted to preserve the relationship between root space and image features.

The following figure shows the Sobel Edge tool edit control:

Cognex Image Processing Sobel Control Sobel Edge Whole Control

The edit control offers the following features:

  • A row of control buttons at the top left provides access to the most common operations.
  • A set of function tabs allows you to choose the type of edge information to generate, select display graphics, and view results.
  • An image display window displays acquired images and graphical results of the Sobel Edge tool.

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

Cognex Image Processing Sobel Control Sobel Edge Terminals

Control Buttons

Cognex Image Processing Sobel Control Sobel Edge Tool Button Bar

The following table describes the function of each button:

Table 1. Control buttons
ButtonDescriptionFunction
Run Button
RunGenerate an edge angle, edge magnitude, and final magnitude image based on the current set of run parameters.
Electric Button
Electric modeToggle electric mode, where the Sobel Edge 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 Sobel Edge tool supports the following image buffers:

  • The Current.InputImage buffer contains the next image the tool will analyze plus any region graphics you might use to select a portion of the entire image available.
  • The LastRun.EdgeAngleImage buffer contains the last edge angle image.
  • The LastRun.EdgeMagnitudeImage buffer contains the last edge magnitude image.
  • The LastRun.FinalMagnitudeImage buffer contains the last final magnitude image.
  • The LastRun.InputImage buffer contains the last image processed by the Sobel Edge tool along with any graphics you enable.
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
ResetReset the vision tool to its default state.
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

This section contains the following subsections.

Use the Settings tab to specify the MagnitudeScale you want to use in the range 0.5 through 50. In addition you can choose any post-processing operation you want the tool to perform. The following figure shows the default Settings tab:

Cognex Image Processing Sobel Control Sobel Edge Settings Tab

Hysteresis Thresholding

If you choose edge hysteresis thresholding as a post-processing operation, the Settings tab shows the following parameters:

Cognex Image Processing Sobel Control Sobel Edge Settings Hysteresis

The following table describes the parameters you must configure to generate the best results:

Table 2. Edge Hysteresis Parameters
ParameterDescription
HysteresisThresholdLowAll pixels with edge magnitude values below the low threshold are automatically set to the non-edge value in the final magnitude image.
HysteresisThresholdHighAll pixels with edge magnitude values greater than or equal to the high threshold are automatically set to the edge value in the final magnitude image.
HysteresisSurvivorPelValueAll pixels that pass the edge hysteresis threshold method are set to this grey value.
HysteresisNonSurvivorPelValueAll pixels that fail the edge hysteresis threshold method are set to this grey value.
Whole-Pixel Peak Detection

If you choose whole-pixel peak detection as a post-processing operation, the Settings tab shows the following parameters:

Cognex Image Processing Sobel Control Sobel Edge Settings Whole Pixel

The following table describes the parameter you must configure to generate the best results:

Table 3. Whole-Pixel Peak Detection
ParameterDescription
PeakDetectThresholdAll pixels with edge magnitude values below this threshold are automatically discarded from the final magnitude image.
Region Tab

Use the Region tab to specify the input region for the tool. The following figure shows the Region tab:

Cognex Image Processing Sobel Control Sobel Edge Region Tab

The following table summarizes the features of the Region tab:

Table 4. Features on the Region Tab
FeatureDescription

RegionMode

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

  • Pixel Aligned Bounding Box specifies that the tool processes all the pixels contained within a pixel-aligned bounding box.
  • Affine Transform is valid only if you specify a CogRectangleAffine input region, where the pixels are affine-transformed to create a new image before the operators are applied.

Region

Select the shape of the input region. Selecting "None=Use entire image" means that the tool uses the entire input image. A 2D Symbol 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 training region is interpreted. For information, see Coordinate Space Names.
Select ModeSelects the set of parameters that define the rectangle when the available Region Shape is CogRectangle or CogRectangleAffine. If you use CogRectangleAffine, the angles of rotation and skew can be specified in degrees or radians, although the underlying tool keeps the measurements in radians.
Graphics Tab

This section contains the following subsections.

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

Cognex Image Processing Sobel Control Sobel Edge Graphics Tab

Results Area

Cognex Image Processing Sobel Control Sobel Edge Graphics Tab Results

Choose any of the following options:

Table 5. Results Options
OptionDescription
Show Edge Angle ImageYou can choose not to generate an image record for the LastRun.EdgeAngleImage .
Show Edge Magnitude ImageYou can choose not to generate an image record for the LastRun.EdgeMagnitudeImage.
Show Final Magnitude ImageYou can choose not to generate an image record for the LastRun.FinalMagnitudeImage.
Diagnostics

Cognex Image Processing Sobel Control Sobel Edge Graphics Tab Diagnostics

Choose which of the following graphics appear in the LastRun.InputImage buffer after the tool performs its image-processing operations:

Table 6. 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 RegionDisplay the input region if one was used.
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.