Image Sharpness Tool Edit ControlCognex VisionPro

This topic contains the following sections.

The Image Sharpness tool edit control provides a graphical user interface to the CogImageSharpnessTool tool, which you use to judge the sharpness of an acquired image. The edit control allows you to specify an operating mode, select a portion of the input region you want to analyze, and view a sharpness score for the last image. The following figure shows the Image Sharpness tool edit control:

Cognex Image Processing Image Sharpness Image Sharpness 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 the type of sharpness algorithm you want to use, select display graphics, and view a result score.
  • An image display window displays acquired images and graphical results of the Image Sharpness tool.

You can experiment with the edit control by using QuickBuild to create a CogImageSharpness tool. A new CogImageSharpness tool appears with the input terminal for the input image and an output terminal for the sharpness score, as shown in the following figure:

Cognex Image Processing Image Sharpness Image Sharpness Terminals

To include the edit control in your custom vision application, you must first add it to your Visual Studio.NET development environment. See the topic Add a Control for more information.

Control Buttons

Cognex Image Processing Image Sharpness basictoolbar

The following table describes the function of each button:

Table 1. Control buttons
ButtonDescriptionFunction
Run Button
RunGenerate a sharpness score for the Current.InputImage.
Electric Button
Electric modeToggle electric mode, where the Image Sharpness 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 Sharpness 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.InputImage buffer contains the last image processed by the Image Sharpness tool along with any graphics you enable from the Graphics tab.
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 choose an operating mode and specify any parameters the various modes require. The following figure shows the default Settings tab:

Cognex Image Processing Image Sharpness Image Sharpness Whole Control

Mode

Cognex Image Processing Image Sharpness Image Sharpness Settings Mode

Use the following options to choose an operating mode:

Table 2. Operating Modes
ModeDescription
Band PassAnalyze the image based on a range of edge frequencies.
AutocorrelationAnalyze the image based on its blurriness.
Absolute DifferenceAnalyze an image based on the difference between each pixel in the image and a corresponding pixel at a specified offset within the same image.
Gradient EnergyAnalyze an image based on the pixel-to-pixel contrast between adjacent pixels.
Band Pass Parameters

Cognex Image Processing Image Sharpness Image Sharpness Settings Band Pass

If you use the Band Pass filtering mode you must provide values for the following parameters:

Table 3. Band Pass Parameters
ParameterDescription
BandPassMinFrequencySet the low frequency limit for the band pass range, where the minimum value is 0.0.
BandPassMaxFrequencySet the high frequency limit for the band pass range, where the maximum value is 0.5.
Autocorrelation Parameters

Cognex Image Processing Image Sharpness Image Sharpness Settings Auto Correlationgif

The Autocorrelation Noise Level represents the grey-level variation inherent in the sensor. It should be be significantly smaller than the grey-level range observed in the image.

Absolute Difference Parameters

Cognex Image Processing Image Sharpness Image Sharpness Settings Ab Differences

If you use Absolute Difference mode you must provide values for the following parameters:

Table 4. Absolute Difference Parameters
ParameterDescription
AbsDiffDistanceXSet the image offset along the x-axis.
AbsDiffDistanceYSet the image offset along the y-axis.
Gradient Energy

Cognex Image Processing Image Sharpness Gradient Energy

Increase the GradientEnergyLowPassSmoothing parameter to remove potential high-frequency noise from the image.

Region Shape

Cognex Image Processing Image Sharpness Image Sharpness Settings Region Shape

You can use the Image Sharpness tool on the entire image or select a specific area of the Current.InputImage to analyze. You can select any of the following 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 Using Polygon Input Regions.

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 Sharpness Image Sharpness Graphics Tab

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

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

Use the Results tab to view the result score given to the last image the Image Sharpness tool analyzed. The following figure shows a Results tab:

Cognex Image Processing Image Sharpness Image Sharpness Results Tab

The Score varies depending on the operating mode you are using. The higher the score, the greater the sharpness of the image stored in the Current.InputImage buffer.