SurfaceFX Tool Edit ControlCognex VisionPro

The SurfaceFX tool edit control provides a graphical user interface to the CogSurfaceFXTool, which accepts four separate images of the same scene using different illumination and generates an image that enhances features that might be difficult to detect in any one of the original images. The following figure shows an acquired image and how a SurfaceFX tool can enhance the defects it contains:

CognexImageProcessing_SurfaceFX_DefectsFound

A SurfaceFX tool requires four separate input images of the object under inspection. See the topic Using a SurfaceFX Tool for more information on using a SurfaceFX tool. The following figure shows an example of the SurfaceFX tool edit control:

CognexImageProcessing_SurfaceFX_WholeControl

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 Adding Edit Controls to Visual Studio for more information.

See the following sections for more information:

Control Buttons

CognexImageProcessing_SurfaceFX_ButtonBar

The following table describes the function of each button:

ButtonDescriptionFunction
Run Button
RunGenerate the output image using the four input images held by the InputVisionData.
Electric Button
Electric modeToggle electric mode, where the SurfaceFX 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 SurfaceFX tool supports the following image buffers:

  • The Current.LitFrom[direction]InputImage buffers contain an image of the object lit from the [direction] (Right, Bottom, Left, Top).
  • LastRun.Output Image buffer contains the image generated by the SurfaceFX tool.
  • The Current.LitFrom[direction]InputImage buffers contain the last image processed that was lit from the [direction] (Right, Bottom, Left, Top).
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. 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 specify the qualities of the output image. The following figure shows the default Settings tab:

CognexImageProcessing_SurfaceFX_SettingsTab

The Settings tab offers the following controls:

ControlDescription
BrightnessSet the brightness percentage for flat areas of the CogImage8Grey output image. For example, a percentage of 50% is equal to a grey value of 128, while a percentage of 100% is equal to a grey value of 255.
ContrastSet the contrast for the CogImage8Grey output image, where higher values increase the intensity difference between pixels in the output image.
SmoothnessSet a value to control a smoothing filter applied to the grey levels of the output image. Larger values increase the appearance of larger defects, while smaller values increase the appearance of smaller defects.

Region

Select the shape of the input region that specifies the portion of each image to be processed. Selecting None=Use entire image means that the tool uses the entire input image. An SurfaceFX tool supports the following input region shapes:

The set of region-defining parameters that appear depend on the region shape you use.

SelectedSpaceNameThe coordinate space in which the SurfaceFX tool is interpreted. For more information, see Coordinate Space Names.

Experiment with these parameters to get the best results for your vision application.

Graphics Tab

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

CognexImageProcessing_SurfaceFX_GraphicsTab

Use the following options to configure the input region:

ControlDescription
Show RegionShow the input region on each of the Current and LastRun images.

Diagnostics

Select which diagnostic data the tool stores in the LastRunRecord

  • Show Input Images: Include the input images in the diagnostic data in the LastRunRecord.
  • Show Grid Aligned Region: Include the grid aligned region in the diagnostic data in the LastRunRecord.