ViDiDetect

The ViDiDetect tool allows you to create a deep learning-based defect detection solution, based on the Red Analyze tool in Unsupervised mode. With this tool, during the training phase you teach it only what a good part looks like, including any and all acceptable variations. Then, at runtime, it will discover any anomalies from the learned appearance, and return a deviation score and a pass/fail result.

To use the ViDiDetect function, perform the following:

  1. Select the ViDiDetect tool from under ViDi Tools in the Toolbox.
  2. Drag and drop the VidiDetect tool to the desired cell of the Spreadsheet.

  3. Set External Fixture in the Property Sheet that automatically opens:

    • Set to 0 if you do not want to use an external fixture.
    • Specify a fixture defined in another cell by clicking in the External Fixture text box, and then clicking on the cell in Spreadsheet, or by manually entering the cell reference.

  4. Set Region in the Property Sheet:

    • Define the X and Y offset from the Fixture origin and the region width and height in pixels, and the rotation of the region compared to the Fixture X axis in degrees.
    • Alternatively, double-click on Region and visually edit the region of interest.

  5. Click Open ViDi Editor in the Property Sheet to configure the ViDiDetect tool.
  6. Add the images that you want to include in your training set by dragging and dropping from the filmstrip. The bigger the training set, the more reliable the results.

  7. Label the good images in your training set:
    1. Click on the image in the main display once to apply a Good label.
    2. Click on the image twice to apply a Bad label. This is not necessary for training the ViDiDetect tool.
    3. Click on the image a third time and confirm in the pop-up window to change a Bad label to Good.

  8. Click the Brain icon to train the tool.
  9. Review your training images and verify that the results are correct.
  10. Use your testing images to qualify the results.

ViDiDetect Inputs

General Tab

Parameter Description

Image

This argument must reference a spreadsheet cell that contains a valid Image data structure; by default, the cell references A0, the cell containing the Image data structure returned by AcquireImage function.

External Fixture

Specifies a reference to a Fixture or Fixtures data structure. This fixture data is passed into the ViDi tools, and is used to define the views for each image. When using an external fixture, within the Region of Interest (ROI), select External. Then, from the Image Database menu, select Update All Training Fixtures, and modify the ROI of the ViDi tool. You can also update the ViDi tool reference to the external fixture data by right-clicking the ViDi data structure and selecting Update Training Fixtures.

Region

Also known as the Region of Interest (ROI), specifies the region of the image that undergoes analysis. Double-click on the Region parameter to create an Interactive Graphics Mode that you can transform and rotate. Select this parameter and press the Maximize Region button on the Job Edit toolbar of the property sheet to automatically stretch the region to cover the entire image.

X

The x-offset of the origin, in fixture coordinates.

Y

The y-offset of the origin, in fixture coordinates.

Width

The dimension along the region's x-axis.

Height

The dimension along the region's y-axis.

Angle

The orientation, in fixture coordinates.

Show

Specifies the display mode for ViDiDetect tool's graphical overlays on top of the image.

0 = hide all (default)

All graphics will be hidden, except when the cell containing the ViDiDetect function is highlighted in the spreadsheet.

1 = result graphics only

The result graphics will be shown at all times.

4 = input graphics only

The input graphics will be shown at all times.

2 = input and result graphics

The input and result graphics will be displayed at all times.

Runtime Tab

Allows access to ViDi Processing Tool Parameters that can be modified while the job is online. These parameters do not require that the tool be retrained. You can drag and drop these parameter to the spreadsheet, and publish them to the HMI for operator interaction.

ViDiDetect Outputs

Returns

A ViDiDetect data structure, containing the results of the trained tool.

Results

After the ViDiDetect tool has been trained, a result table can be generated, based on the ViDi Results Vision Data Access Functions, by right-clicking on the function's data structure and selecting Insert Getters.

Note: When the Vision Data Access Functions are automatically generated, the default setting will auto-populate the first five features to the table. If there are more than five features, you will need to manually add them to the table. If you wish to display more entries, you can expand the table by copying the last row and pasting additional rows at the end; make sure to increment the index number of any newly-pasted row so that the proper feature is indexed.
  View Index Score Lower Threshold Upper Threshold Passed Region Count Region Index Score Area Perimeter X Y
❒ViDiDetect

❒ViDiAnalyzeView

0 0.410121 0.403586 0.424612 1 0 0 #ERR #ERR #ERR #ERR #ERR
 

❒ViDiAnalyzeView

1 0.610165 0.403586 0.4036 0 2 0 0.454911 4.7 8.8 882.2 786.6
                1 0.46587 8.6 11.8 145.1 338
Function Description

GetViDiAnalyzeView(ViDiDetect, ViewIndex)

Returns a ViDiAnalyzeView data structure, which extracts the results from the indexed view.

GetScore(ViDiAnalyzeView)

Returns the overall score of the view.

GetScoreMap (ViDiAnalyzeView , VidiDetectView) Returns the score map image associated with the ViDiView.

GetLowerThreshold(ViDiAnalyzeView)

Returns the lower threshold value being used by the Red Analyze tool that output the referenced ViDiAnalyzeView data structure.

GetUpperThreshold(ViDiAnalyzeView)

Returns the upper threshold value being used by the Red Analyze tool that output the referenced ViDiAnalyzeView data structure.

GetPassed(ViDiAnalyzeView)

Returns the pass/fail value (1 = Pass; 0 = Fail) output by the referenced ViDiAnalyzeView data structure.

GetRegionCount(ViDiAnalyzeView)

Returns the number of regions generated by the referenced ViDiAnalyzeView data structure.

GetScore(ViDiAnalyzeView, RegionIndex)

Returns the score of the specified region.

GetArea(ViDiAnalyzeView, RegionIndex)

Returns the area (in pixels) of referenced region contained within the referenced ViDiAnalyzeView data structure.

GetPerimeter(ViDiAnalyzeView, RegionIndex)

Returns the perimeter (in pixels) of referenced region contained within the referenced ViDiAnalyzeView data structure.

GetX(ViDiAnalyzeView, RegionIndex)

Returns the center X location of the region.

GetY(ViDiAnalyzeView, RegionIndex)

Returns returns the center Y location of the region.