ViDiEL Segment Edit ControlCognex VisionPro 9.23

The Segment tool edit control provides a graphical user interface to the CogSegmentTool API, which you can use to divide an input image into foreground and background pixels. The tool generates information about foreground pixels that you can pass to other vision tools for analysis. See the topic Using a ViDiEL Segment Tool for more information.

The following figure shows an example ViDiEL Segment tool edit control as you label foreground pixels in a training image:

ViDiELSegment_Control_WholeControl

The edit control offers the following features:

  • A row of control buttons at the top provide access to the most common operations.
  • A set of function tabs allows you to train this Segment tool to differentiate foreground pixels.
  • An image display window shows acquired images and the output images a Segment tool can generate.

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

EL_Classify_toolbar

The following table describes the function of each button in the button bar:

ButtonDescriptionFunction
ViDiEL_run
RunExamine the Current.InputImage and segment foreground pixels from background pixels. To run the tool you must have a trained Segment tool.

ViDiEL_LocalDisplay

Local image display

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

  • The Current.InputImage buffer contains the latest acquired image.
  • The LastRun.InputImage buffer contains the latest acquired image overlayed with enabled graphics representing foreground pixels.

The edit control does not open the local image display by default, unless you choose the Graphics tab.

ViDiEL_FloatingDisplay
Floating image displayOpen one or more floating image windows, which support the same image buffers as the local image display window.
ViDiEL_Open
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.
ViDiEL_Save
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.
ViDiEL_SaveAs
Save AsSave the current properties of the vision tool to a new VisionPro persistence (.vpp) file.

ViDiEL_Reset

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, or its template-initialized state, which is appropriate for QuickBuild applications.

ViDiEL_FloatingResults
Show Floating ResultsOpen a separate results window with the same contents as seen in the Results tab.
ViDiEL_ToolTips
Show ToolTipsEnable or disable the display of tooltips for individual items in the edit control.
ViDiEL_Help
HelpOpen this VisionPro online help file.
Image Import & Region Tab

Use the Image Import & Region tab to acquire images from an image database or a connected camera:

ViDiELSegment_Control_ImageImportTab

See the topic Using a ViDiEL Segment Tool for details on using this tab to train a Segment tool.

See the following sections for more information:

Image Acquisition

Imported images appear along the top of the tab:

ViDiELSegment_Control_ImportedImages

Use the following options to import images from a file or from a connected camera:

ButtonDescription
Grab ImageImport the image currently stored in the Current.InputImage buffer.

Auto Grab

Automatically import every image coming from an image source into the tool.

With Auto Grab enabled, the Segment tool will not import more images than specified by Auto Grab Count.

Note: Be aware that with Auto Grab enabled and your CogJob in continuous run mode, QuickBuild might experience an acquisition overrun and stop importing images. To prevent acquisition overruns, open the Image Source dialog box and decrease the Acquisition rate to 1 frame per second:

ViDi_Segment_Theory_Introduction_DecreaseAcqRate

Import From FileImport the image from a single .bmp, .png, .jpeg or all the images in an image-database file. The button does not remove existing imported images from the tool.
Clear ImportsRemove all imported images from the tool.
Apply Region Shape to Imported Images

Use the Region Shape to apply a affine rectangle to all the imported images:

ViDiELSegment_Control_ApplyRegions

Click Apply Region to All and Add to transfer all the imported images to the Train tab.

Train Tab

Use the Train tab to select any imported image, label the foreground pixels, and train the tool with this image.

ViDiELSegment_Control_TrainTab

See the topic Using a ViDiEL Segment Tool for details on using this tab to train a Segment tool. The tab supports a set of tools for highlighting foreground pixels:

ViDiELSegment_Control_TrainTools

Check Graphics to enable a heatmap over the selected image to represent pixels the tool considers to be candidates for foreground pixels.

Graphics Tab

Use the Graphics tab to enable/disable graphics that appear in the images on the Train tab and in the LastRun images:

ViDiELSegment_Control_GraphicsTab

Labeled Training Data

The following options create an image record for any selected labeled image on the Train tab:

ViDiELSegment_Control_LabeledImageGraphics

These options have no effect if you do not have a labeled image selected.

Labeled Training Data
Show Bounded ImageIncluded the bounded image of the currently selected Labeled image.
Show Class OverlayInclude a single graphic overlay that colors each bounded image pixel according to the labeled assignments of the currently selected Labeled image.
Show Class LabelsCreate a mask image for each shape assignment in the labeled image.
Results

Enable or disable any of the following options for viewing the results the Segment tool generates:

Show HeatmapsInclude a heatmap image for the foreground pixels.
Show Segment GraphicHighlight the foreground pixels in the LastRun.InputImage.
Show Heatmaps as GraphicsInclude a LastRun.InputImage highlighting the foreground pixels.
Show Full Size Input ImageInclude the full sized Current.InputImage.
Diagnostics

The Without Copy, With Copy, and None options determine 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.